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 Objects of SubclassesThis self-exercise is to draw objects of subclasses. It is important that you know how to draw an instance of a class yourself, following our conventions. Only then can you fully understand how classes and instances of classes work in Java. The three steps of this exercise are given below. After the two steps, we give some notes on mistakes that students often make when doing this exercise. Please read them carefully to make sure that you did not make these mistakes. Here are the answers, in a pdf file. ExerciseStep 1. Draw an object.Consider the following classes:
To the right is an instance of class On your paper, draw an instance of class Ex and another instance of class Sub.
Step 2. More subclassesConsider also these two subclasses of class
Draw an intance of class Notes on this exerciseOne semester, when we gave a similar homework, some students did miserably. We explained what they did wrong and gave them another chance to learn. So that you don't have this problem, here are notes that we gave to the students who did things wrong. After completing this assignment, read through these notes and see whether you made the same mistakes. If so, correct them. Note 1You did not follow directions at all. We do not see, separately, an instance of Note 2In a folder like one for Note 3You did not draw field Note 4You left off the part for superclass Note 5You did not draw variables correctly. They should be drawn with the name of the variable followed either by an underline with the value on it or by a box with the value in it. Note 6Method Note 7 In drawing a folder for |