Question: Rewrite it so that it has a better structure and avoids redundancy. You may wish to introduce a method to help capture redundant code. Scanner
Rewrite it so that it has a better structure and avoids redundancy. You may wish to introduce a method to help capture redundant code.
Scanner console new Scanner Systemin;
System.out.printHow much will John be spending? ;
double amount console.nextDouble;
System.out.println;
int numBillsintamount ;
if numBills amount
numBills;
System.out.printHow much will Jane be spending? ;
amount console.nextDouble;
int numbillsintamount ;
if numBills amount
numBills;
System.out.printlnJohn needs numBills bills";
System.out.printlnJane needs numBills bills";
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
