ICA 8 - CSC 120

.docx

School

University Of Arizona *

*We aren’t endorsed by this school

Course

120

Subject

Industrial Engineering

Date

Apr 3, 2024

Type

docx

Pages

2

Uploaded by ChefPheasantMaster959

Report
ICA 8 1. def as_tuple(self): return self._x, self._y 2. def __str__ (self): return 'Point (' + str(x) + ',' + str(y) + ')' 3. class BookData: def __init__(self, title, author, rating): self._title = title self._author = author self._rating = int(rating) def get_title(self): return self._title def get_author(self): return self._author def get_rating(self): return self._rating def __str__(self): return 'BookData -- ' + self._title + ': ' + self._author + ' : ' + self._rating def main(): list = [] i = input() while i != 'no': list.append(i) e = BookData(i) e.__str__() main() 4. class ClockTime: def __init__(self, hours, minutes, isAM): self._hours = hours self._minutes = minutes Word of the day: Cats
self._isAM = isAM def __str__(self): return self._hours + ' : ' + self._minutes + ' ' + self._isAM def total_minutes(self): return int(self._hours) * 60 + int(self._minutes) def tick(self): self._minutes += 1
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help