Question: Question 46 (15 points) Complete the following java code as stated below: import java.util.Scanner; public class Example { //----- //This program reads the amount

Question 46 (15 points) Complete the following java code as stated below:

Question 46 (15 points) Complete the following java code as stated below: import java.util.Scanner; public class Example { //----- //This program reads the amount of money spent by customers and calculate the //bonus paid to them. It also assigns a level based on their spending. public static void main (String[] args) { int Level; int Spent = 0; double Total bonus: final double bonus1 = 0.20; // 20% bonus final double bonus2 = 0.10; // 10% bonus final double bonus3 = 0.05; // 5% bonus while (Spent >= 0) // end input when negative amount is entered { Scanner scan = new Scanner (System.in); (Alt + A) System.out.print ("Enter amount of money spent:") Spent scan.nextInt(); // Give the amount spent // Complete this program by adding code to show the bonus obtained by the customers // Customers that spend $4000 or more get bonus1 = 20% of money spent and their level is 1 // Customers that spend between $2000 and $4000 get bonus2 = 10% of money spent and their level is 2 // All other customers get bonus3 = 5% of money spent and their level is 3 // Write the output showing the customer level, the amount spent and the bonus. // COMPLETE THE JAVA CODE BELOW:

Step by Step Solution

3.40 Rating (166 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here is the complete code as per the instructions given in the image import javautilScanner public class Example public static void mainString args in... View full answer

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!