Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems Xxviii Special Issue On Database And Expert Systems Applications Lncs 9940

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Qimin Chen

1st Edition

3662534541, 978-3662534540

More Books

Students also viewed these Databases questions

Question

Which team solution is more likely to be pursued and why?

Answered: 1 week ago