Question: CPS 180-Programming Assignment #3 Date Assigned: 05/23/16 Date Due: 05/29/16 Points 40 Objective: Find out the true MPG (Miles Per Gallon) of a vehicle, given
CPS 180-Programming Assignment #3 Date Assigned: 05/23/16 Date Due: 05/29/16 Points 40 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, l 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 println0 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. l. City or Highway Driving: Use a boolean type variable for input City Subtracts 2 from MPG Highway Adds 5 to MPG 2. Rainy or Sunny: Use a String type variable for input "Rainy" Subtracts l from MPG "Sunny" No Change to MPG 3. 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 4. Weight in Vehicle (cargo or passenger): Use double type for input Each 100lbs subtracts 0.5 MPG
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
