Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For your birthday. you received a $10 gift certificate for an online music store. You can buy songs until your money is gone. Write a

image text in transcribed
For your birthday. you received a $10 gift certificate for an online music store. You can buy songs until your money is gone. Write a C++ program that allows a user to repeatedly buy songs from an online music store The initial balance is $10. For simplicity, we will just input from the user the cost of a song (say $0.99, 51.99 or $2.99) and ignore the song name and artist name. Exit the loop when the user doesn't have enough money to buy more songs and display the remaining balance. Make sure that negative balances are not allowed A sample output looks like the following: Enter the cost of g 0.99 Tour de batet 01 Enter the cost of Your rennt balance 1.99 : 7.02 Enter the cost of a song Your r inine bauce 2.98 : 4.00 Enter the cost of 1.99 Your m ind balance at 2.04 ter the cost of 2 your choice is too expensive!!! Choose another one please Pour resinin balance : 204 Enter the cost of 0.99 Your remaining balance is: 1.05 Enter the cost of 1.99 your choice to exp e ll! Choose another one please! Tour Tuning balance la L05 Roter the cost of songs 9.00 Your r inine balance at 0.05 You cannot b e

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_2

Step: 3

blur-text-image_3

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

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions