Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your program should prompt the user for some number of seconds. It will then determine if the number of seconds entered is (a) less than

Your program should prompt the user for some number of seconds. It will then determine if the number of seconds entered is (a) less than 60 seconds, in which case it will report in seconds, (b) between 60 seconds but less than 3,600 seconds, in which case it will print a report in minutes, (c) between 3,600 seconds but less than 86,400 seconds, in which case it will print a report in hours, or (d) greater than 86,400 seconds, in which case it will print a report in days.

An if-else-if sequence (Gaddis, p. 178) would be a natural solution to this problem. Also, for the moment, you do not have to worry about input validation (e.g., checking to make sure the number is positive).

Some example runs might look like:

Please enter the number of seconds: 45

45 seconds is 45.00 seconds.

Please enter the number of seconds: 1234 1

234 seconds is 20.57 minutes.

Please enter the number of seconds: 52134

52134 seconds is 14.48 hours.

Please enter the number of seconds: 100000

100000 seconds is 1.16 days.

How would i write this in C++?

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

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions

Question

In Exercise 40 what is the

Answered: 1 week ago