M/F 2:30-3:20 |
CS 1130: Transition to OO Programming Spring 2016 |
Main
About: Overview Announcements Staff Consultants Calendar Materials: Texts DrJava Terminology Lectures: In-Class Web-Based VideoNote Assessment: Grading Assignments Labs Resources: CMS Piazza (link) Piazza (about) Java API Style Guide Academic Integrity |
Self-Help ExerciseDrawing ObjectsIt is important that you be able to draw manila folders (objects) of a class when you have to. The need will arise when executing some part of a program by hand in order to find an error. Further, the ability to draw objects will promote understanding of various concepts. It is also important that we all draw objects the same way, so that we can communicate better. Please do not skip the following simple exercises. Doing them will not only implant in your mind how we draw objects but will also help you become familiar with our terminology —class manila folder or object, name of an object, component, field, method, function, and procedure. 1. Draw an object for a class
and four methods:
Put some reasonable values in the fields. Note that we are not asking you to define functions and procedures in Java code —we haven't seen how to do that yet. We are just asking you to indicate in the object what methods there are, as done in the lecture. Here is our sample answer. 2. Draw an object for a class
and the four methods:
Put some reasonable values in the fields. Note that we are not asking you to define functions and procedures in Java code —we haven't seen how to do that yet. We are just asking you to indicate in the object what methods there are, as done in the lecture. Here is our sample answer. |