WADT ASSIGNMENT 2

WADT ASSIGNMENT 2 - Assigned Date: 14/3/05 Due Date:...

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

View Full Document Right Arrow Icon
Assigned Date: 14/3/05 Due Date: 16/3/05 1. Ask the user for 5 integers and prints them in reversed order 2. Create a class with two static methods to compute the average and standard deviation of an array of numbers 3. Write a program that constructs a BankAccount, deposits Rs.1000, withdraws Rs.500, withdraws another Rs.400, and then prints the remaining balance. Add a method void addInterest (double rate) to the BankAccount class that adds interest at the given rate. For example, after the statements BankAccount momsSavings = new BankAccount(1000); momsSavings.addInterest(10); //10% interest the balance in momsSavings is Rs.1,100. 4. Modify the BankAccount class to throw an IllegalArgumentException when the account is constructed with a negative balance, when a negative amount is deposited, or when an amount that is not between 0 an the current balance is withdrawn. Write a test program that causes all three exceptions to occur and that catches them all. 5. Implement a class Student. For the purpose of this exercise, a student has
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/15/2011 for the course ECO 2023 taught by Professor Mr.raza during the Summer '10 term at FAU.

Page1 / 2

WADT ASSIGNMENT 2 - Assigned Date: 14/3/05 Due Date:...

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

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