Question

In: Computer Science

A local zoo offers three different memberships: an individual membership for $99 per year, a dual...

A local zoo offers three different memberships:

an individual membership for $99 per year, a dual membership for $175 per year,

and a family membership for $225 per year. The membership director wants a program

that displays the total membership revenue for the year,

as well as the amount of the total revenue contributed by each membership type.

a. enter the input, processing, and output items, as well as the algorithm, in the first column.

b.Desk-check the algorithm twice. For the first desk-check, use 50, 75, and 150

as the numbers of individual, dual, and family memberships sold during the year.

For the second desk-check, use 35, 150, and 265.

Solutions

Expert Solution

Hi, Thank you for asking the question. This code is written in C++ but the same approach can be used in any programming language.

Here we create 3 global variables for storing the membership price for each type for a year. Having global variables gives you an advantage that later when you want to change the prices for each type, then you don't have to make changes to the complete program. Just changing these variables can work. We take "long long" as the datatype instead of "interger" because the revenue can be very large and integer might not be able to store it.

After that we take input from the user and store them in 3 seperate variables (num_individual_sold, num_dual_sold, num_family_sold).

Then the revenue generated from a particular type, let's say, individual will be (price for each individual membership) * (total individual memberships sold).

Adding the renevue from each memberships will give us the total revenue generated.

Below is the complete code along with the screenshot of output. Hope you like it.

#include<bits/stdc++.h>
using namespace std;

long long MEM_FEE_INDIVIDUAL = 99;            //stores the individual membership fee per year 
long long MEM_FEE_DUAL = 175;                 //stores dual membership fee per year
long long MEM_FEE_FAMILY = 225;               //stores family membership fee per year

int main() {
    long long num_individual_sold, num_dual_sold, num_family_sold;         
    cin >> num_individual_sold >> num_dual_sold >> num_family_sold;         //taking input for number of memberships sold in each type
    
    long long total_revenue_individual, total_revenue_dual, total_revenue_family;
    
    total_revenue_individual = MEM_FEE_INDIVIDUAL * num_individual_sold;    //calculating total revenue made by selling individual memberships
    total_revenue_dual = MEM_FEE_DUAL * num_dual_sold;
    total_revenue_family = MEM_FEE_FAMILY * num_family_sold;
    
    cout << "Total Revenue: $" << total_revenue_individual + total_revenue_dual + total_revenue_family << endl;
    cout << "Total Revenue by individual memberships: $" << total_revenue_individual << endl;
    cout << "Total Revenue by dual memberships: $" << total_revenue_dual << endl;
    cout << "Total Revenue by family memberships: $" << total_revenue_family << endl;
}


Related Solutions

The Evergreen Golf Club offers life membership at an annual subscription fee of $3600 per person.The...
The Evergreen Golf Club offers life membership at an annual subscription fee of $3600 per person.The following information is available for the Evergreen Golf Club for the year ended 31 March 2018. cash balance at 1 April 2017 1750 Administered expenses 12775 For the annual social evening,800 tickets were sold at a price of $250each.However,payment has not yet been received for 30 tickets. Social evening costs 60895 Ground maintenance 39430 staff costs 46900 The club has a total of 120...
In a new restaurant Jake’s offers three different burgers that is open 40 hours per week....
In a new restaurant Jake’s offers three different burgers that is open 40 hours per week. Each product requires the following processing times (in minutes) in each of three station. Burger Max Burger Special Mega Burger Grill 2 2 1 Preparation 3 4 6 Packaging 4 6 5 Each station must be run by one of 19 cross-trained workers who are each available 35 hours per week. The plant has 10 grills, 6 preparation stations, and 8 packaging machines available....
Revenue Recognition, Cash and Accrual Bases Hathaway Health Club sold three-year memberships at a reduced rate...
Revenue Recognition, Cash and Accrual Bases Hathaway Health Club sold three-year memberships at a reduced rate during its opening promotion. It sold 1,000 three-year nonrefundable memberships for $351 each. The club expects to sell 100 additional three-year memberships for $888 each over each of the next two years. Membership fees are paid when clients sign up. The club's bookkeeper has prepared the following income statement for the first year of business and projected income statements for Years 2 and 3....
Hathaway Health Club sold three-year memberships at a reduced rate during its opening promotion. It sold...
Hathaway Health Club sold three-year memberships at a reduced rate during its opening promotion. It sold 1,000 three-year nonrefundable memberships for $354 each. The club expects to sell 100 additional three-year memberships for $885 each over each of the next two years. Membership fees are paid when clients sign up. The club's bookkeeper has prepared the following income statement for the first year of business and projected income statements for Years 2 and 3. Cash-basis income statement: Year 1 Year...
Investment A offers to pay you $10,000 per year for 10 years while Investment B offers...
Investment A offers to pay you $10,000 per year for 10 years while Investment B offers to pay you $15,000 per year for 6 years. a. If the annual interest rate (compounded annually) is 10%, which investment is more valuable? b. Does your answer change if the annual interest rate (compounded annually) is 5%? c. At what interest rate are the two investments equally attractive?
Investment X offers to pay you $5,100 per year for nine years,whereas Investment Y offers...
Investment X offers to pay you $5,100 per year for nine years, whereas Investment Y offers to pay you $7,200 per year for five years. Calculate the present value for Investments X and Y if the discount rate is 6 percent. (Do not round intermediate calculations and round your answers to 2 decimal places, e.g., 32.16.) Present value Investment X $ Investment Y $ Calculate the present value for Investments X and Y if the discount rate is 16 percent. (Do not round...
Investment X offers to pay you $4,300 per year for nine years, whereas Investment Y offers...
Investment X offers to pay you $4,300 per year for nine years, whereas Investment Y offers to pay you $6,000 per year for six years. (Use a Financial calculator to arrive at the answers. Round "PV Factor" to 3 decimal places. Round the final answers to 2 decimal places.) Calculate the present value for Investment X and Y if the discount rate is 4%. Present value Investment X $ Investment Y $ Calculate the present value for Investment X and...
Investment X offers to pay you $5,000 per year for nine years, whereas Investment Y offers...
Investment X offers to pay you $5,000 per year for nine years, whereas Investment Y offers to pay you $7,500 per year for five years. a. Calculate the present value for Investments X and Y if the discount rate is 5 percent. (Do not round intermediate calculations and round your answers to 2 decimal places, e.g., 32.16.) b. Calculate the present value for Investments X and Y if the discount rate is 15 percent. (Do not round intermediate calculations and...
Investment X offers to pay you £6,000 per year for nine years, whereas Investment Y offers...
Investment X offers to pay you £6,000 per year for nine years, whereas Investment Y offers to pay you £8,000 per year for six years. (Do not round intermediate steps. Round your answers to 2 decimal places (e.g., 32.16). The program includes a margin of error of +/- 1%.)      Requirement 1: Which of these cash flow streams has the higher present value if the discount rate is 5 per cent? Investment Y has the higher present value of £...
Investment X offers to pay you $7,100 per year for 10 years, whereas Investment Y offers...
Investment X offers to pay you $7,100 per year for 10 years, whereas Investment Y offers to pay you $8,200 per year for 8 years. Requirement 1: (a) Assume the discount rate is 8 percent, what is the present value of these cash flows? (Do not include the dollar signs ($). Enter rounded answers as directed, but do not use the rounded numbers in intermediate calculations. Round your answers to 2 decimal places (e.g., 32.16).)   Present value   Investment X $    ...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT