Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use C++ Please Using the Refined Algorithm in this lecture, write the code from this Refined Algorithm that will calculate and display in minutes and

Use C++ Please

Using the Refined Algorithm in this lecture, write the code from this Refined Algorithm that will calculate and display in minutes and hours how long a car has been parked. Include the parking fees where the charges are $1.00 per hour and $1.00 for a partial hour.

You must include the following:

1. IF the User enters 0 minutes, print a message letting them know they did not enter a valid parking time.

2. ELSE the User entered minutes greater than 0 then do the following:

a. Keep the hours and minutes as integers. Do not use floats for these values. b. Print out the hours and minutes as follows:

Your car has been parked for x hours and x minutes.

c. Calculate the parking fee as a float. d. Format the fee with set precision of 2 decimal places and print out the parking fee as follows:

You owe $xx.xx in parking fees.

3. Test your program thoroughly with the following data:

1. 59 minutes 2. 60 minutes 3. 61 minutes 4. 120 minutes 5. 121 minutes 6. 345 minutes 7. 0 minutes (only the error message should print)

4. Do not forget to use system("pause") to pause the output screen.

NOTE: 1. Declare all variables within the data declaration section. 2 Do not get input on the same line as a variable declaration. 3. Do not place an equation for computation on the same line as declaring a variable.

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

Step: 3

blur-text-image

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

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions

Question

Describe genes and the role they play in behavior.

Answered: 1 week ago

Question

4-6 Is there a digital divide? If so, why does it matter?

Answered: 1 week ago