Question
Problem 1 Write a program that does the following: (a) It asks for the number of miles the person traveled on a recent trip and
Problem 1
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 John Doe traveled 800 miles, got 31.3 miles per gallon on average, paid $2.49 per gallon on average, and paid a total of $63.64 for gas.. (f) it checks whether tripCost is less than $100. If it is less than $100, 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 $100, 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started