MyProgrammingLab - For Gaddis: Starting Out with C++ From Control Structures through Objects
MyProgrammingLab - For Gaddis: Starting Out with C++ From Control Structures through Objects
15th Edition
ISBN: 9780133780611
Author: Pearson
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 2, Problem 18PC

Energy Drink Consumption

A soft drink company recently surveyed 16,500 of its customers and found that approximately 15 percent of those surveyed purchase one or more energy drinks per week. Of those customers who purchase energy drinks, approximately 58 percent of them prefer citrus-flavored energy drinks. Write a program that displays the following:

• The approximate number of customers in the survey who purchase one or more energy drinks per week.

• The approximate number of customers in the survey who prefer citrus-flavored energy drinks.

Blurred answer
Students have asked these similar questions
c++ Energy Drink Consumption A soft drink company recently surveyed 16500 of its customers and found that approximately 15 percent of those surveyed purchase one or more energy drinks per week. Of those customers who purchase energy drinks, approximately 58 percent of them prefer citrus-flavored energy drinks. Write a program that displays the following: The approximate number of customers in the survey who purchase one or more energy drinks per week. The approximate number of customers in the survey who prefer citrus-flavored energy drinks.
(Calculating Credit Limits) Collecting money becomes increasingly difficult during periods of recession, so companies may tighten their credit limits to prevent their accounts receivable(money owed to them) from becoming too large. In response to a prolonged recession, one companyhas cut its customers’ credit limits in half. Thus, if a particular customer had a credit limit of $2000,it’s now $1000. If a customer had a credit limit of $5000, it’s now $2500. Write a program thatanalyzes the credit status of three customers of this company. For each customer you’re given:a) The customer’s account number.b) The customer’s credit limit before the recession.c) The customer’s current balance (i.e., the amount the customer owes the company).Your program should calculate and print the new credit limit for each customer and shoulddetermine (and print) which customers have current balances that exceed their new credit limits.
Transient PopulationPopulations are affected by the birth and death rate, as well as the number of people who move in and out each year. The birth rate is the percentage increase of the population due to births and the death rate is the percentage decrease of the population due to deaths. Write a program that displays the size of a population for any number of years. The program should ask for the following data: The starting size of a population P The annual birth rate (as a percentage of the population expressed as a fraction in decimal form)B The annual death rate (as a percentage of the population expressed as a fraction in decimal form)D The average annual number of people who have arrived A The average annual number of people who have moved away M The number of years to display nYears Write a function that calculates the size of the population after a year. To calculate the new population after one year, this function should use the formulaN = P + BP - DP + A - Mwhere N is the…

Chapter 2 Solutions

MyProgrammingLab - For Gaddis: Starting Out with C++ From Control Structures through Objects

Ch. 2.7 - Prob. 2.11CPCh. 2.7 - Which of the following is a character literal? B BCh. 2.7 - Prob. 2.13CPCh. 2.7 - Write a program that has the following character...Ch. 2.7 - What is wrong with the following program...Ch. 2.7 - Prob. 2.16CPCh. 2.7 - Write a program that stores your name, address,...Ch. 2.11 - Prob. 2.18CPCh. 2.11 - Prob. 2.19CPCh. 2.11 - Prob. 2.20CPCh. 2.14 - Is the following assignment statement valid or...Ch. 2.14 - How would you consolidate the following...Ch. 2.14 - What is wrong with the following program? How...Ch. 2.14 - Prob. 2.24CPCh. 2.16 - Prob. 2.25CPCh. 2 - How many operands does each of the following types...Ch. 2 - How may the double variables temp, weight, and age...Ch. 2 - Prob. 3RQECh. 2 - Write assignment statements that perform the...Ch. 2 - Is the following comment written using single-line...Ch. 2 - Is the following comment written using single-line...Ch. 2 - Modify the following program so it prints two...Ch. 2 - What will the following programs print on the...Ch. 2 - Multiple Choice 9. Every complete statement ends...Ch. 2 - Prob. 10RQECh. 2 - Every C++ program must have a ________. A) cout...Ch. 2 - Preprocessor directives begin with ________. A) #...Ch. 2 - The following data 72 'A' Hello World" 2.8712 are...Ch. 2 - A group of statements, such as the contents of a...Ch. 2 - Which of the following are not valid assignment...Ch. 2 - Which of the following are not valid cout...Ch. 2 - Assume w = 5, x = 4, y = 8, and z = 2. What value...Ch. 2 - How would each of the following numbers be...Ch. 2 - The negation operator is ________. A) unary B)...Ch. 2 - A(n) ___________ is like a variable, but its value...Ch. 2 - Prob. 21RQECh. 2 - T F A variable must be defined before it can be...Ch. 2 - T F Variable names may begin with a number.Ch. 2 - T F Variable names may be up to 31 characters...Ch. 2 - T F A left brace in a C++ program should always be...Ch. 2 - T F You cannot initialize a named constant that is...Ch. 2 - Prob. 27RQECh. 2 - Convert the following pseudocode to C++ code. Be...Ch. 2 - There are a number of syntax errors in the...Ch. 2 - Sum of Two Numbers Write a program that stores the...Ch. 2 - Sales Prediction The East Coast sales division of...Ch. 2 - Sales Tax Write a program that will compute the...Ch. 2 - Restaurant Bill Write a program that computes the...Ch. 2 - Average of Values To get the average of a series...Ch. 2 - Annual Pay Suppose an employee gets paid every two...Ch. 2 - Ocean Levels Assuming the oceans level is...Ch. 2 - Total Purchase A customer in a store is purchasing...Ch. 2 - Cyborg Data Type Sizes You have been given a job...Ch. 2 - Miles per Gallon A car holds 15 gallons of...Ch. 2 - Distance per Tank of Gas A car with a 20-gallon...Ch. 2 - Land Calculation One acre of land is equivalent to...Ch. 2 - Circuit Board Price An electronics company sells...Ch. 2 - Prob. 14PCCh. 2 - Triangle Pattern Write a program that displays the...Ch. 2 - Diamond Pattern Write a program that displays the...Ch. 2 - Stock Commission Kathryn bought 750 shares of...Ch. 2 - Energy Drink Consumption A soft drink company...
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
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY