1. (15 points) Answer the following questions for the pfoblem What are the input
ID: 3870785 • Letter: 1
Question
1. (15 points) Answer the following questions for the pfoblem What are the inputs? or string) How do you get from inputs to the outputs you want (process)? What format are they in? (e-g., integer, floating-point, character, What is the valid range (if any) of each input? To follow these steps, what else do you need? Other variables, constants, conversion? (besides input and Libraries (e.g., for calculations). What format are they in? output variables) What are the outputs? Automobile manufacturers publish two gas milcage mumbers for their ans Highway driving miles per gallon and city driving miles per gallon (the first number is higher). Each car also has gas tank in gallons. What is the maximum distance, minimum distance and average distance (half highway driving, half city driving) that a car can expect to travel on one tank of gas?Explanation / Answer
we can conside the name of the cars as string.
Number of cars can be consonant , as there are two cars throughout the program but it should be const int type.
Highway Miles per gallon and city driving miles per gallon where first is higher than second , so variables for these values(Highway miles per gallon & city driving miles per gallon) can be used either integer or float based on user's choice . If we need more accurate results then we should use float values.
The capacity of gallon tank should be taken in float as it can be 23.7 like this.
if Highway miles per gallon & city driving miles per gallon are taken as integer then maximum and minimum distance as integer values only.
And if Highway miles per gallon & city driving miles per gallon are taken as float values then maximum and minimum distance as float values only.
Average distance can be calculated using inputs and average should be float because it can result in decimal values .
Inputs -
number of cars , names of cars
highway miles per gallon , citydriving miles per gallon
each car's capacity of gallons
outputs-
minimum and maximum distance
average distance for both highway drving and city driving car
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.