Write an algorithm (without modules) that asks the user to input the elapsed time for an event in seconds. The algorithm then outputs the elapsed time in hours, minutes and seconds.
(For example, if the elapsed time is 9630, then the output is 2:40:30)
2. Rewrite the previous algorithm with three modules in addition to the Control module.
3. Translate the algorithm created in part 1 into a C++ program without functions.
4. Translate the algorithm created in part 2 into a C++ program with functions.
We can't help you until you make an attempt at it. Posting "Here is my homework" will not get you answers, but if you encounter a problem along the way, and you post it with code, we can help. Like this:
1)Try homework.
2)Encounter problem
3)Try to solve problem
4)Look around forums
5)Post code in forums and say "I seem to have a problem with the for loop on line 18"
6)receive aid concerning the for loop on line 18
7)have a nice day
#include <iostream>
usingnamespace std;
int main()
{
cout << "Enter the cubic feet of water that have been used:\n " ;
double w_usage, bill;
cin>>w_usage;
if (w_usage<=1000)
{
cout<<"Your Bill is 15 dhs" ;
}
else
{
if ( w_usage<=2000)
{
bill= w_usage*0.0175;
cout<<"Your Bill is:\n"<<bill<<endl;
}
elseif ( w_usage<=3000)
{
bill= w_usage*0.02;
cout<<"Your Bill is:\n"<<bill<<endl;
}
else
{
if (w_usage>3000)
cout<<"Your Bill is 70 dhs" ;
}
}
return 0;
}