Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Section: Consider the following piece of code for the Cyberburger . java import java.util.Scanner; public class Cyberburger { public static void main ( String [

Section:
Consider the following piece of code for the Cyberburger . java
import java.util.Scanner;
public class Cyberburger{
public static void main(String [] args){
// create a scanner that will handle ints
Scanner intScanner = new Scanner(
System.in);
// create a scanner that will handle Strings
Scanner stringScanner = new Scanner(
System.in);
// provide menu for Cyberburger
System.out.println("(1) CyberBurger");
System.out.println("(2) Double Meat CyberBurger");
System.out.println("(3) Triple Meat CyberBurger");
System.out.println("(4) Jalapeno and Cheese ");
System.out.println("(5) Bacon and Cheese ");
System.out.println("(6) Salad");
System.out.println("Enter the menu item that you want: ");
int menu = intScanner.nextInt () ;
System.out.println("Would you like cheese with that? (yes/no)");
String chesse = stringScanner.nextLine ();
}
}
Design a program named: CyberBurger . java, and incorporate the following:
Diagram a flowchart about how the program is working right now in terms of decisionmaking.
23
situation regarding the men if the user pro
menu c.g.,20)?
(b) Describe how you would address this situation.
(c) Decide to where would you move that statement in the program.
(d) Detect the conditions that the program shall ask for cheese.
(e) Integrate the condition from (d) in the flowchart from Question 1.
Once the input for cheese is moved, compute the total amount of money for the combo,
depending on whether the user selected cheese.
If the user selects "Yes," add $0.50 to the total.
If the user selects "No," do not add any value to the total.
(a) List the data type of the variable that handles the information of cheese.
(b) Code how statement of comparing the selection for cheese looks like.
Compute the tax of the total combo amount:
(a) The tax is 0.0825 of the total amount.
Demonstrate the result of the transaction by printing the menu item with the total price
of the order. For example, if the user selects Item 3 from the menu and selects "yes" to
cheese, your final output will look as follows:
Your order is Triple CyberBurger with cheese. Your total is $10.30.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions