63 043
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #14119 in C++ for shalenee

Question #14119
(simulation clock countdown ). Write a program that prompts the user to enter the number of seconds to be counted down. Display a message each second of the countdown and include an additional warning every five seconds. Terminate when the time expires.
Expert's answer
#include <conio.h>
#include <iostream>
using namespace std;
int numberofseconds=0;
int main(){
int countforwarning=0;
cout<<"Enter the number of seconds to be counted down: ";
cin>>numberofseconds;
for(int i=0;i<5000000000;i++){
if(i0000000==1){
cout<<numberofseconds<<"
";
numberofseconds--;
countforwarning++;
if(countforwarning>0 && countforwarning%5==0){
cout<<"
An additional warning
";
}
if(numberofseconds<0){
break;
}

}
}
getch();
return(0);
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions