//Charlotte Davies-Kiernan CS1A Chapter 4 P.221 #7
//
/******************************************************************************
*
* Comput Diversion of Seconds
* ____________________________________________________________________________
* This program will display an amount of time corresponding with the amount
* of seconds the user has decided to enter. If large enough it will compute
* minutes, even larger then it will compute hours, and then even larger it
* will convert to days.
*
* formula's used are:
* minutes = seconds / 60.0
* hours = seconds / 3600.0
* days = seconds / 86400.0
* ____________________________________________________________________________
* INPUT
* seconds //the amount of seconds the user has decided to enter
*
* OUTPUT
* minutes //the amount of minutes the seconds the user has entered converts to
* hours //the amount of hours the seconds that are entered converts to if large enough.
* days //the amount of days the seconds that are entered converts to if large enough.
*****************************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
float days; //OUTPUT - seconds entered converted to hours if large enough
float hours; //OUTPUT - seconds entered converted to hours if large enough
float minutes; //OUTPUT - seconds entered convereted to minutes
long long seconds; //INPUT - seconds that are entered by the user
//
//Get user's amount of seconds
cout << "Enter an amount of seconds larger than 60, with no comma!" << endl;
cout << "For example, 6000." << endl;
cin >> seconds;
cout << "You've entered " << seconds << "!" << endl << endl;
//
//Calculate
if (seconds >= 60){
minutes = seconds / 60.0;
cout << "That's approximatley " << minutes << " minutes!" << endl;}
if (seconds >= 3600){
hours = seconds / 3600.0;
cout << "That's approximatley " << hours << " hours!" << endl;}
if (seconds >= 86400){
days = seconds / 86400.0;
cout << "That's approixamtely " << days << " days!" << endl;
}
return 0;
}