Class Test
Name ______________________________

1. Write member functions a to j

class bank
{private final double INTRATE = 0.035;
private double balance;
private String name;
a. public bank(String na) // set balance to 0 {}
b. public bank(String na,double b){ }
c. public void printbalance(){}
d. public double getBalance() { }
e. public void deposit(double d) // adds d to balance {}
f. public void setBalance(double d){}
g. public void withdraw(double d) { }
h. public void addInterest(} // adds interest to account based on INTRATE
i. public int compareTo(bank ba) {} // compares this account to another
// based on balance
j. public String toString() {} // returns name
}

2. Given
bank b1 = new bank(100); // bank account 1
bank b2 = new bank(200); // bank account 2
Note : there is no longer \$100 in b1. Amounts have changed. This is just how it started
a. Write code that will print out the name of the person who has the most money. (Money may have changed from what it was initialized to above).
b. Make the first bank account increase by 10%.
c. Withdraw 50% from whatever is in the second bank account and put that into the first bank account.
d. Add interest onto the first bank account.

3. class fraction
{ private int num;
private int den;
}

a. public fraction() // default constructor - set num to 0, den to 1
{}

b. public fraction(int n,int d){}

c. public void printfraction(){}

d. public void reduce(){ }

e. public int getden(){}

f. public fraction divide(fraction f){ }

}

4. In the main function initialize any 2 fractions - pick your own variable names. Then divide them putting the result into a third. Then print out the result. (Even if you didn't get divide working above do this).