Question
CHALLENGE 10.14.2: Operator overloading. ACTIVITY 5380543686090 ' 2times 3z9y7 Jump to level 1 Four doubles are read from input, where the first two doubles
CHALLENGE\ 10.14.2: Operator overloading.\ ACTIVITY\ 5380543686090 '
2\\\\times 3z9y7
\ Jump to level 1\ Four doubles are read from input, where the first two doubles are the hours and seconds of timeHrSec1 and the second two doubles are the hours and seconds of timeHrSec2. Define two functions to overload the + operator. The first function overloads the + operator to add two time values. The second function overloads the + operator to add a time and a double representing the number of hours.\ Ex: If the input is 7.021 .86 .06 .7 , then the output is:\ 7 hours, 21.8 seconds\ 6 hours, 6.7 seconds\ Sum: 13 hours, 28.5 seconds\ 7 hours, 21.8 seconds\ 6 hours\ Sum: 13 hours, 21.8 seconds\ Note: The sum of two time values is:\ the sum of the number of hours\ the sum of the number of seconds\ Note: The sum of a time and a double representing the number of hours is:\ the sum of the number of hours and the double\ the number of seconds is unchanged
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