Answer to Question #316124 in UNIX/Linux Programming for rocky

Question #316124

Develop a stopwatch with lap counter and total time calculator. The

program will create two processes and they will start calculating time.

One process will be used to calculate total time and the other will calculate

lap time. The total time calculator process will keep on calculating time.

In the lap time, calculator process when it reaches lap time limit, the

process will display lap number and set its counter to zero and start

calculating again. Take input of lap time and number of laps from the user

and start the program. At the end, display total time from total time

calculator process.


1
Expert's answer
2022-03-22T19:07:58-0400
int main()
{


	int circle = 0;
	int sec = 0;
	int min = 0;
	int hour = 0;
	for (int i = 0; i < 99999999999; i++)
	{
		sec++;
		if (sec == 60)
		{
			min++;
			sec = 0;
		}
		else if (min == 60)
		{
			hour++;
			min = 0;
		}
		else if (hour == 24)
		{
			circle++;
			hour = 0;
		}
		cout << "Circle: " << circle << endl;
		cout << hour << ":" << min << ":" << sec << endl;
		Sleep(1000);
		system("cls");
		
	}
   


}

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 the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS