Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment: Write a C++ program that takes you on a Father's Day shopping spree so you can purchase a gift for your father. The program

image text in transcribedimage text in transcribedimage text in transcribed

Assignment: Write a C++ program that takes you on a Father's Day shopping spree so you can purchase a gift for your father. The program should allow the user to purchase one of five possible gifts. The available gifts are: 1. Calvin Klein cologne 2. A Soft and Cuddly Puppy 3. A bottle of wine 4. A frame 5. A boring old card $68.00 $39.99 $24.00 $16.00 $ 4.00 Although all the gifts are available, the user should only be shown the choices that he/she can afford along with the choice to buy nothing. Your program should perform the following steps: 1.)Display a Welcome Message 2.)Ask the user if he wants to go on a shopping spree 3.)If the user answers positively: a) b) c) Prompt the user how much money he/she can spend Display the choices that he/she can afford only After a choice has been made, the program should print out how much money was spent and how much is still available Note: Due to a limited quantity, the user can only purchase one gift at a time. Continue to ask the user if he/she wants to continue shopping as long as they have money available to spend. Note: They need to have the minimum amount of money necessary and they can purchase the same costume again 20 points Sample Run of the program (Test Case 1) >./a.out How much money do you have to spend? 100 You have enough money to purchase.. 1. Calvin Klein cologne, $68 2. A Soft and Cuddly Puppy, $39.99 3. A bottle of wine, $24 4. A frame, $16 5. A boring old card, $4 6. Nothing Appeals to me, free Enter from available 6 choice (s) only >>1 You should choose C, p, w, f, b, n Would you like to shop some more (y)? y 1. Calvin Klein cologne, $68 2. A Soft and Cuddly Puppy, $39.99 3. A bottle of wine, $24 4. A frame, $16 5. A boring old card, $4 6. Nothing Appeals to me, free Enter from available 6 choice(s) only c You have spent $68 and you have $32 left to spend Would you like to shop some more (y)? y 1. A bottle of wine, $24 2. A frame, $16 3. A boring old card, 4 4. Nothing Appeals to me, free Enter from avaliable 4 choice(s) only n Wise Guy huhh. . . Would you like to shop some more (y)? n Entere> for cologne Enter

for puppy Enter for wine Enterf for frame Enter for boring Enter for nothing Enter for cologne Enter

for puppy Enter for wine Enter for boring Entern for nothing Enter for wine Enter for boring Enter./a.out How much money do you have to spend? 45 You have enough money to purchase.. 1. A Soft and Cuddly Puppy, $39.99 2. A bottle of wine, $24 3. A frame, $16 4. A boring old card, $4 5. Nothing Appeals to me, free Enter from available 5 choices only >> p You have spent $39.99 and you have $5.01 left to spend Would you like to shop some more (y)? 1. A boring old card, $4 2. Nothing Appeals to me, free Enter from available 2 choices nly b You have spent $4 and you have $1.01 left to spend Would you like to shop some mo re (y) ? y 1. Nothing Appeals to me, free Enter from available 1 choices nly n Wise Guy huhh. . . Would you like to shop some more (y)? n Enter

for puppy Enter for chocolate Enter for frame Enter for boring Entern for nothing Enter for boring Entern for nothing Enter for nothing<>

<>

<>

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions