Answered Essay: need to be able to compile to program.

1. Problem Statement: The goal of this programming assignment is to give students experience creating an interactive program that uses nested conditional statements to implement a series of menus. In particular, your task is to write a program that simulates a web service where users can order food items at three popular restaurants. To meet these goals, your program should do the following: Print a message asking the user which restaurant they wish to order from (e.g. McDonalds, Wendys or Chick-fil-A). You should also include instructions on what to enter to select a restaurant. For example, one option is to use integers 1,2,3. Another option is to use single characters M,W,C. It is up to you to choose what the user should type. Read the users input from above, and use this information to decide what list of food menu items to print. To keep things short and simple, your three menus should only include five items each. For each menu item, you should print the name of the item and the price of the item (e.g. Big Mac Meal $5.99). You should also print instructions on what the user must type to select an item. For example integers 1,2,3,4,5 or single characters A,B,C,D,E. Again, this is up to you . Read the users input of the menu item they wish to buy, and ask them how many orders of that item they want to buy. Read the integer item quantity from the user, and calculate and print the total cost for this purchase using the formula total cost- item price*tem quantity sales tax. To keep things simple, lets pretend the sales tax rate is 5% of the purchase price Your program should do some basic error checking. If the user does not choose a restaurant correctly, your program should print the message Sorry, that restaurant is not available and exit. If the user types in an invalid food item, your program should print the message Sorry, that is an food item is not available and exit. Finally, if the user enters a negative quantity, the program should print the message Sorry, item quantity must be positive and exit. You do NOT need to loop asking the user to enter their choice again. . is project is about conditional statements (and not loops) you are NOT red to handle multiple orders at one time. The user will just have to run your program a second time to order something else. 2. Design: This nrgiect is all ahout nrinting messages reading user innuts and nerforming

media%2Fd61%2Fd61a5ff3-c353-4301-a409-2c

I need to be able to compile to program.

1. Problem Statement: The goal of this programming assignment is to give students experience creating an interactive program that uses nested conditional statements to implement a series of menus. In particular, your task is to write a program that simulates a web service where users can order food items at three popular restaurants. To meet these goals, your program should do the following: Print a message asking the user which restaurant they wish to order from (e.g. McDonald’s, Wendy’s or Chick-fil-A). You should also include instructions on what to enter to select a restaurant. For example, one option is to use integers 1,2,3. Another option is to use single characters M,W,C. It is up to you to choose what the user should type. Read the user’s input from above, and use this information to decide what list of food menu items to print. To keep things short and simple, your three menus should only include five items each. For each menu item, you should print the name of the item and the price of the item (e.g. Big Mac Meal $5.99). You should also print instructions on what the user must type to select an item. For example integers 1,2,3,4,5 or single characters A,B,C,D,E. Again, this is up to you . Read the user’s input of the menu item they wish to buy, and ask them how many orders of that item they want to buy. Read the integer item quantity from the user, and calculate and print the total cost for this purchase using the formula “total cost- item price*tem quantity sales tax”. To keep things simple, lets pretend the sales tax rate is 5% of the purchase price Your program should do some basic error checking. If the user does not choose a restaurant correctly, your program should print the message “Sorry, that restaurant is not available” and exit. If the user types in an invalid food item, your program should print the message “Sorry, that is an food item is not available” and exit. Finally, if the user enters a negative quantity, the program should print the message “Sorry, item quantity must be positive” and exit. You do NOT need to loop asking the user to enter their choice again. . is project is about conditional statements (and not loops) you are NOT red to handle multiple orders at one time. The user will just have to run your program a second time to order something else. 2. Design: This nrgiect is all ahout nrinting messages reading user innuts and nerforming

Expert Answer

 

import java.util.Scanner;

public class IctHomework3 { // start public class Ict Homework 3

public static void main(String[] args) {// start main method

Scanner read=new Scanner(System.in);

System.out.println(“1.McDonaldsn2.Wendy’sn3.Chick-fil-A”);

System.out.println(“enter your choice??”);

int option=read.nextInt();

int quantity=0;

double total_cost = 0;

double item_price = 0;

double sales_tax;

boolean error=false;

if(option==1)

{

System.out.println(” 1.Mc Donalads item1 $1.00n 2.Mc Donalads item2 $2.00n 3.Mc Donalads item3 $3.00n 4.Mc Donalads item4 $4.00n 5.Mc Donalads item5 $5.00n”);

System.out.println(“enter your choice??”);

option=read.nextInt();

System.out.println(“enter quantity??”);

quantity=read.nextInt();

if(quantity>=0)

{

if(option==1)

{

item_price=1;

}

else if(option==2)

{

item_price=2;

}

else if(option==3)

{

item_price=3;

}

else if(option==4)

{

item_price=4;

}

else if(option==5)

{

item_price=5;

}

else

{

System.out.println(“Sorry that item is not available”);

error=true;

}

}

else

{

System.out.println(“Sorry the item quantity must be positive “);

error=true;

}

}

else if(option==2)

{

System.out.println(“1.Wendy’s item1 $1.00n 2.Wendy’s item2 $2.00n 3.Wendy’s item3 $3.00n 4.Wendy’s item4 $4.00n 5.Wendy’s item5 $5.00n”);

System.out.println(“enter your choice??”);

option=read.nextInt();

System.out.println(“enter quantity??”);

quantity=read.nextInt();

if(quantity>=0)

{

if(option==1)

{

item_price=1;

}

else if(option==2)

{

item_price=2;

}

else if(option==3)

{

item_price=3;

}

else if(option==4)

{

item_price=4;

}

else if(option==5)

{

item_price=5;

}

else

{

System.out.println(“Sorry that item is not available”);

error=true;

}

}

else

{

System.out.println(“Sorry the item quantity must be positive “);

error=true;

}

}

else if(option==3)

{

System.out.println(“1.Chick-fil-A item1 $1.00n 2.Chick-fil-A item2 $2.00n 3.Chick-fil-A item3 $3.00n 4.Chick-fil-A item4 $4.00n 5.Chick-fil-A item5 $5.00n”);

System.out.println(“enter your choice??”);

option=read.nextInt();

System.out.println(“enter quantity??”);

quantity=read.nextInt();

if(quantity>=0)

{

if(option==1)

{

item_price=1;

}

else if(option==2)

{

item_price=2;

}

else if(option==3)

{

item_price=3;

}

else if(option==4)

{

item_price=4;

}

else if(option==5)

{

item_price=5;

}

else

{

System.out.println(“Sorry that item is not available”);

error=true;

}

}

else

{

System.out.println(“Sorry the item quantity must be positive “);

error=true;

}

}

else

{

System.out.println(“Sorry that restaurant is not available”);

error=true;

}

if(error==false)

{

total_cost=item_price*quantity;

sales_tax=(5/100)*total_cost;

total_cost=total_cost+sales_tax;

System.out.println(“Total cost for this purchase is : $”+total_cost);

}

}

}

—————————-

Buy Essay
Calculate your paper price
Pages (550 words)
Approximate price: -

Help Me Write My Essay - Reasons:

Best Online Essay Writing Service

We strive to give our customers the best online essay writing experience. We Make sure essays are submitted on time and all the instructions are followed.

Our Writers are Experienced and Professional

Our essay writing service is founded on professional writers who are on stand by to help you any time.

Free Revision Fo all Essays

Sometimes you may require our writers to add on a point to make your essay as customised as possible, we will give you unlimited times to do this. And we will do it for free.

Timely Essay(s)

We understand the frustrations that comes with late essays and our writers are extra careful to not violate this term. Our support team is always engauging our writers to help you have your essay ahead of time.

Customised Essays &100% Confidential

Our Online writing Service has zero torelance for plagiarised papers. We have plagiarism checking tool that generate plagiarism reports just to make sure you are satisfied.

24/7 Customer Support

Our agents are ready to help you around the clock. Please feel free to reach out and enquire about anything.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

HOW OUR ONLINE ESSAY WRITING SERVICE WORKS

Let us write that nagging essay.

STEP 1

Submit Your Essay/Homework Instructions

By clicking on the "PLACE ORDER" button, tell us your requires. Be precise for an accurate customised essay. You may also upload any reading materials where applicable.

STEP 2

Pick A & Writer

Our ordering form will provide you with a list of writers and their feedbacks. At step 2, its time select a writer. Our online agents are on stand by to help you just in case.

STEP 3

Editing (OUR PART)

At this stage, our editor will go through your essay and make sure your writer did meet all the instructions.

STEP 4

Receive your Paper

After Editing, your paper will be sent to you via email.