NEWJAVA_Chapter_2_Programming_Assignments

NEWJAVA_Chapter_2_Programming_Assignments - JAVA Chapter 2...

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

View Full Document Right Arrow Icon
JAVA Chapter 2 Assignments Objects and Classes Review problems: 1. Explain the difference between and object and an object reference. 2. Explain the difference between and object and a class. 3. Explain the difference between a method and a constructor. 4. Explain the difference between an instance field and a local variable. 5. Explain the difference between a parameter variable and a local variable.
Background image of page 1

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

View Full DocumentRight Arrow Icon
PROGRAMMING ASSIGNMENTS NEED KEYBOARD CLASS FOR INPUT!!!!! As a class – Everyone at computers A1: Design a Circle class and a CircleTest class (this will be main). Instance fields and methods (2 constructors–default is one, getArea, and getCircumference). Start with supplying the parameter constructor with 10, then we will move to a user supplied input using the Keyboard class. A2: Design a SavingsAcct class and a SavingsTest class (this will be main). Instance variables are account number, balance and interest. Methods will be (2 constructors-default is one, deposit, withdraw, getBalance, addInterest. Set the interest to 6%. Create an object in main with a balance of $1000 and a second object with a balance of $100. For both objects, call AddInterest, call getBalance, repeat 3 times. A3: Car class attributes: Vin #, fuel efficiency, fuel in tank, and miles driven. methods:
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/28/2010 for the course COMP COMP taught by Professor Huye during the Spring '10 term at Eastern Oregon.

Page1 / 3

NEWJAVA_Chapter_2_Programming_Assignments - JAVA Chapter 2...

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

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