I'm not sure how to make the clock show just seconds of the day and the remaining time with this problem. Enhance Programming Exercise 9 by adding functions to the class clockType so that a program that uses this class can perform the following operations: Returns the elapsed time of the day of a clock in seconds. Returns the remaining time of the day of a clock in seconds. Determines and outputs how far apart in time two clocks are. Outputs the time in the form hr:min:sec. Also, write a program to test yourclass.       clockType.h clockTypeImp.cpp main.cpp           class clockType   {   public:      void setTime(int hours, int minutes, int seconds);      void setHours(int hours);      void setMinutes(int minutes);      void setSeconds(int seconds);        void getTime(int& hours, int& minutes, int& seconds) const;        int getElapsedTimeOfDay();      int getRemainingTimeOfDay();   ​      int getHours() const     {          return hr;     }        int getMinutes() const     {          return min;     }      int getSeconds() const     {          return sec;     }        void printTime() const;        void incrementSeconds();        void incrementMinutes();        void incrementHours();        bool equalTime(const clockType& otherClock) const;        clockType(int hours, int minutes, int seconds);        clockType();     private:      int hr;  //variable to store the hours      int min; //variable to store the minutes      int sec; //variable to store the seconds     };

Question

I'm not sure how to make the clock show just seconds of the day and the remaining time with this problem.

Enhance Programming Exercise 9 by adding functions to the class clockType so that a program that uses this class can perform the following operations:

  • Returns the elapsed time of the day of a clock in seconds.
  • Returns the remaining time of the day
    • of a clock in seconds.
    • Determines and outputs how far apart in time two clocks are. Outputs the time in the form hr:min:sec. Also, write a program to test yourclass.
     
     
     
    • clockType.h
    • clockTypeImp.cpp
    • main.cpp
    •  
     
     
     
     
    class clockType
     
    {
     
    public:
     
       void setTime(int hours, int minutes, int seconds);
     
       void setHours(int hours);
     
       void setMinutes(int minutes);
     
       void setSeconds(int seconds);
     
     
       void getTime(int& hours, int& minutes, int& seconds) const;
     
     
       int getElapsedTimeOfDay();
     
       int getRemainingTimeOfDay();
     
     
       int getHours() const
     
      {
     
           return hr;
     
      }
     
     
       int getMinutes() const
     
      {
     
           return min;
     
      }
     
       int getSeconds() const
     
      {
     
           return sec;
     
      }
     
     
       void printTime() const;
     
     
       void incrementSeconds();
     
     
       void incrementMinutes();
     
     
       void incrementHours();
     
     
       bool equalTime(const clockType& otherClock) const;
     
     
       clockType(int hours, int minutes, int seconds);
     
     
       clockType();
     
     
    private:
     
       int hr;  //variable to store the hours
     
       int min; //variable to store the minutes
     
       int sec; //variable to store the seconds
     
     
    };
     
     
     

Expert Answer

Want to see the step-by-step answer?

See Answer

Check out a sample Q&A here.

Want to see this answer and more?

Step-by-step answers are written by subject experts who are available 24/7. Questions are typically answered in as fast as 30 minutes.*

See Answer
*Response times vary by subject and question complexity. Median response time is 34 minutes and may be longer for new subjects.

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A

Q: what are the popular cost estimation techniques used for software cost estimation

A: Software cost estimation: Software cost estimation is a method or process that can help IT professio...

Q: 3. Which command can you use to look for the file names status.report? Which command can you use to ...

A: The command used to look for files is ‘find’ command. Find command can be used with many criteria to...

Q: This is for pygame Text Class The Text class inherits from Drawable and it will be used to display t...

A: Instructions for the Text class:Import the Drawable class and pygame module.Create a class Text and ...

Q: 5-9) (Find the two highest scores) Write a program that prompts the user to enter the number of stud...

A: Program that prompts the user to enter the number of students and each student’s name and score, and...

Q: Implement a recursive function called evens that returns an integer with only theeven numbers. Note ...

A: The evens function checks for the modulo 2 div value at each position of the input array and display...

Q: As an IT manager, what strategy would you have followed to avoid the failed implementation of ERP sy...

A: ERP system:It denotes software for business process management that permits an organization in using...

Q: Please write Lisp code for the following problem. Write a function that computes the surface area of...

A: Instructions to create a function that computes the surface area of a cylinder:Define a function nam...

Q: Write a class, NumberToMonth, which does the following:a. Ask the user to enter the month of the yea...

A: The algorithm for the program would be as below:Declare one int variable for accepting user inputPro...

Q: Develop the ‘Shape’ application such that: Implement an array of objects of various types (all SIX ...

A: Program plan:Define a class called “ShapeTest”.Define a “main()” method.Create an array of six shape...