I get stuck on adding these requirements: Displaying Output with the print() or println() Functions Comments Variables Reading Input from

I get stuck on adding these requirements: Displaying Output with the print() or println() Functions Comments Variables Reading Input from

Question:

 I get stuck on adding these requirements: Displaying Output with the print() or println() FunctionsCommentsVariablesReading Input from the KeyboardPerforming CalculationsString ConcatenationDisplaying Formatted Output with printf()Named ConstantsRandom classWhile loopsFor loops These are the instructions for the  Java program using a switch statement for menu choices that will continuously allow a user to select from BeeBe’s Donuts menu and display the current receipt after each choice is made (obviously type 4 is not a donut but a way to end the program). The prices are below. Continue to prompt the user until they select Exit.1) Glazed (0.50)/ea or 5.00/dozen
2) Chocolate (0.99/ea or 9.90/dozen
3) Cake (0.80/ea or 8.25/dozen
4) ExitWhen a selection is made, the program should prompt the user for the number of donuts they want. This should be converted to take advantage of the dozen price. For example, if the use selected 13 glazed, then the it should charge 5.50 (5.00 + 0.50). If the user selects glazed again and purchases 11 more, then the total should now be 10.00 (5.00 + 5.00) for the total of 24 glazed donuts.Here is an example of the program’s output:Sample Run 1:1) Glazed (0.50)/ea or 5.00/dozen
2) Chocolate (0.99/ea or 9.90/dozen
3) Cake (0.80/ea or 8.25/dozen
4) Exit
Please make your selection: 4
Thank you for your order!
Total Cost: $0.00Sample Run 2:1) Glazed (0.50)/ea or 5.00/dozen
2) Chocolate (0.99/ea or 9.90/dozen
3) Cake (0.80/ea or 8.25/dozen
4) Exit
Please make your selection: 1
Enter amount of donuts wanted: 13
Please make your selection: 2
Enter amount of donuts wanted: 9
Please make your selection: 3
Enter amount of donuts wanted: 6
Please make your selection: 4
Thank you for your order!
Total Cost: $19.71Here is my code:  import java.util.Scanner;
 public class DonutShop {    public static void main(String[] args) {
         Scanner scanner = new Scanner(System.in);        int totalCost = 0.0;        int selection <= 5;        double totalCost = 0.0;                 // sample run 1:        System.out.println("1) Glazed (0.50)/ea or 5.00/dozen");        System.out.println("2) Chocolate (0.99/ea or 9.90/dozen");        System.out.println("3) Cake (0.80/ea or 8.25/dozen");        System.out.println("4) Exit");        int selection = scanner.nextInt();        System.out.println("Please make your selection: 4");        System.out.println("Thank you for your order!");        System.out.println("Total Cost: $0.00");        if (choice == 4){            break;        }        double aDonutPrice = 0.0;        double aDozenPrice = 0.0;      }} --------------------------------------------------------------------------------------------------------------------------Also, I need help with breaking down this statement for a java code to work as a slot machine simulation:  A slot machine is a gambling device where the user inserts money into and then pulls a lever (or presses a button). The slot machine then displays a set of random images. If two or more of the images' matches, the user wins an amount of money that the slot machine dispenses back to the user.Issue with understanding this Java program that simulates a slot machine. When the program runs, it should do the following:Asks the user to enter the amount of money he or she wants to enter into the slot machine.Instead of displaying images, the program will randomly select a word from the following list:Sevens, Cherries, Bells, Bars, Lemons, OrangesTo select a word, the program can generate a random number in the range of 0 through 5. If the number is 0, the selected word is Sevens; if the number is 1, the selected word is Cherries; and so forth. The program should randomly select a word from this list three times and display all three of the words.If none of the randomly selected words match, the program will inform the user that he or she has won $0. If two of the words match, the program will inform the user that he or she has won three times the amount entered. If three of the words match, the program will inform the user that he or she has won ten times the amount entered.The program will ask whether the user wants to play again. If so, these steps are repeated. If not, the program displays the total amount of money entered into the slot machine and the total amount won. Expert Answer: Answer rating: 100% (QA) Solution Here is a breakdown of the Java code for a slot machine simulation import java util Random import java util Scanner public class SlotMachine View the full answer