Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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!

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

1. Prepare a short profile of Mikhail Zoshchenko ?

Answered: 1 week ago

Question

What is psychology disorder?

Answered: 1 week ago