Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. A Write a program that can be used by a pizza shop to determine the cost of an order. The regular price for a

1. A Write a program that can be used by a pizza shop to determine the cost of an order. The regular price for a pizza is $10 each. If a customer orders more than 3 pizzas, the shop will give the user a 10% discount on their entire order (i.e., 10% off the price of each pizza). If they order 3 or less pizzas, there is no discount. Write a program that requests the user to enter the total number of pizzas they want to order and then calculate the total cost of the order and print the results. Test the program with two sets of data that show both outcomes and include the results in this report. Do not concern yourself with controlling the display of the decimal point.

Sample Output

Enter the number of pizzas: 5

Cost before discount: $ 50.0

Total Discount: $ 5.0

Total Cost: $ 45.0

Enter the number of pizzas: 2

Cost before discount: $ 20.0

Discount: $ 0.0

Total Cost: $ 20.0

Program:

Output (2 different outputs/tests):

1.B.

Write a program that translates a number code description for different Faculties at Dalhousie to their longer equivalency. The codes are: 1 for Computer Science, 2 for Engineering, 3 for Medicine, 4 for Management, and 5 for Arts. The program will prompt the user to input a number and then print the name of the Faculty or a message Invalid input". Test the program with six sets of data and include the results in this report to show all possible outcomes.

Some sample runs:

Please input the Faculty code: 1

You have chosen Computer Science

Please input the Faculty code: 3

You have chosen Medicine

Please input the Faculty code: 6

Invalid input.

Program:

Output (6 different outputs/tests that show all cases):

Make sure it is done in Java format.

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

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions