Question: (JAVA CODING): Below is my partial java code: import java.util.Scanner; public class Homework { public static void main(String[] args) { System. out .println(Welcome Uber Eats!);

(JAVA CODING): Below is my partial java code:

import java.util.Scanner;

public class Homework {

public static void main(String[] args)

{

System.out.println("Welcome Uber Eats!");

String order="no";

int choice;

String type ="no";

String meat;

double withoutMeat=7.5;

double withBeaf=25.5;

double withPork=17.5;

double totalCost=0;

double cost=0;

double totalAmount=0;

double delivery=0;

double deliveryCharge=5;

double tips=0;

Scanner a=new Scanner(System.in);

System.out.println(" 1. Hamburger");

System.out.println(" 2. Pizza");

System.out.println(" 3. Noodle");

System.out.println(" 4. Salad");

System.out.println(" 5. Sandwich");

System.out.println(" 6. Exit");

System.out.println("+++++++++++++++++++++++++++++++");

System.out.println("");

System.out.print("Please Enter your choice (1-6): ");

choice=a.nextInt();

while(choice<1 && choice>6)

{

System.out.print("Please Enter a Correct Choice: ");

choice=a.nextInt();

}

switch(choice)

{

case 1:

System.out.println("");

System.out.println("Your choice is: Hamburger.");

break;

case 2:

System.out.println("");

System.out.println("Your choice is Pizza.");

break;

case 3:

System.out.println("");

System.out.println("Your choice is Noodle.");

break;

case 4:

System.out.println("");

System.out.println("Your choice is Salad.");

break;

case 5:

System.out.println("");

System.out.println("Your choice is Sandwich.");

break;

case 6:

System.out.println("");

System.out.println("Your choice is Finish the Order.");

System.exit(0);

break;

}

System.out.println("Would you like to have some meat on your " + choice);

type=a.next();

while(type.equalsIgnoreCase("yes"));

System.out.println("Beef or Pork?");

//Here

totalCost+=cost;

System.out.print("Do you want to order anything else (yes/no) :");

order=a.next();

while(order.equalsIgnoreCase("yes"));

System.out.print("Please Enter the amount of tips: $");

tips=a.nextDouble();

if(totalCost<50)

delivery=deliveryCharge;

System.out.println("Total Price: $"+totalCost);

System.out.println("Delivery Charge: $"+delivery);

System.out.println("Tips: $"+tips);

totalAmount=totalCost+delivery+tips;

System.out.println("Total Amount: $"+totalAmount);

System.out.println("Thanks!");

a.close();

}

}

Above is my unfinished code. I need to write a code (in the part where I commented //here) where the code asks the user, beef or pork? , where the program should calculate the total cost according to the user's choice. If the user answers "no" to "would you like to have some meat" question, the program does not calculate any meat cost.

Thus, the program should display the following:

Welcome to Uber Eats

Please enter your choice (1-6): 3

Your choice is: Noodle

Would you like to have some meat on your Noodle? Yes

Beef or Pork? beef

Would you like to have more food? No

Please enter the tips: 3.5

The total price is 34.0

Thanks

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!