Absolute C++, Student Value Edition, 6/e
Absolute C++, Student Value Edition, 6/e
6th Edition
ISBN: 9780133970982
Author: SAVITCH
Publisher: Pearson Education
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 1, Problem 9PP

The video game machines at your local arcade output coupons depending on how well you play the game. You can redeem 10 coupons for a candy bar or 3 coupons for a gumball. You prefer candy bars to gumballs. Write a program that inputs the number of coupons you win and outputs how many candy bars and gumballs you can get if you spend all of your coupons on candy bars first and any remaining coupons on gumballs.

Blurred answer
Students have asked these similar questions
Write a program that calculates how much money you’ll end up with if you invest an amount of money at a fixed interest rate, compounded yearly. Have the user furnish the initial amount, the number of years, and the yearly interest rate in percent. Some interaction with the program might look like this:  Enter initial amount: 3000 Enter number of years: 10 Enter interest rate (percent per year): 5.5 At the end of 10 years, you will have 5124.43 dollars.
You arrive in front of a bridge that you must cross to reach a village before dark. Crossing the bridge is not free - the bridgekeeper asks you to roll two dice to determine the cost. You decide to write a program to verify that he is charging the right price. Your program should read two integers, between 1 and 6, representing the values of each die. If the sum is greater than or equal to 10, then you must pay a special fee (36 coins). Otherwise, you pay twice the sum of the values of the two dice. Your program must then display the text "Special tax" or "Regular tax" followed by the amount you have to pay on the next line.
Write a program that requests the user to enter the total purchase in dollars and cents ( for example, $23.65, $45.00, etc) and outputs the discount in dollars and cents. If the total purchase is less than 200 dollars, there is no discount. If the total purchase is more than 200 dollars but less than or equal to 1000 dollars, then the discount is 15%, and if the total purchase is more than 1000 dollars, then the discount is 30%.  At this store, a student always gets 30% discount on all purchases. Include this information in your codes.
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Constants, Variables, Data types, Keywords in C Programming Language Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=d7tdL-ZEWdE;License: Standard YouTube License, CC-BY