Question: IN C# - Problem #4: Loyalty card In this problem you will calculate the total cost of two items that the user will purchase and

IN C# - Problem #4: Loyalty card In this problem you will calculate the total cost of two items that the user will purchase and calculate a discount based on if they are a preferred customer or not. Prompt the user for the cost of the (2) items. Then ask the user if they are a preferred customer. The only valid answers are yes or no. Upper and lowercase should also work. Make sure to use the != validation. If the customer is a member, then they get a 15% discount. If they are not a member, then no discount is given.

User Input: o Cost of First Item (in $)

o Cost of Second Item (in $) o Preferred Member Status must be yes or no

Result To Print Out: o If the user is not a member:

Results-Yourtotalpurchaseis$X.Oro If the user is a member:

Results-Yourtotalpurchaseis$X,whichincludesyour15%discount. Data Sets to Test:

o First Item Cost - $ 45.50, Second Item Cost - $75.00, Preferred Member yes Results-Yourtotalpurchaseis$102.425,whichincludesyour15%

discount.

o First Item Cost - $ 23.00, Second Item Cost - $44.25, Preferred Member yes Results-Yourtotalpurchaseis$67.25.

o Test One Of Your Own. All 4 of these tests must be in your code in a multi-lined comment. They must not be copy and pasted and they must match your programs output.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!