![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 07.10.2019 22:30 slowmotion
The following code is poorly structured. rewrite it so that it has a better structure and avoids redundancy. to eliminate redundancy, convert the code into a method named spending that accepts two parameters: a scanner for the console, and a string 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.
scanner console = new scanner(system. in);
system. out. print("how much will john be spending? ");
double amount = console. nextdouble();
system. out. println();
int numbills1 = (int) (amount / 20.0);
if (numbills1 * 20.0 < amount) {
numbills1++;
}
system. out. print("how much will jane be spending? ");
amount = console. nextdouble();
system. out. println();
int numbills2 = (int) (amount / 20.0);
if (numbills2 * 20.0 < amount) {
numbills2++;
}
system. out. println("john needs " + numbills1 + " bills");
system. out. println("jane needs " + numbills2 + " bills");
![ansver](/tpl/images/cats/User.png)
Answers: 1
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 09:30
Is a string of code written to hurt others by damaging or destroying
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 02:30
What is the power dissipated by a resistor with a current of 0.02 a and a resistance of 1,000 ? a. 200 w b. 20 w c. 0.4 w d. 4 w
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 12:00
3. when you right-click a linked spreadsheet object, what commands do you choose to activate the excel features? a. linked worksheet object > edit b. edit data > edit data c. linked spreadsheet > edit d. object > edit data
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 19:30
Of the following pieces of information in a document, for which would you most likely insert a mail merge field?
Answers: 3
You know the right answer?
The following code is poorly structured. rewrite it so that it has a better structure and avoids red...
Questions
![question](/tpl/images/cats/mat.png)
Mathematics, 26.04.2021 22:40
![question](/tpl/images/cats/mat.png)
Mathematics, 26.04.2021 22:40
![question](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 26.04.2021 22:40
![question](/tpl/images/cats/himiya.png)
Chemistry, 26.04.2021 22:40
![question](/tpl/images/cats/istoriya.png)
History, 26.04.2021 22:40
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/istoriya.png)
History, 26.04.2021 22:40
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/pravo.png)
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/istoriya.png)
History, 26.04.2021 22:40
![question](/tpl/images/cats/istoriya.png)
History, 26.04.2021 22:40
![question](/tpl/images/cats/himiya.png)
Chemistry, 26.04.2021 22:40
![question](/tpl/images/cats/fizika.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 26.04.2021 22:40
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 26.04.2021 22:40
![question](/tpl/images/cats/en.png)