Question: Please help with the below java switch/case block of code to insert an if-statement? So if the user trying to deposit the amount 0, a

Please help with the below java switch/case block of code to insert an if-statement? So if the user trying to deposit the amount 0, a message coming up for example: "The amount must be over 0" Thanks! case 5: { System.out.print("Enter ssn: "); ssn = sc.nextInt(); System.out.print("SSN: "+ssn); List customers = Bank.getCustomers(); for(Customer c:customers) { if(c.getSSN() == ssn) { List accounts = c.getAccounts(); System.out.print(" Enter account number to deposit: "); int accno = sc.nextInt(); System.out.print("Enter deposited amount: "); float amount = sc.nextFloat(); for(SavingsAccount a:accounts) { if(a.getAccountNumber()==accno) { a.deposit(amount); } } } } }

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!