Project 04

 

Overview

In this project, you are to define a class hierarchy consisting of Person, Employee, and Customer classes and an application that allows the user to load and process a Vector with a mix of Employee and Customer objects. Along the way you must use an abstract class, polymorphism, an abstract method, an overriding version of an inherited method, object conversion and casting, and an interface.

 

Requirements

In a single source file named App.java

  1. Declare a Vector of Person object references. To support this, be sure to code an import statement for the java.util package at the beginning of your source file.

  1. Provide a menu-driven main processing loop with a menu similar to the following (the exact layout is up to you):

   
     PERSON PROCESSING MENU
   
  1  Add a customer
  2  Add an employee
  3  Show all billable persons
  4  Show all customers
  5  Show all employees
  6  Show all persons
  7  Exit
   

The processing of menu choices 1 and 2 should simply prompt the user for all customer or employee data, construct the object, and add it to the Vector.

The processing of menu choice 3 should display one line of information about each billable person that owes money. Other persons are to be ignored. The output format is up to you, but use my Utility.moneyFormat() method to display the amount owed in proper currency notation.

The processing of menu choice 4 should display one line of information about each customer using its toString() method.

The processing of menu choice 5 should display one line of information about each employee using its toString() method.

The processing of menu choice 6 should display one line of information about each person using its toString() method.

Nothing needs to be done for menu choice 7.

If the user makes an invalid menu choice, display an appropriate error message and re-display the menu.

 

Miscellaneous 

 

Grading criteria

Your program will be worth 30 points to be awarded as follows:

 

Submission

E-mail me the contents of your App.java source file no later than midnight on the program due date. If you are using JBuilder 4 and the Test project previously copied from the College of Business network, this file will be in the src folder of the project. In the College of Business labs, the complete path of your source file is:

D:\Test\src\App.java

To verify that you are doing this properly, e-mail to yourself, copy the source code to your test project, and re-test the program. If it works for you, it will probably work for me.

Upon receipt of your project, I will send you a verification message. When your project has been graded, you will receive an e-mail with your project score and comments (based on the above criteria). All project scores will be posted on the Internet within a few days after the due date.