Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / A USING THE if STATEMENT (p111) The pandemic is over and your friends want to plan a big party

A USING THE if STATEMENT (p111) The pandemic is over and your friends want to plan a big party

Computer Science

USING THE if STATEMENT (p111)
The pandemic is over and your friends want to plan a big party. You’re new Java skills give you the idea of writing a program to help them out.  Write a java program that calculates how many packages of hot dogs and hot dog buns you need to buy for the party.  Assume that hot dogs come in packages of 10, and hot dog buns come in packages of 8.  Use JOptionPane to ask how many people are coming and how many hot dogs each person will eat.  The program needs to calculate the minimum number of packages of hot dogs and buns that need to be purchased.  It also needs to calculate how many of each will be leftover.  The program and class name should be your last name (up to 5 characters, your first initial, J2_A (ex: HardyL_J2A).  Use JOptionPane to print the following information:
- The minimum number of packages of hot dogs required
- The minimum number of packages of hot dog buns required
- The number of leftover hot dogs
- The number of leftover buns

B USING THE switch STATEMENT (p150) – Your boss has given you the assignment of writing a program to calculate the amount owed for season tickets to Six Flags Over Texas.  There are four packages:
A – Admission for 1 Year - $165
B – Pkg A + Parking - $190
C – Pkg B + Cup Refills - $225
D – Pkg C + 1 Meal/Day - $275

Use either JOptionPane or Scanner to ask for the package and the number of people.  Calculate the total amount owed as the amount for the selected package times the number of people plus 8% tax.  Verify that a valid package was picked.  Display the following (use your wording):
Selected Package
Number of People
Sub-Total
Tax
Grand Total


c USING THE switch STATEMENT (p150) – You’re opening a new restaurant that only sells burgers.  Write a program that uses switch to calculate the price of a person’s order.  The program will user scanner to ask what kind of burger, what size of drink, and what kind dessert. If the correct code is not entered, notify the user.  Using println, print each item selected on a separate line, then print the total. The price list is as follows:

Code

Item

Price

 

Code

Item

Price

 

Code

Item

Price

H

Hamburger

$4.00

 

S

Small Drink

$1.50

 

V

Vanilla

$1.50

C

Cheeseburger

$5.00

 

M

Medium Drink

$2.00

 

C

Chocolate

$1.50

V

Veggieburger

$6.00

 

L

Large Drink

$2.50

 

Y

Yogurt

$1.75

       

W

Water

$000

 

N

No Dessert

$0.00

 

Option 1

Low Cost Option
Download this past answer in few clicks

18.99 USD

PURCHASE SOLUTION

Already member?


Option 2

Custom new solution created by our subject matter experts

GET A QUOTE