Self help exercise- drawing objects

Self help exercise- drawing objects - Self-help exercise:...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Self-help exercise: Drawing objects It 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 Animal that has three fields: (1) the kind of Animal (a String). (2) its sex (a boolean, true for female and false for male). (3) its age, in years (an int). and four methods: (1) A function that yields the kind of the animal. (2) A function that yields the sex of theanimal.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Self help exercise- drawing objects - Self-help exercise:...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online