CSC148H5 Lecture Notes - Lecture 2: Init, Duplicate Code, Ship Class

81 views4 pages

Document Summary

Csc148h5s - introduction to computer science (winter 2017) Function make less sense when you have actors in your domain. We model actors, not functions class eat_junk (): dan = person() dan. eat_junk() Sometimes we want to model stuff that isn"t built-in already. Often someone gives you a spec for what your software should do. It"s up to you to do an oo analysis of that spec. Once you do the analysis (above), then you think about writing code. Find classes by finding nouns in the specification. Find attributes by searching for minor nouns. In two dimensions, a point is two numbers (coordinates) that are treated collectively as a single object. Points are often written in parentheses with a comma separating the coordinates. For example, (0, 0) represents the origin, and (x, y) represents the point x units to the right and y units up from the origin.

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