[CSC148H5] - Final Exam Guide - Everything you need to know! (104 pages long)
Document Summary
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. Calculate distance to origin, calculate distance between points, calculate midpoint, check if inside given rectangle, check if inside given circle, print points.