Question: #include using namespace std; //constant for HOURS, MINUTES and SECONDS. const int HOURS = 24; const int MINUTES = 60; const int SECONDS = 60;

#include using namespace std; //constant for HOURS, MINUTES and SECONDS. const int HOURS = 24; const int MINUTES = 60; const int SECONDS = 60;

int main() { //Declare variables. long inSec, inMin, inHrs; int sec; int min; int hrs; int dayz; cin >> inSec; cout << "Total seconds: " << inSec << endl << endl; if (inSec < 0) cout << "Total seconds must be greater than zero" << endl; else sec = inSec % SECONDS; inMin = inSec / SECONDS; min = inMin % MINUTES; inHrs = inMin / MINUTES; hrs = inHrs % HOURS; dayz = inHrs / HOURS;

if (dayz > 0) cout << dayz << " day(s)" << endl; if (hrs > 0) cout << hrs << " hour(s)" << endl; if (min > 0) cout << min << " minute(s)" << endl; if (sec > 0) cout << sec << " second(s)" << endl; cin.get(); cin.get(); return 0; } //End function main

This is what I have so far. And here are the errors shown in lab.

Already solved. No need answer

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!