Hi my teacher has given me an assignment and Im very lost on

Hi my teacher has given me an assignment and I\'m very lost on what to do. I have been trying to do this for a couple of hours and it\'s due tomorrow. I\'m very stressed and could use major help. Here is the problem: RoCo Crust pizzeria has a special on Friday nights called Flip out Fridays. You can order as many XL 1-topping pizzas as you’d like. When you are finished eating and ready for the bill, the manager will come over to your table. They’ll ask you if you want to guess heads or tails before they flip a coin. If you guess correctly, your pizza is free. The manager will ask for your guess and flip the coin for each pizza you ordered. The manager will then tell your server how many pizzas you will be required to pay for. The server will then calculate your bill. At RoCo Crust, an XL pizza costs 12.50. Basic toppings such as extra cheese, pepperoni, sausage, ham, onions, green peppers, etc. cost 1.75. Specialty toppings such as pineapple, jalapenos, bacon, cheeseburger, buffalo chicken, etc. cost 2.25 each. Write a program called Ch4Prog11 that asks the user how many pizzas they want and if they want a basic or specialty topping on it (them). For full credit, the user will be allowed to select basic or specialty toppings for each pizza. You will have to keep track of which pizza the manager is flipping the coin for as they go so you know how much each pizza costs for the bill. For a reduced score (-2 points) the user will select either basic or specialty for all of the pizzas. The program will need to display how many free pizzas of each kind along with the number that they’ll need to pay for followed by the calculated bill.

Solution

package com.KMFB;

import java.util.Scanner;

public class function {
   public static void main(String args[]){
       Scanner s= new Scanner(System.in);
       int coin=1;
       int total=0;
       System.out.println(\" NO Of XL-1 pizza you want to order?\");
       System.out.println(\"witg basic topiing?\");
      
       System.out.println(\"with special topping?\");
       int i=s.nextInt();
       for(int n=1;n<=i;n++){
           System.out.println(\"flip coin\");
           System.out.println(\"enter 0 for head or for tail 1\");
           coin=s.nextInt();
           if(coin==0){
System.out.println(\"true guess\");
               total=total+1;
           }else{
               System.out.println(\"false\");
           }
          
          
       }
       int j=i-total;
       System.out.println(\"wrong guess\");
       System.out.println(j);
       double totalAmount= (j*12.5);
       System.out.println(totalAmount);
      
   }
  
  

}

Hi my teacher has given me an assignment and I\'m very lost on what to do. I have been trying to do this for a couple of hours and it\'s due tomorrow. I\'m very

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site