The Invoice Calculator begins by displaying a message to the console. Then, the
ID: 3736788 • Letter: T
Question
The Invoice Calculator begins by displaying a message to the console. Then, the application prompts and reads the customer type entered by the customer. The following describes the customer types: Customer Type 1 represents the Bronze account, Customer Type 2 represents the Silver account, . Customer Type 3 represents the Gold account, and . Customer Type 4 represents the Platinum account. All customers are in one of these categories. The default category is Customer Type 1 (Bronze account). [NOTE: If a user enters a customer type other than 1, 2, 3, or 4, assign the customer the discount percentages associated with Type 1 (bronze).] The application will then prompt and read the subtotal value entered by the customer. The application should then calculate and display the discount percent, discount amount, and the total. Finally, it will display a thank you message and exits the application. Seminole Involce Total Calculator Please enter the customer type (Enter 1 for Bronze, 2 for silver, 3 for Gold, or 4 for Platinum): 1 Please enter the subtotal: 678.00 INVOICE REPORT: 678.00 Subtotal: Custoner type: Discount percent: Discount amount: Total: 0.15 101.70 576.30 Thank youExplanation / Answer
THE FOLLOWING PROGRAM HAS SOME ASSUMED PERCENTAGES PLEASE MODIFY THE PERCENTAGES ACCORDINGLY|:::
YOUR EXAMPLE INVOICE REPORT HAS ERROR DISCOUNT AMOUNT WITH RESPECTIVE PERCENTAGE CALCULATED.
//code begins
import java.util.Scanner;
import java.io.*;
public class invoice {
public static void main(String args[]){
Scanner scanner=new Scanner(System.in);
System.out.println
("*******************************************************************************************
*****");
System.out.println(" Seminole Invoice Total
Calculator");
System.out.println
("*******************************************************************************************
*****");
System.out.println("Please enter the customer type (Enter 1 for Bronze,2 for
Silver,3 for Gold, or 4 for Platinum):");
int ch=scanner.nextInt();
System.out.println("Please enter the subtotal:");
double dp=0;String ct="";
double ta=scanner.nextFloat();
switch(ch){
case 1: dp=0.15; ct="Bronze";break;
case 2: dp=0.25; ct="Silver"; break;
case 3: dp=0.35; ct="Gold";break;
case 4: dp=0.45; ct="Platinum";break;
default: System.out.println("invalid selection");System.exit(0);break;
}
double da=ta/*dp;
double pt=ta-da;
System.out.println(" INVOICE REPORT:");
System.out.println(" Subtotal: "+ta);
System.out.println(" Customer type: "+ct);
System.out.println(" Discount percent: "+dp);
System.out.println(" Discount amount: "+da);
System.out.println(" Total: "+pt);
System.out.println();
System.out.println(" Thank You!!");
System.out.println();
System.out.println
("*******************************************************************************************
*****");
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.