Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose subs are sold for $ 1 0 each at a local shop. Every sub purchased comes with a coin. Once you have collected 1

Suppose subs are sold for $10 each at a local shop. Every sub purchased comes with a coin. Once you have collected 10 coins, you can exchange them for one free sub from the shop. Your goal is to determine the total number of subs you can get, including those obtained through exchanging coins, given n dollars to spend. For instance, if the user inputs $100, they can initially buy 10 subs, thereby receiving 10 coins, which are enough to get 1 more sub for free. Thus, with $30, the user can get a total of 11 subs and will have 1 coin left over.
allow user input for "how much they would like to spend on subs", tell how many subs they can buy with the amount of money entered, how many coins are left, and ask if you would like to reuse the program with a y/n
python and c++

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

More Books

Students also viewed these Databases questions

Question

In reference to Exercise 6 in Chapter 11, explain why S. 0.

Answered: 1 week ago