Question: Create a C++ console application that defines a class named Stopwatch. The class should contain 2 private data members for the start time and end
Create a C++ console application that defines a class named Stopwatch. The class should contain 2 private data members for the start time and end time. Include a getter (accessor) function for both data members. Define a no-arg constructor that initializes the start time with the current time. The current time can be acquired in C++ by creating a time point object. See the following for more details: http://www.cplusplus.com/reference/chrono/stead Define a method named start() that resets the start time to the current time. Another method named stop() should set the end y_clockl c time to the current time. A method named getElapsedTimel) should return the difference between the start time and end time. To test the class from main, prompt the user for input and then start the stopwatch. Next, prompt the user for input to stop the stopwatch. Display the elapsed time in a pleasing format
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
