Question
Points 10 Purpose: Write a Java class Perform mathematical computations ---- Description: Create a class MyTime to represent a time-of-day as 3 integer values representing
Points 10 Purpose: Write a Java class Perform mathematical computations ---- Description: Create a class MyTime to represent a time-of-day as 3 integer values representing hour of the day, minutes past the hour & seconds past the minute. Provide the following methods: default constructor initializing constructor - an add: - seconds minutes - hours Write a test program to read in a time-of-day as 3 integers representing hours, minutes, and seconds. Create a MyTime object with the given initial values. Also read in: - a 4th input of additional seconds - a 5th input of additional minutes - a 6th input of additional hours Recompute the time by adding the: additional seconds - additional minutes additional hours Output: display the original time given - compute and display the new time by adding each of the: - additional seconds - additional minutes - additional hours Example: Inputs: 5 59 32 30 12 5 52
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started