Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN C# - Problem #2: Lets make a deal In this problem we will determine if it is cheaper to buy items in a bulk

IN C# - Problem #2: Lets make a deal In this problem we will determine if it is cheaper to buy items in a bulk pack or individually with a coupon. You will prompt the user for the number of items in the bulk pack. Then prompt the user for the cost of the bulk pack. Use these 2 values and calculate the cost of (1) item. Now we will figure out the coupon price. The coupon only works for an individual item, not on the bulk packs. Ask the user for the cost of an individual item. Then prompt the user for the dollar amount off that the coupon is for. Use these two values and calculate the price of the (1) with coupon. Now compare the 2 individual prices to see which one costs less. Give the final results to the user and tell them to choose the cheaper option. Make sure you are validating each user prompt and storing them in the correct variable data type.

User Input: o Number of items in the bulk pack o Cost of bulk pack o The cost of the individual item o Coupon value (Amount of money off)

Result To Print Out: o If the individual cost in the bulk pack is cheaper:

Thecostof1iteminthebulkpackis$X,whichischeaperthanthecost of the individual item with coupon, which is $Y. Buy the bulk pack!

o If the individual cost in the one item with coupon is cheaper: Thecostof1itemusingacouponis$X,whichischeaperthanthecost

of the individual item from the bulk pack, which is $Y. Buy the individual

item and use the coupon!

Data Sets to Test: o Number of items in bulk pack = 50, Cost of bulk pack = 100.00, Cost of individual

item = 4.50, Coupon Value = 1.00 off ResultThecostof1iteminthebulkpackis$2.00,whichischeaper

than the cost of the individual item with coupon, which is $3.50. Buy the bulk pack!

o Number of items in bulk pack = 20, Cost of bulk pack = 80.50, Cost of individual item = 6.25, Coupon Value = 2.25 off

ResultThecostof1itemusingacouponis$4.00,whichischeaper than the cost of the individual item from the bulk pack, which is $4.025. Buy the individual item and use the coupon!

o Test One Of Your Own. All 3 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

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

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions

Question

i. What was the outcome of the interaction?

Answered: 1 week ago