Question

In: Computer Science

Python programming c++ Write a program that computes the amount of money the cheerleaders raised during...

Python programming c++

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.

Name the project LastnameFI_Midterm (ex. ArmwoodT_Midterm). Submit the .py file ONLY.

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!

Solutions

Expert Solution

Python Program :

(use python 3 version or more)

bars_per_case = 12
cand_per_bar = 1.00
case_cost = 8.00

bars = int(input("How many bars were sold ? : "))   # ask user about bars sold

while bars < 0:
    bars = int(input("Enter a valid number of bars : ")) # loop until bars entered are positive
    
total = 12*bars + (bars/case_cost)             # calculate total earnings
sga = 0.1*total                                # earnings of sga
net = total - sga                              # net earnings

cheer_teams = (bars/case_cost)                 # cheer teams proceeds or earnings

print()
print("The SGA proceed's are $",sga,)
print("The cheer teams proceeds are $",cheer_teams)
print()

if net >= 500:
    print("Congratulations! You have raised $500 or more!")
else:
    print("Sorry! You did not meet your goal!")

Screenshot :


Related Solutions

In the space provided below write a C program that computes the total amount of money...
In the space provided below write a C program that computes the total amount of money you have stored in your piggy bank. Your program does this by asking you for number of pennies, nickels, dimes, and quarters in the piggy bank and then displays how much money in total is in the piggy bank.
In the space provided below write a C ++ program that computes the total amount of...
In the space provided below write a C ++ program that computes the total amount of money you are depositing in your bank account. Your program does this by asking you to first enter the number and amount of each check you are depositing, and then it asks you to enter the type of cash bills being deposited and how many of each type, also the types of coins being deposited, and the number of each coin type.
Programming language: C++   suggested software: Code::Blocks Develop an algorithm and write a C++ program that computes...
Programming language: C++   suggested software: Code::Blocks Develop an algorithm and write a C++ program that computes the final score of a baseball game. Use a loop to read the number of runs scored by both teams during each of nine innings. Display the final score afterward. Submit your design, code, and execution result via file, if possible
**C++ Programming Language** a program that computes the average of a collection of numbers and then...
**C++ Programming Language** a program that computes the average of a collection of numbers and then outputs the total number of values that are greater than the average. The objective of this assignment is to select a language that you have never used before and modify the program from the text so that it outputs the number of A's, B's, C's, D's and F's. An A grade is any score that is at least 20% greater than the average. The...
Write a Python program that computes the income tax for an individual. The program should ask...
Write a Python program that computes the income tax for an individual. The program should ask the user to enter the total taxable income for the year. The program then uses the tax bracket (as shown below) to calculate the tax amount. This is based on a progressive income tax system which is how income tax is calculated in the U.S. As a result, this for example means that only income above $500,001 is taxed at 37%. Income of lower...
Write a Python program that computes the income tax for an individual. The program should ask...
Write a Python program that computes the income tax for an individual. The program should ask the user to enter the total taxable income for the year. The program then uses the tax bracket (as shown below) to calculate the tax amount. This is based on a progressive income tax system which is how income tax is calculated in the U.S. As a result, this for example means that only income above $500,001 is taxed at 37%. Income of lower...
C++ program Overloaded Hospital Write a c++ program that computes and displays the charges for a...
C++ program Overloaded Hospital Write a c++ program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an inpatient or an outpatient. If the patient was an inpatient, the following data should be entered: The number of days spent in the hospital The daily rate Hospital medication charges Charges for hospital services (lab tests, etc.) The program should ask for the following data if the patient was...
Write a program in C that computes the area of a circle (Area = pi *...
Write a program in C that computes the area of a circle (Area = pi * r2) and the volume of a sphere (Volume = 4/3 * pi * r3). Both formulas use r which is the radius. Declare a float variable pi = 3.14159. Get the value of r from the keyboard and store it in a float variable. Display both the area of the circle and the volume of the sphere.
C PROGRAMMING 1. Write a C Language inline function that computes the cube of float X,...
C PROGRAMMING 1. Write a C Language inline function that computes the cube of float X, if X is greater than 1 and X is less than 100. Put the inline function in a main program that reads X from the keyboard, calls the function, and then outputs the result. 2. Show an empty statement and detail what it does? 3. A collection of predefined functions is called a Database                    C) Subroutine                       E) None of these Library                       D) Directive 4....
Beginning Python Programming - Sorting: Write and test a Python program to print a set of...
Beginning Python Programming - Sorting: Write and test a Python program to print a set of real numbers in descending order. The program should also print out the median of the numbers input and how many numbers were input. The program should read in numbers until a negative number is read. The negative number serves as a sentinel or marker telling the program when to stop reading numbers. The program should then sort the numbers and print them out in...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT