CSE 283 Introduction to Object Oriented Design

Barbara Nostrand, Ph.D.


CSE 283 Labs
Welcome to the site for CSE 283 Labs!

 

Lab 11: Projects

Prev | Next | Lab 11

 

Objectives

1. Practice designing and creating class hierarchies.
2. Familiarity with creating packages.

Introduction

Each of the following projects involves creating a class hierarchy. Your instructor will tell you which of them you are to do, and will provide any input files to be used to test your program.

Projects

11.1. Complete the subclasses InterestAccount and CDAccount.

Write a program that demonstrates the correctness of your implementation.

11.2. Design and build two new classes for the bank accounts hierarchy.

AutoPayAccount - Just like a checking account except it has a method which allows a user schedule bills to be paid automatically. This method should take three arguments: the name of the payee, the amount to pay, and the number of months between payments. For example, if the number of months between payments is 3, then the bill should be paid every three months.

ChristmasAccount - This account has no fees associated with it. It pays 20% interest. The user can make any number of deposits that they wish for up to eleven months. No withdrawals can be made until the twelfth month. After the twelfth month money can only be withdrawn and no interest will be paid.

Write a program that demonstrates the correctness of your implementation.

11.3. Design and build a class hierarchy for media types stored in a package. Your hierarchy should support Books, Periodicals, VideoTapes and CDs. Some attributes for these kinds of objects include: title, author, ISBN number, subject, running time, volume number, rating, and lending length.

Store the hierarchy in a package and then write a program that creates an array of media types and uses that to demonstrate the correctness of your design and implementation.

11.4. Design and build a class hierarchy for shapes. Your hierarchy should support circles, ovals, triangles, right triangles, squares, rectangles, quadrilaterals. Each class should have appropriate attributes in order to be able to determine: the smallest rectangle that bounds the shape, the area of the shape, the circumference of the shape, whether a point is inside the shape, and whether two shapes bounding rectangles intersect.

Store the hierarchy in a package and then write a program that creates an array of shape types and uses that to demonstrate the correctness of your design and implementation.

11.5. Add Secretary class and the Consultant class to the employee hierachy described in section 11.4 of Java: An Introduction to Computing. Extend the PayrollGenerator.java program to test your class. Be sure to modify the Paycheck.java class definition found in the textbook to specify locale. Modified versions of all the files in the text for this project can be found here.

Don't forget to clean up your directory when you are all finished...

Prev | Next | Lab 11

 
  Home

Schedule

Help

Lab 0

Lab 1

Lab 2

Lab 3

Lab 4

Lab 5

Lab 6

Lab 7-8

Lab 9

Lab 10

Lab 11

Lab 12

Lab 13






Last modified: 2007 OCT 30
bnostran@syr.edu