Computers and Technology

Suppose you can buy a chocolate bar from the vending machine for $1 each. inside every chocolate bar is a coupon. you can redeem seven coupons for one chocolate bar from the machine. you would like to know how many chocolate bars you can eat, including those redeemed via coupon, if you have n dollars. for example, if you have 20 dollars then you can initially buy 20 chocolate bars. this gives you 20 coupons. you can redeem 14 coupons for two additional chocolate bars. these two additional chocolate bars give you two more coupons, so you now have a total of eight coupons. this gives you enough to redeem for one final chocolate bar. as a result you now have 23 chocolate bars and two leftover coupons. write a program that inputs the number of dollars and outputs how many chocolate bars you can collect after spending all your money and redeeming as many coupons as possible. also output the number of leftover coupons. the easiest way to solve this problem is to use a loop.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 16:00, eden1017
Why should characters such as / \ " ' * ; - ? [ ] ( ) ~ ! $ { } < > # @ & | space, tab, and newline be avoided in file names?
Answers: 2
image
Computers and Technology, 23.06.2019 16:00, CalCDanG
What is the biggest difference between section breaks and regular page breaks? section breaks are more difficult to add than page breaks. section breaks make it easier for you to view the document as an outline. section breaks allow you to have areas of the document with different formatting. section breaks are smaller than regular page breaks.
Answers: 2
image
Computers and Technology, 23.06.2019 19:00, jacobbecker99
Choose the correct citation for the case which established the "minimum contacts" test for a court's jurisdiction in a case. select one: a. brown v. board of education of topeka, 347 u. s. 483 (1954). b. international shoe co. v. washington, 326 u. s. 310 (1945) c. haynes v. gore, 531 u. s. 98 (2000). d. international shoe co. v. washington, 14 u. s. code 336.
Answers: 1
image
Computers and Technology, 25.06.2019 02:30, gabby0148
On the pie chart below, which β€œslice” represents 30% of the budget?
Answers: 2
Do you know the correct answer?
Suppose you can buy a chocolate bar from the vending machine for $1 each. inside every chocolate bar...

Questions in other subjects:

Konu
History, 13.05.2021 01:40
Konu
Mathematics, 13.05.2021 01:40