Description
Based on the program you created for Assignment 5, modify your code to perform the following steps.
In Assignment 5, you created an Account hierarchy with a base class (Account) and two derived classes (SavingsAccount and CheckingAccount).Three of the mutator methods in this assignment validated user input:setBalance, setInterestRate, and setFeeCharged.In all of these methods, you were instructed to set the respective variables equal to zero if the user passed in a negative amount.In this assignment, you will modify your code such that if the user passes in a negative amount, an exception will be thrown that alerts the user that a negative amount has been entered.The program should catch the exception and display the error message to the user.Once an error (negative amount) has occurred, the program should inform the user that negative numbers are not permitted.It should then redisplay the menu. If an exception has not occurred, and a checking or savings object has been successfully created, the program should print the information for that object.
I will provide the assignment 5 zip file once the tutor has accepted.
Unformatted Attachment Preview
Purchase answer to see full attachment
Explanation & Answer
The soluti...
Review
Review
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Similar Content
Related Tags
The Old Man and the Sea
by Ernest Hemmingway
Slaughterhouse Five
by Kurt Vonnegut
Into the Wild
by Jon Krakauer
The Good Earth
by Pearl S. Buck
Untamed
by Glennon Doyle
Animal Farm
by George Orwell
Pride and Prejudice
by Jane Austen
Unf*ck Yourself
by Gary John Bishop
Notes from Underground
by Fyodor Dostoyevsky