Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Question: Need help with code. Need to write program with these specifications: Write a program that asks the user to enter a time duration

C++ Question: Need help with code.

Need to write program with these specifications:

Write a program that asks the user to enter a time duration in hours, minutes, and seconds and then displays the time in terms of hours in decimal format.There are 60 minutes in an hour, and there are 60 seconds in a minute. Represent these number of minutes in an hours and number of seconds in a minute as constant in your program.You should use a separate variable for each input value.Please make sure that minutes and seconds are less than and equal to 59. If the users enter this more than 59 or negative it should be asking him to reenter the information.

A sample run should look like this (user input is in bold):

Enter a hours, minutes, and seconds:

First, enter the hours: 10

Next, enter the minutes: 30

Finally, enter the seconds:30

10 hours, 30 minutes, 30 seconds = 10.50833 hours

At the end of the inputs and after display of the results, you should ask the user if he wants to continue, and if the input is 'Y' you should repeat the process.

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

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

Students also viewed these Databases questions

Question

DESCRIBE the three types of e-learnin g.

Answered: 1 week ago

Question

1. Explain why evaluation is important.

Answered: 1 week ago