Comp 151 Project 6

Makeing your objects more usable.

Summary:

In this lab you will write a program with three classes. You will write two of them and I will write the third.

Due: Monday Nov 22nd at 11:59pm


Details:

You will implement the following UML
lab6 UML diagram

You have two classes (two different files/tabs in eclipse) to write in this lab. Both are fairly straightforward, they represent a very much simplified bank application.

Each of the methods you need to write are outlined below


Here is the File I'll use to test your code:

=====================begin java file===============================
public class Lab6{

public static void main(String[] args){
Lab6 myLab = new Lab6();
myLab.testAll();
}

public void testAll(){
//create some variables to work with;
BankAccount Savings1 = new BankAccount (3453.67);
BankAccount Savings2 = new BankAccount (3453.67);
BankAccount Savings3 = new BankAccount (345.67);
BankAccount Savings4 = Savings2;

String Name = "Ted";
Customer cust1 = new Customer(Savings1, 1231, Name);
Customer cust2 = new Customer(Savings2, 1231, "Ted");
Customer cust3 = new Customer(Savings3, 1231, "Sara");
Customer cust4 = new Customer(Savings4, 1231, Name);

//now lets test your methods
System.out.println("testing toString methods");
//this might print out something like: Customer with TaxID 1231, Name: Ted and Savings1: BankAccount with Balance: 3452.67 and isTaxable of true (I orignanally said false but its been pointed out that I did ask you to initialize isTaxable)
System.out.print("cust1:");
System.out.println(cust1);
//this next one will print out the same as above
System.out.print("cust2:");
System.out.println(cust2);
System.out.print("cust3:");
//this might print out something like: Customer with TaxID 1231, Name: Sara and Savings1: BankAccount with Balance: 345.67 and isTaxable of true (I orignanally said false but its been pointed out that I did ask you to initialize isTaxable)
System.out.println(cust3);
System.out.print("cust4:");
System.out.println(cust4);

System.out.println("testing equals methods:");
System.out.print("Savings1.equals(Savings2):");
System.out.println(Savings1.equals(Savings2));//should be true
System.out.print("Savings2.equals(Savings4):");
System.out.println(Savings2.equals(Savings4));//should be true

System.out.print("custs2.equals(cust4):");
System.out.println(cust2.equals(cust4)); //should be true
System.out.print("custs1.equals(cust4):");
System.out.println(cust1.equals(cust4)); //should be true
System.out.print("custs1.equals(cust3):");
System.out.println(cust1.equals(cust3)); //should be false


}

}
========================end java file======================


Additinal restrictions:
To help you get in the habit of good program writing, I am imposing the following additional restrictions on your program.



Submitting:

again zip up your project folder and submit it to me by email. Make sure that your submitted zip file contains your first initial and last name as part of the zip file name.