Question: Thank you! The following code is poorly structured. Rewrite it so that it has a better structure and avoids redundancy. To help eliminate redundancy, convert

Thank you!

Thank you! The following code is poorly structured. Rewrite it so that

The following code is poorly structured. Rewrite it so that it has a better structure and avoids redundancy. To help eliminate redundancy, convert the code into a method named spending that accepts two parameters: a Scanner for the console, and a St ring for a single person's name, and prints the appropriate information about that person's bills. Your method could be called twice (once for John and once for Jane) to replicate the original code's behavior. *3, Revert Type your solution here: ........................................................................................................................................................................................................................................................................................................................................................................................................................................ 1 Scanner console = new Scanner(System.in); 2 System.out.print(\"How much will John be spending? \"l; 3 double amount = console.nextDouble(): 4 System.out.printlnl); 5 int numBillsl = (int) (amount / 20.0); 6 if (numBillsl * 20.0

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 Programming Questions!