CSC148H1 Lecture Notes - Lecture 3: Abstract Data Type, Rational Number, Init

107 views3 pages
28 Jan 2016
School
Course
Professor
katrinasavvy and 38715 others unlocked
CSC148H1 Full Course Notes
1
CSC148H1 Full Course Notes
Verified Note
1 document

Document Summary

In python - develop classes(advanced data types, primitive data types) for the client code(other programmers) __str__ to print an instance of the class (a string way of showing the object), uses format. Manage attributes - ex, in a rational number, the denominator does not get the value 0. Python gives you more opportunity to design what you actually want. Class: (abstract/advanced/compound) data type (adt = abstract data type) It models a thing or concept (we call this an object) based on its common or important attributes (parameters) and actions(methods) in a specific project. In other words, it bundles together attributes and methods that are relevant to each instance of those objects. We are asking the object to tell us information. A rectangle is a shape has_a vs is_a relationship: A chair has an armrest, has a backrest, has a seat (composed of several objects). Vehicles are objects, composed of several other objects(wheels, seats, windows, etc, etc)-

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents