Java
TOPIC 16 – IF STATEMENTS – PART 3

AP EXTRA

 

AP LESSON WORK

 

 

QUESTION 1

QUESTION 1 – USING SWITCH

Zach and Connor’s Awesome Vacuums is the best door-to-door vacuum selling company in all of Lively.  The company has hired you to write a software program that will calculate commissions for its different workers.  Commission rates are based on the worker’s role with the company:


                       Owner – 30%

                       Local Boss – 25%

                       Sales Associate – 20%

                       Newbie Employee – 15%

 

You must write the program that will ask for the sales amount and then ask for the user’s role within the company.  From there, you will calculate the amount of the commission.

Sample output:

 

Welcome to Johny and Taylor's Awesome Vacuums software. 

What was the sale price?

743.54

 

What type of employee are you? (1-Owner, 2-Local Boss, 3-Sales Associate, 4-Newbie Employee)

1

 

Owners receive 30% compensation on all sales.

You will make 223.062 on this sale.

 

Sample output 2:

 

Welcome to Johny and Taylor's Awesome Vacuums software.

 

What was the sale price?

743.54

 

What type of employee are you? (1-Owner, 2-Local Boss, 3-Sales Associate, 4-Newbie Employee)

3

 

Sales Associates receive 20% compensation on all sales.

You will make 148.708 on this sale.