Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

im not sure what im doing wrong but my output doesnt match the example given please help. Write a C++ program, which prompts the user

im not sure what im doing wrong but my output doesnt match the example given please help. image text in transcribed
image text in transcribed
Write a C++ program, which prompts the user to enter a time in seconds and converts that value to days, hours minutes and seconds. It should then print an appropriate message to the user. Here is a sample run: Enter your time in seconds: 3691 3691 seconds is o day(s) 1 hour(s) 1 minute(s) 31 seconds) Enter your time in seconds: 720000 720000 Seconds is 8days 8 hours 0 minute(s) 0 second(s) 8 #include 9 using namespace std; 10 11 int main() { 12 const int min = 60; 13 const int hour = 3600; 14 const int day = 86400; 15 int seconds = 0; 16 int time = @; 17 18 time = time % day; 19 time = time % hour; 20 time = time % min; 21 22 cout > time; 24 cout

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

Databases In Networked Information Systems 6th International Workshop Dnis 2010 Aizu Wakamatsu Japan March 2010 Proceedings Lncs 5999

Authors: Shinji Kikuchi ,Shelly Sachdeva ,Subhash Bhalla

2010th Edition

3642120377, 978-3642120374

More Books

Students also viewed these Databases questions

Question

Distinguish between a subset and a proper subset?

Answered: 1 week ago