Question: JAVA PROGRAM Write the definition for a class called TimeLeft that accepts the current time and the time of fight departure and calculate the time
JAVA PROGRAM
Write the definition for a class called TimeLeft that accepts the current time and the time of fight departure and calculate the time left for the flight to depart. The data members are hours, minutes, and seconds.
The class has the following member functions:
void set(int, int, int) - to assign both the time void disp()- to display the left out time
TimeLeft calculate (TimeLeft) - to find the difference between both the given time.
1. Write the definitions for each of the above member functions.
2. Write the main function to create three objects. Set the value in two objects and call calculate() to calculate the difference and assign it to the third object.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
