class Duration: def init (self, hours, minutes): self.hours hours self.minutes w minutes def add (self, other): Type the program's output if not isinstance (other, Duration): return 'oops! total hours total minutes self.hours + other.hours self.minutes. other.minutes if total minutes > 60: total hours + 1 total minutes 60 return Duration (total_ hours, total_minutes) one way_time - Duration (1, 33) round trip_time- one way time one way time print (round trip_time.hours, round trip_time.minutes) print (one way_time 51)
class Duration: def init (self, hours, minutes): self.hours hours self.minutes w minutes def add (self, other): Type the program's output if not isinstance (other, Duration): return 'oops! total hours total minutes self.hours + other.hours self.minutes. other.minutes if total minutes > 60: total hours + 1 total minutes 60 return Duration (total_ hours, total_minutes) one way_time - Duration (1, 33) round trip_time- one way time one way time print (round trip_time.hours, round trip_time.minutes) print (one way_time 51)
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 6PE
Related questions
Question
class Duration: def init (self, hours, minutes) : def Type the program's output Ta self hours hours self.minutes - minutes add (self, other): if not isinstance (other, Duration): return oops" total hours total minutes = self.minutes + other.minutes if total minutes >- 60: total hours += 1 total minutes F self.hours + other.hours Garde 60 return Duration (total hours, total minutes) one way time Duration (1, 331 round trip time = one way time t one way time print (round trip time.hours, round trip_time.minutes) print (one way time + 52) 0

Transcribed Image Text:class Duration:
def init (self, hours, minutes):
self.hours = hours
self.minutes minutes
def add (self, other) :
Type the program's output
if not isinstance (other, Duration):
return oops
total hours
self.hours + other hours
total minutes self.minutes + other.minutes
if total minutes > 60:
total hours +- 1
total minutes MES 60
return Duration (total hours, total minutes)
one way time Duration (1, 33)
round trip_time -one way time + one way time
print (round trip_time.hours, round trip_time.minutes)
print (one way time + 51)
0
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning

EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning

EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage

Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning

EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT

Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,