Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Write a program that asks the user to enter the number of seconds as an integer value and then displays the equivalent time in

image text in transcribed
4. Write a program that asks the user to enter the number of seconds as an integer value and then displays the equivalent time in days, hours, minutes, and seconds. If the user does not enter an integer value, it asks the user to enter the input again. A way to check to see if a number is an integer is to look to see if x=round(x) where x is your input value. Two other useful function are the rem(x,y) function which gives the remainder when x is divided by y and the floor function which gives the floor of a number (number rounded towards ). The output for part (a) should look like: days = 365 hours = 17 minutes = 46 seconds = 40 Run the program for the following inputs. (a) 31600000 seconds (b) 90061 seconds (c) 36000000 seconds (they say it requires 10,000 hours to become an expert in something) (d) 3610 seconds

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

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions

Question

How many different guests have made bookings for August?

Answered: 1 week ago

Question

Discuss the clinical features of social anxiety.

Answered: 1 week ago