Answer to Question #314544 in C++ for zxc

Question #314544

Develop a stopwatch with a lap counter and a 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, the 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 the number of laps from the user



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



calculator process.

1
Expert's answer
2022-03-19T13:57:18-0400
int main()
{
	int sec=0;
	int min=0;
	int hour=0;
	for (int i = 0; i < 99999999; i++)
	{
		sec++;
		cout << hour << ":" << min << ":" << sec << endl;
		if(sec == 60)
		{
			min++;
			sec = 0;
		}
		else if(min == 60)
		{
			hour++;
			min = 0;
		}
		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
New on Blog