Java Programming

Details
Download and unzip IA03.zip
Like we did in the labs, the goal of this assignment will be to take fully
concrete classes, and modify them to use either an interface or
abstract class
There are many TODOs for you to complete
Do NOT delete the TODO comments. I use them when grading, and will
deduct points if you delete them.
You can assume that the user enters valid menu choices
You can assume the user enters positive decimal values as the payments

Output before your changes
This is what you output will look like before your coding begins
You’ll see farther below, that when you’re done, the output will be a
little more descriptive with the error messages given to the user
Choose card
1) Visa
2) MasterCard
Enter choice: 1
Choose bank
1) PNC
2) Bank Of America
Enter choice: 1
Card Balance: 123.45
Bank Balance: 100.0
Enter amount to pay: 101
Error: -1
New Card Balance: 123.45
New Bank Balance: 100.0

Process finished with exit code 0

Choose card
1) Visa
2) MasterCard
Enter choice: 1
Choose bank
1) PNC
2) Bank Of America
Enter choice: 1
Card Balance: 123.45
Bank Balance: 100.0
Enter amount to pay: 99
New Card Balance: 24.450000000000003
New Bank Balance: 1.0

Process finished with exit code 0

Choose card
1) Visa
2) MasterCard
Enter choice: 2
Choose bank
1) PNC
2) Bank Of America
Enter choice: 2
Card Balance: 135.79
Bank Balance: 200.0
Enter amount to pay: 200
New Card Balance: -64.21000000000001
New Bank Balance: 0.0

Process finished with exit code 0
Output after your changes
The output will be a little more descriptive with the error messages
given to the user
Choose card
1) Visa
2) MasterCard
Enter choice: 1
Choose bank
1) PNC
2) Bank Of America
Enter choice: 1
Card Balance: 123.45
Bank Balance: 100.0
Enter amount to pay: 101
Error: INSUFFICIENT_FUNDS
New Card Balance: 123.45
New Bank Balance: 100.0

Process finished with exit code 0
Choose card
1) Visa
2) MasterCard
Enter choice: 1
Choose bank
1) PNC
2) Bank Of America
Enter choice: 1
Card Balance: 123.45
Bank Balance: 100.0
Enter amount to pay: 99
New Card Balance: 24.450000000000003
New Bank Balance: 1.0

Process finished with exit code 0
Choose card
1) Visa
2) MasterCard
Enter choice: 2
Choose bank
1) PNC
2) Bank Of America
Enter choice: 2
Card Balance: 135.79
Bank Balance: 200.0
Enter amount to pay: 200
New Card Balance: -64.21000000000001
New Bank Balance: 0.0

Process finished with exit code 0   

Leave a Reply

Your email address will not be published. Required fields are marked *