(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.
1
Expert's answer
2012-09-06T10:04:40-0400
#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; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment