Objective: Find out the “true” MPG (Miles Per Gallon) of a vehicle, given a group of conditions which the user provides values for. 5 are given, 1 you create on your own. Requirements: Prompt the user for the car’s MPG first. i.e. Please Enter MPG: 26 Then prompt the user to enter a value for six factors which will affect the MPG of the vehicle, prompting for single value inputs after showing menus (i.e. a series of println() statements showing the options/valid values to enter) After collecting all of the inputs, provide a detailed report of the inputs, their meaning, how much they affect MPG, as well as the the beginning and final MPG. The following criteria will be used for the six inputs. City or Highway Driving: Use a boolean type variable for input City Subtracts 2 from MPG Highway Adds 5 to MPG Rainy or Sunny: Use a String type variable for input “Rainy” Subtracts 1 from MPG “Sunny” No Change to MPG Elevation: Use a char type variable for input ‘S’ for Steep, Steep Subtracts from 5MPG ‘H’ for Hilly, Hilly Subtracts 3 from MPG ‘F’ for Flat, No Change to MPG Weight in Vehicle (cargo or passenger): Use double type for input Each 100lbs subtracts 0.5 MPG Speed Preference: Use an int type variable for input 1 for under speed limit, Add 2 to MPG 2 for at speed limit, No Change to MPG 3 for 5% above speed limit, Subtract 1 from MPG 4 for 10% above speed limit, Subtract 3 from MPG 5 for over 20% above speed limit, Subtract 5 from MPG Suggestion: Use a switch() statement for Speed Preference Add one additional factor which you will prompt the user for, that affects MPG such as tire pressure/condition, hybrid vs. gas powered, engine condition, towing load, 2WD/4WD,
import java.util.*; public void CityOrDriving(){ |
Objective: Find out the “true” MPG (Miles Per Gallon) of a vehicle, given a group of...
8.2.19-T The table below contains the overall miles per gallon (MPG) of a type of vehicle Complete parts a and b below 24 24 20 26 24 29 35 23 28 20 44 31 25 22 a. Construct a 95% confidence interval estimate for the population mean MPG for this type of vehicle, assuming a normal distribution The 95% confidence interval estimate is from (Round to one decimal place as needed) MPG to MPG 8.EOC.57-E Question Help A consulting firm...
Make a program that will calculate and compute for the quotient of miles and gallons (mpg: miles per gallons). Your program should must ask the user to specify the size of the array (using dynamic array) for the following variable: miles ,gallons and mpg. Prompt the user to Initialize the value of miles (value for miles should be 100-250) and gallons (values should be from 5-25). Use pointer galPtr for gallons, milPtr for miles and mpgPtr for mpg. Use function...
You previously wrote a program that calculates and displays: Miles driven Miles per gallon Kilometers driven Liters of fuel consumed Kilometers per liter Messages commenting on a vehicle's fuel efficiency And also validates input Now we'll make a somewhat major change. We'll remove the code for obtaining input from a user and replace it with hardcoded data stored in lists. Because the data is hardcoded, the program will no longer need the code for validating input. So, you may remove...
CIS247C Week 3 Project Overview The objective of this week is to enhance last week's Vehicle class by making the following changes: • Create a static variable called numVehicles that holds an int and initialize it to zero. This will allow us to count all the Vehicle objects created in the main class. • Add the copy constructor • Increment numVehicles in all of the constructors • Decrement numVehicle in destructor • Add overloaded versions of setYear and setMpg that...
Car engine displacement in liters and fuel consumption for combined city/highway in miles per gallon (MPG). This data is from 2015 Fuel Economy Guide for the Department of Energy (DOE) Engine a. Make a scatterplot of the car MPG by displacement from the data in columns B and C. Displacement Combined Be sure the scatterplot contains the 5 important points of a chart or graph. Car Liters MPG Acura RLX 3.5 22.0 b. Place the regression trend line on the...
//Vehicle.h #pragma once #include<iostream> #include"Warranty.h" #include<string> using namespace std; class Vehicle{ protected: string make; int year; double mpg; Warranty warranty; static int numOfVehicles; public: Vehicle(); Vehicle(string s, int y, double m, Warranty warranty); Vehicle(Vehicle& v); ~Vehicle(); string getMake(); int getYear(); double getGasMileage(); void setMake(string s); void setYear(int y); void setYear(string y); void setGasMileage(double m); void setGasMileage(string m); void displayVehicle(); static int getNumVehicles(); Warranty getWarranty(); void setWarranty(Warranty& ); }; //Vehicle.cpp #include "Vehicle.h" #include <string> Vehicle::Vehicle() { make = "unknown"; year =...
I need to create a code for this prompt: In this project we will build a generic UserInput class for getting keyboard input from the user. Implementation: The class UserInput is a 'Methods only' class, and all the methods should be declared static. Look at the TestScanner.java program at the bottom of this page that inputs a string, int and double. It shows you how to use Scanner class to get input from the keyboard. Write FOUR simple methods, one...
This is java and make simple program. CPSC 1100. Thanks CSPS 1100 Lab 4 ay total Also I would need a new name for the daubles. An example here might be double tRtalD-caradd xD, YD) 1. (a) We are going to begin with some simple math, reading input, and formatted output. Create a class called MuCalsustec Yau will not have an instance variable. Since you have no instance variables to initialize, you do nat need a constructar. Do NOT create...
Programming language: PYTHON Prompt: You will be creating a program to show final investment amounts from a principal using simple or compound interest. First, get a principal amount from the user. Next, ask the user if simple or compound interest should be used. If the user types in anything other than these options, ask again until a correct option is chosen. Ask the user to type in the interest rate as a percentage from 0 to 100%. Finally, ask the...
In June 2008, when gasoline prices were at an all-time high (more than $3.81 per gallon), Chrysler Motor Company promoted its Jeep vehicle with the offer of either $4,250 off the price of the vehicle or the guarantee that the buyer would not pay more than $2.75 per gallon of gas for the next 3 years (the details of the guarantee could vary by dealer). Required: 1. Assume that the Jeep vehicle you are interested in gets 15 mpg combined...