Ask Question
25 March, 23:37

You need to write a program that calculates and displays the revenue earned from ticket sales at a movie theater. Input: Prompt the user for the number of adult tickets. Prompt the user for the number of child tickets. Process: Perform the calculations. The adult tickets cost $10.00 and the child tickets cost $6.00. The theater keeps 20% of the gross box office profit, and the rest goes to the movie distributor. Output: Display the results.

+2
Answers (1)
  1. 25 March, 23:46
    0
    We first import the header file for input output using include.

    #include

    Next, we import the namespace for input output.

    using namespace std;

    We first declare and initialize variables for all the information that needs to be stored and displayed.

    We take float data type since revenues earned by theater and distributor are shown as a percentage of the total sales made.

    float adultFee = 10, childFee = 6, adultTickets, childTickets;

    float sales, tRev, dRev;

    The user is prompted to enter the number of tickets for both adults and children.

    cout<<"Enter the number of adult tickets "<
    cin >> adultTickets;

    cout<<"Enter the number of child tickets "<
    cin >> childTickets;

    Following the input from the user, total sales, the earnings of both the theater and the distributor are calculated.

    total sales made by the theater

    sales = (adultFee * adultTickets) + (childFee * childTickets);

    total revenue earned by the theater

    tRev = (0.2 * sales);

    total revenue earned by the distributor

    dRev = (sales - tRev);

    As a last step, total sales, theater revenue and distributors profit are displayed.

    All the steps shown above are put down and the program is shown below.

    int main ()

    {

    float adultFee = 10, childFee = 6, adultTickets, childTickets;

    float sales, tRev, dRev;

    cout<<"Enter the number of adult tickets "<
    cin >> adultTickets;

    cout<<"Enter the number of child tickets "<
    cin >> childTickets;

    / / total sales made by the theater

    sales = (adultFee * adultTickets) + (childFee * childTickets);

    / / total revenue earned by the theater

    tRev = (0.2 * sales);

    / / total revenue earned by the distributor

    dRev = (sales - tRev);

    cout<<"Total sales made by the theater $" << sales << endl;

    cout<<"Total revenue earned by the theater $" << tRev << endl;

    cout<<"Total revenue earned by the distributor $" << dRev << endl;

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “You need to write a program that calculates and displays the revenue earned from ticket sales at a movie theater. Input: Prompt the user ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers