Question: File: HW2_BankTable.java Write a program that simulates 2 bank transactions. The user will enter: the original amount in the bank, the money for transaction 1

File: HW2_BankTable.java Write a program that simulates 2 bank transactions. The user will enter: the original amount in the bank, the money for transaction 1 and the money for transaction 2. If a transaction has a negative number it means that money was removed from bank (an withdrawal). If a transaction has a positive number it means that money was deposited in the bank. Hint: if you add a negative number you are effectively subtracting. E.g. 100 + (-10) = 90 (so if you just add the transaction, it will do teh correct computation for both positive/deposit and negative/removal transactions) Print the data as a table. Use System.out.printf and reserve a minimum number of spaces to ensure the table stays aligned. Count the - to see how many spaces to reserve.

This program will simulate 2 bank transactions. Enter the original amount of money in the bank: 100.03 Enter the 1st transaction: 1000.2 Enter the 2nd transaction: 36 --------------------------- | Transaction | Account | | | 100.03 | | 1000.20 | 1100.23 | | 36.00 | 1136.23 | --------------------------- 

Sample run 2:

This program will simulate 2 bank transactions. Enter the original amount of money in the bank: 10023 Enter the 1st transaction: -56 Enter the 2nd transaction: 90.3 --------------------------- | Transaction | Account | | | 10023.00 | | -56.00 | 9967.00 | | 90.30 | 10057.30 | ---------------------------

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!