Question: Write a program that does the following: ( a ) It asks for the number of miles the person traveled on a recent trip and
Write a program that does the following: a It asks for the number of miles the person
traveled on a recent trip and stores it in nMiles; b it asks for the average miles per gallon
the person got on the trip and stores it in milesPerGallon; c it asks for the average price
per gallon, paid for gas on the trip and stores it in avgPrice; d it calculates the cost of
the trip and stores it in tripCost; e it displays a message such as You traveled
miles, got miles per gallon on average, paid $ per gallon on average, and paid a
total of $ for gas.f it checks whether tripCost is less than $ If it is less than
$ the program should display a second message such as You will be reimbursed for
your trip cost in your next paycheck. If the tripCost exceeds $ the program should
display a message such as You need to fill out the expense report to be reimbursed.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
