Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE MAKE SURE IT IS DONE IN JAVA FORMAT. MUST USE IF OR ELSE STATEMENTS ONLY FOR 1.A AND 1.B 1. A Write a program

PLEASE MAKE SURE IT IS DONE IN JAVA FORMAT. MUST USE "IF" OR "ELSE" STATEMENTS ONLY FOR 1.A AND 1.B

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):

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

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

22 Employer marketing and branding techniques.

Answered: 1 week ago

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago