Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help on these java codes. If possible, please show each step and explanat

ID: 3785461 • Letter: I

Question

I need help on these java codes. If possible, please show each step and explanation using Eclipse.

(Exercise) Create -CheeseShop.java The machine will dispense 3 types of cheese, in one-pound packages. The types of cheese and prices are as follows: Dalaran Sharp: $1.25 per pound Stormwind Brie: $10.00 per pound Alterac Swiss: $40.00 per pound Your program will do the following: List all the cheese types available and the prices Asks the user how many pounds of each type of cheese to purchase Calculate sub Total (price amount of each cheese added together) Discount of Sub Total o for a $10 discount if their purchase is $50 or over o an additional $15 discount ($25 total if $100 or over Ask the user if they would like to see a list of what they purchased o If yes, a list comes up showing how much of each type of cheese they bought and the cost of each cheese o Display only the cheese they actually bought o If no then no itemized information is displayed Display Sub Total, Discount and Total Price

Explanation / Answer

import java.util.Scanner;

public class Cheese {

   public static void main(String[] args) {
       // TODO Auto-generated method stub
       int sh,br,sw;
       Scanner sc=new Scanner(System.in);
       System.out.println("We sell 3 kinds of cheese Dalaran sharp:$1.25 per pound Storwinf Brie: $10.00 per pound Alterac Swiss: $40.00 per pound");
       System.out.println("enter amount of Sharp");
       sh=sc.nextInt();
       System.out.println("enter amount of Brie");
       br=sc.nextInt();

       System.out.println("enter amount of Swiss   ");
       sw=sc.nextInt();
       System.out.println("Display the itemized list?(1 for yes)");
       int ch;
       ch=sc.nextInt();
       double total_sh,total_br,total_sw;
       total_sh=sh*1.25;
       total_br=br*10.00;
       total_sw=sw*40.00;
       double bill=total_sh+total_br+total_sw;
      
       if(ch==1)
       {
       System.out.println(sh+ "lbs of Sharp @ $1.25 ="+total_sh);
       System.out.println(br+ "lbs of Brie @ $10.00 ="+total_br);
       System.out.println(sw+ "lbs of Swiss @ $40.00 ="+total_sw);


       }
       double dis=10.00;
       if(bill>50)
       {
           dis+=15;
       }
       System.out.println("Sub total: "+bill);
      
       System.out.println("-Discount:"+dis);
       bill-=dis;
       System.out.println("Total :"+bill);

   }

}

==============================

Output:

We sell 3 kinds of cheese
Dalaran sharp:$1.25 per pound
Storwinf Brie: $10.00 per pound
Alterac Swiss: $40.00 per pound
enter amount of Sharp
1
enter amount of Brie
2
enter amount of Swiss  
3
Display the itemized list?(1 for yes)
1
1lbs of Sharp @ $1.25 =1.25
2lbs of Brie @ $10.00 =20.0
3lbs of Swiss @ $40.00 =120.0
Sub total: 141.25
-Discount:25.0
Total :116.25

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote