subject
Engineering, 30.11.2019 04:31 TierraNicole6865

Define a class named timespan. a timespan object stores a span of time in hours and minutes (for example, the time span between 8: 00am and 10: 30am is 2 hours, 30 minutes). each timespan object should have the following public methods: timespan(hours, minutes) constructs a timespan object storing the given time span of hours and minutes. gethours() returns the number of hours in this time span. getminutes() returns the number of minutes in this time span, between 0 and 59. add(hours, minutes) adds the given amount of time to the span. for example, (2 hours, 15 min) + (1 hour, 45 min) = (4 hours). assume that the parameters are valid: the hours are non-negative, and the minutes are between 0 and 59. add(timespan) adds the given amount of time (stored as a time span) to the current time span. gettotalhours() returns the total time in this time span as the real number of hours, such as 9.75 for (9 hours, 45 min). tostring() returns a string representation of the time span of hours and minutes, such as "28h46m". the minutes should always be reported as being in the range of 0 to 59. that means that you may have to "carry" 60 minutes into a full hour.

ansver
Answers: 1

Another question on Engineering

question
Engineering, 03.07.2019 15:10
If you were designing a bumper for a car, would you prefer it to exhibit elastic or plastic deformation? why? consider the functions of a bumper in both a minor "fender-bender" and a major collision.
Answers: 1
question
Engineering, 04.07.2019 08:10
Which of the following is an easy way to remember the modified “x” tire rotation? a. nondrive wheels straight, cross the drive wheels b. drive wheels straight, cross the nondrive wheels c. drive wheels crossed, nondrive wheels straight d. drive wheels crossed, nondrive wheels crossed
Answers: 1
question
Engineering, 04.07.2019 18:20
How much power could a wind turbine produce if it had the following specifications? cp = 0.45 -d=1.2kg/m3 d=50m v 5m/s
Answers: 2
question
Engineering, 04.07.2019 19:10
Acircular aluminum shaft mounted in a journal is shown. the symmetric clearance gap between the shaft and journal is filled with sae 10w-30 oil at t 30°c. the shaft is caused to turn by the attached mass and cord. develop and solve a differential equation for the angular speed of the shaft as a function of time.
Answers: 2
You know the right answer?
Define a class named timespan. a timespan object stores a span of time in hours and minutes (for exa...
Questions
question
Mathematics, 05.05.2020 03:51
question
Mathematics, 05.05.2020 03:51
question
Mathematics, 05.05.2020 03:51
question
Biology, 05.05.2020 03:51
question
History, 05.05.2020 03:51
question
Mathematics, 05.05.2020 03:51
Questions on the website: 13722363