Concept explainers
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
• 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.
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
Starting Out with C++: From Control Structures through Objects, Brief Version (8th Edition)
Additional Engineering Textbook Solutions
C How to Program (8th Edition)
Introduction To Programming Using Visual Basic (11th Edition)
Absolute Java (6th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Starting Out with Python (3rd Edition)
- 4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and fertilizer from a local nursery. The nursery carries different types of vegetable fertilizers in various bag sizes. When buying a particular fertilizer, they want to know the price of the fertilizer per pound and the cost of fertilizing per square foot. The following program prompts the user to enter the size of the fertilizer bag, in pounds, the cost of the bag, and the area, in square feet, that can be covered by the bag. The program should output the desired result. However, the program contains logic errors. Find and correct the logic errors so that the program works properly. // Logic errors. #include #include using namespace std; int main() { double costs double area; double bagsize; cout > bagsize; cout > cost; cout > area; cout << endl; cout << "The cost of the fertilizer per pound is: $" << bagsize / cost << endl; cout << "The cost of fertilizing per square foot is: $" << area / cost << endl; return 0; }arrow_forward18. Tom and Jerry opened a new lawn service. They provide three types of services: mowing, fertilizing, and planting trees. The cost of mowing is $35.00 per 5,000 square yards, fertilizing is $30.00 per application, and planting a tree is $50.00. Write an algorithm that prompts the user to enter the area of the lawn, the number of fertilizing applications, and the number of trees to be planted. The algorithm then determines the billing amount. (Assume that the user orders all three services.) (9)arrow_forwardUse C++ Many documents use a specific format for a person's name. Write a program whose input is: firstName middleName lastName and whose output is: lastName, firstInitial.middleInitial. Ex: If the input is: Pat Silly Doe the output is: Doe, P.S. If the input has the form: firstName lastName the output is: lastName, firstInitial. Ex: If the input is: Julia Clark the output is: Clark, J.arrow_forward
- Parking Charges) A parking garage charges a $2.00 minimum fee to park for up to threehours and an additional $0.50 per hour for each hour or part thereof over three hours. The maximumcharge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hoursat a time. Write a program that will calculate and print the parking charges for each of three customers who parked their cars in this garage yesterday. You should enter the hours parked for eachcustomer. Your program should print the results in a tabular format, and should calculate and printthe total of yesterday's receipts. The program should use the function calculateCharges to determine the charge for each customer. Your outputs should appear in the following format:Car Hours Charge1 1.5 2.002 4.0 2.503 24.0 10.00TOTAL 29.5 14.50arrow_forward(Financial application: compute future tuition)Suppose that the tuition for a university is $10,000 this year and increases 5% every year. Write a program that computes the tuition in ten years and the total cost of 4 years’ worth of tuition starting after the 10th year.arrow_forwardC++ Monthly Sales Tax A retail company must file a monthly sales tax report listing the sales for the month and the amount of sales tax collected. Write a program that asks for the month, the year, and the total amount collected at the cash register (that is, sales plus sales tax). Assume the state sales tax is 4 percent and the county sales tax is 2 percent. If the total amount collected is known and the total sales tax is 6 percent, the amount of product sales may be calculated as: S=T1.06 S is the product sales and T is the total income (product sales plus sales tax). The program should display a report similar to October, 2017 - - - - - - - - - - - - - - - - - - Total Collected: $ 26572.89 Sales: $ 25068.76 County Sales Tax: $ 501.38 State Sales Tax: $ 1002.75 Total Sales Tax: $ 1504.13arrow_forward
- Solly’s Sale Stores (S3) have 12 branches in Gauteng. Since his business has been affected by the lockdown period, he has decided to close one of the branches. The branch that has the smallest number of clients visit per week should be closed. S3 usually records the number of clients who visit each branch on weekly basis. Therefore, S3 requested that you to write a program that should display each branch name, followed by branch code, the number of clients, and the average number of all clients visiting the S3 branches. Furthermore, the program should also determine and display the branch name and code that has the lowest number of client visits. The program should define a struct to store the store’s details (store branch, store code, and the number of clients). The program must contain a function to input data and a function to output data. Add functions to determine the lowest number of client visits, and to determine the average number of all clients. (You may assume that the…arrow_forwardSolly’s Sale Stores (S3) have 12 branches in Gauteng. Since his business has been affected by the lockdown period, he has decided to close one of the branches. The branch that has the smallest number of clients visit per week should be closed. S3 usually records the number of clients who visit each branch on weekly basis. Therefore, S3 requested that you to write a program that should display each branch name, followed by branch code, the number of clients, and the average number of all clients visiting the S3 branches. Furthermore, the program should also determine and display the branch name and code that has the lowest number of client visits. The program should define a struct to store the store’s details (store branch, store code, and the number of clients). The program must contain a function to input data and a function to output data. Add functions to determine the lowest number of client visits, and to determine the average number of all clients. (You may assume that the…arrow_forwardNeed help coding in Java Morgan’s Department Store distributes bonuses to its salespeople after the holiday rush. Table 9-6 shows the bonuses, which are based on full weeks worked during the season and the number of positive online customer reviews. Write a program that allows a user to continuously enter values for the number of weeks worked and the number of positive reviews received and displays the appropriate bonus until the user enter a sentinel value: 99.arrow_forward
- Q#3: Develop a program to ask the user to enter a number, if the user enters a positive integer, then compute the factorial of that number and display it on the screen.arrow_forward(Financials: currency exchange) Write a program that prompts the user to enter the exchange rate from currency in U.S. dollars to Rupees PKR. Prompt the user to enter 0 to convert from U.S. dollars to Rupees PKR and 1 to convert from Rupees PKR and U.S. dollars. Prompt the user to enter the amount in U.S. dollars or Rupees PKR to convert it to Rupees PKR or U.S. dollars, respectively. Use c++ program.arrow_forwardPython No plagiarism please!!! Write a program that asks user to enter a value for variable a. Then, displays variables a, b, and c using a single print statement after performing the following operations: Adds 2 to a and assign the result to b. Multiply b with 4 and assign the result to a. Divide a by 3.14 and assign the result to b. Subtract 8 from b and assign the result to a. A company has determined that its annual profit is typically 23% of total sales. Write a program that asks the user to enter the projected amount of total sales, then displays the profit that will be made from that amount. Write a program that utilizes a constant to store the total amount of the user’s grocery store cart. Allow the user to purchase five items; the price will be inputted by the user for each item. Process this data by adding it to your cart total constant. Once the user has inputted all five items, output their total including a sales tax of 6%.arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage