Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

FOR C# Write if-else-if statements that assign the correct value to discount , u

ID: 3908665 • Letter: F

Question

FOR C#

Write if-else-if statements that assign the correct value to discount, using the logic described below: Assume variables price, dept, discount are properly declared.

a. Assign 0.20 to discount if dept equals to 5 and price is $100 or more.

b. Assign 0.15 to discount if dept is anything else and price is $100 or more.

c. Assign 0.10 to discount if dept equals 5 and price is less than $100.

d. Assign 0.05 to discount if dept is anything else and price is less than $100.

Explanation / Answer

if(dept==5 && price>=100){ discount = 0.20; } else if(price >= 100){ discount = 0.15; } else if(dept==5 && price