Question

Write a program that computes the amount of money the cheerleaders raised during their candy bar...

Write a program that computes the amount of money the cheerleaders raised during their candy bar fundraiser using the following data: 12 bars per case. The candy was sold for $1.00 per bar. Each case cost $8.00. They are required to give the student government association 10% of their earnings. The program should ask the user how many bars were sold. The program should calculate and display the SGA proceed's, the Cheer team's proceeds, and the appropriate message depending upon if the goal was met. The team has a goal of raising $500. If the net proceeds (amount after SGA donation) exceeds $500, display the message...Congratulations! You have raised $500 or more! If the team did not raise $500, display the message....Sorry! You did not meet your goal! The program should NOT accept a negative number of bars. If a negative number is entered, the program should NOT move forward to calculate totals until valid data is entered. TIPS: All information given will be used! The cost of the candy IS NOT apart of the Cheerleading team's proceeds! Therefore, you must deduct what you paid for the candy (Cost of Goods Sold) before calculating what you give to SGA and what will be left as the cheer team's proceeds! Be sure to display the SGA and Cheer team's proceeds as well as the message!

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Screenshots of the code:

Sample output 1:

Sample Output 2:

Code to copy:

#include <iostream>

using namespace std;

int main()

{

int num;

const int costPerCase=8;

const int barPerCase=12;

do

{

cout << "Enter the number of candies sold!\n";

cin>>num;

}while(num<0);

//Since, per candy price is 1 dollar. hence, num is used //here as cost also

double profit = num-num*(costPerCase/double(barPerCase));

cout<<profit;

//calculate 10% for SGA fund

double SGA=0.10 * profit;

//calculate profit earned

double cheerProceed= profit -SGA;

//Display output

cout<<"\n";

cout<<"\nSGA Proceeds: "<<SGA;

cout<<"\nCheerProceeds: "<<cheerProceed;

//Check if goals are met

if(cheerProceed>=500)

{

cout<<"\n\nCongratulations! You have raised $500 or more!";

}

else

{cout<<"\n\nSorry! You did not meet your goal! ";}

}


Add a comment
Know the answer?
Add Answer to:
Write a program that computes the amount of money the cheerleaders raised during their candy bar...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • USING MATLAB: Many organizations sell candy for fundraisers. Often the items are purchased in bulk to...

    USING MATLAB: Many organizations sell candy for fundraisers. Often the items are purchased in bulk to cut cost and suppliers offer quantity discounts. 1-5 bars = $ 0.75 each 6-10 bars = cost of 5 bars + $0.50 each additional 11-15 bars = cost of 10 bars + $0.40 each additional More than 15 bars = cost of 15 bars + $0.30 each additional Starting with the function n = input('How many candy bars would you like to buy? ')...

  • Write a program in C++. You need everything everythihng given You will create a function that...

    Write a program in C++. You need everything everythihng given You will create a function that validates input. It should accept only non-negative integers. If the input is incorrect the function should throw an exception. The exception will not be caught in the function. You will create a function that reads in 2 integer values. One is a number that will be raised to the power of the second. So if 5 and 6 are entered the result would be...

  • Java BasketBall Bar Chart Write a program that allows you to create a bar chart for...

    Java BasketBall Bar Chart Write a program that allows you to create a bar chart for the active members of a basketball team during a game. (Recall: there are only 5 active players on the court per team in a standard basketball game.) Your program should do the following tasks: 1) Prompt the user to store the first name of the five players 2) Prompt the user to enter the points scored by each player a. Use a do...while loop...

  • Write a program in c++ for An electric company came out with a residential rate schedule...

    Write a program in c++ for An electric company came out with a residential rate schedule in your state. You are asked to write a program that will compute the customer’s electric bill. Program will prompt month number and Kilowatt hour used. Sample Input Screen:             Enter the month (1 - 12)                      :             Kilowatt hours used                             : The electric bill is computed using the following method: There is a flat service charge of $15.31...

  • Program 2 <100 points>: Chips and Salsa (chipsSalsa.cpp) Write a program that lets a maker of...

    Program 2 <100 points>: Chips and Salsa (chipsSalsa.cpp) Write a program that lets a maker of chips and salsa keep track of sales for five different types of salsa: mild, medium, sweet, hot, and zesty. The program should use two parallel 5-element arrays: an array of strings that holds the five salsa names and an array of integers that holds the number of jars sold during the past month for each salsa type. The salsa names should be stored using...

  • C++ programming For this assignment, write a program that will act as a geometry calculator. The...

    C++ programming For this assignment, write a program that will act as a geometry calculator. The program will be menu-driven and should continue to execute as long as the user wants to continue. Basic Program Logic The program should start by displaying a menu similar to the following: Geometry Calculator 1. Calculate the area of a circle 2. Calculate the area of a triangle 3. Quit Enter your choice(1-3): and get the user's choice as an integer. After the choice...

  • This program will ask the user to enter a number of players, then ask the user...

    This program will ask the user to enter a number of players, then ask the user for each player's name and score. Once all of the players have been entered, the program will display a bar chart with each of their scores scaled as a percentage of the maximum score entered. See below for details on exactly how this should work - an example transcript of how the program should work is shown below (remember that values entered by the...

  • Assignment Overview This programming assignment is intended to demonstrate your knowledge of the following:  Writing...

    Assignment Overview This programming assignment is intended to demonstrate your knowledge of the following:  Writing a while loop  Writing a for loop  Writing a while loop with a sentinel value Chocolate Coupons Foothill Fro-cho, LLC, gives customers a coupon every time they purchase a chocolate bar. After they earn a certain number of coupons, they qualify for a free chocolate bar, which they may use toward the purchase of a single chocolate bar. Usually, 7 is the...

  • please use python and provide run result, thank you! click on pic to make it bigger...

    please use python and provide run result, thank you! click on pic to make it bigger For this assignment you will have to investigate the use of the Python random library's random generator function, random.randrange(stop), randrange produces a random integer in the range of 0 to stop-1. You will need to import random at the top of your program. You can find this in the text or using the online resources given in the lectures A Slot Machine Simulation Understand...

  • i just need 10 and 12 answered!!! Thank you! Are you reading from a computer or...

    i just need 10 and 12 answered!!! Thank you! Are you reading from a computer or a cellphone? They are clear on my computer just need 10 and 12 answered pls The Business Situation When Shelley Jones became president-elect of the Circular Club of Auburn, Kansas, she was asked to suggest a new fundraising activity for the club. After a consider- able amount of research, Shelley proposed that the Circular Club sponsor a pro- fessional rodeo. In her presentation to...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT