Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- assert_i System.out.println("Welcome to the GummyBear Online Store");
- System.out.println("Retailer . . . . . . ");
- System.out.println();
- Scanner scan = new Scanner(System.in);
- System.out.print("Enter the type of candy: ");
- String candy = scan.nextLine();
- if (candy.equals("gummy bear")) {
- System.out.print("Enter the price of the candy: ");
- String price = scan.nextLine();
- if (price.equals("20")) {
- System.out.println();
- System.out.println("Costumer . . . . . . ");
- System.out.print("Enter the number of gummy bears: ");
- int n = scan.nextInt();
- if(n <= 10) {
- System.out.println();
- System.out.println("Order Summary ...");
- System.out.println("Candy Units Price/Unit Cost");
- System.out.println("---------------------------------------------");
- System.out.println("Gummy Bear " + n + " 20$ " + (n * 20) + "$");
- System.out.println("---------------------------------------------");
- System.out.println("Total order cost " + (n * 20));
- System.out.println("Total order tax: " + (n * 20)*0.075);
- System.out.println("Grand Total: " + (n * 20)*1.075);
- }
- if(n > 10) {
- if(n > 10) {
- System.out.println();
- System.out.println("Order Summary ...");
- System.out.println("Candy Units Price/Unit Cost");
- System.out.println("---------------------------------------------");
- System.out.println("Gummy Bear 10 20$ 200$");
- System.out.println("Gummy Bear " + (n-10) + " 18$ " + (n-10)*0.9*20 + "$");
- System.out.println("---------------------------------------------");
- System.out.println("Total order cost " + (200+(n-10)*0.9*20));
- System.out.println("Total order tax: " + ((200+(n-10)*0.9*20)*0.075));
- System.out.println("Grand Total: " + ((200+(n-10)*0.9*20)*1.075));
- }
- }
- else {
- System.out.println("error");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement