Question: Course : Object oriented programing using C++ Q1. Topic: Operator Overloading CL0-2 15 Marks Create a class called Time that represents a time in 24

Course : Object oriented programing using C++

Course : Object oriented programing using C++ Q1. Topic: Operator Overloading CL0-2

Q1. Topic: Operator Overloading CL0-2 15 Marks Create a class called Time that represents a time in 24 hours format. It has three attribute sec, min and hrs as integer data type. Make void set(int hint mint s) function to set hrs, min, sec. Make void show() function to display time in 23:59:59 format. Make Time Operator ++() member operator that increments the time in a Time object by one second. Make Time Operator --(int) member operator that decrements the time stored in a Time object by one second. o While incrementing or decrementing time make sure to implement the following cases: Incrementing into the next minute. Incrementing into the next hour. Incrementing into the next day (i.e., 23:59:59 to 00:00:00). Make two time objects in a main function. Call these operators to check their working

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!