(Solved):Design a Python class named Stopwatch. The class contains: The private data fields startTime and endTime with get methods A constructor that initializes startTime with the current time A method nam… View Answer…

 

Question

Design a Python class named Stopwatch. The class contains:

The private data fields startTime and endTime with get methods

A constructor that initializes startTime with the current time

A method named start() that resets startTime to the current time

A method named stop() that sets endTime to the current time

A method named getElaspedTime() that returns the elasped time, in milliseconds, for the stopwatch

Draw the UML diagram for the class, and then implement the class.

Scroll to top