1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
madreJ [45]
3 years ago
11

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.
Computers and Technology
1 answer:
KonstantinChe [14]3 years ago
8 0

We first import the header file for input output using include.

#include <iostream>

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 "<<endl;

cin >> adultTickets;

cout<<"Enter the number of child tickets "<<endl;

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 "<<endl;

cin >> adultTickets;

cout<<"Enter the number of child tickets "<<endl;

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;

}

You might be interested in
Win10如何删除自己添加的环境变量?...............
Paha777 [63]

Answer:

方法/步骤

右键单击以选择此计算机,然后有一个菜单来选择属性。

选择后,打开属性面板以找到我们的高级系统设置。

打开后,我们在系统设置下找到高级设置。

打开后,我们看到下面有一个环境变量选项。

打开后,我们在右下角看到一个删除选项。

单击删除到,在右下角后单击删除,然后单击确定的选项。 ...

本文未经授权摘自百度经验

8 0
2 years ago
Why header files are needed in every c program ?expalin​
bonufazy [111]

Answer:

Header files serve two purposes. System header files declare the interfaces to parts of the operating system. You include them in your program to supply the definitions and declarations you need to invoke system calls and libraries.

6 0
2 years ago
You must keep track of some data. Your options are: (1) A linked-list maintained in sorted order. (2) A linked-list of unsorted
ladessa [460]

Answer:

Question was incomplete and continued the question

For each of the following scenarios, which of these choices would be best? Explain your answer.

BST

Sorted Array

Un-sorted Array

a) The records are guaranteed to arrive already sorted from lowest to highest (i.e., whenever a record is inserted, its key value will always be greater than that of the last record inserted). A total of 1000 inserts will be interspersed with 1000 searches.

b) The records arrive with values having a uniform random distribution (so the BST is likely to be well balanced). 1,000,000 insertions are performed, followed by 10 searches.

Explanation:

Answer for a: Un-sorted array or Un-sorted linked list : as mentioned in the question itself that the records are arriving in the sorted order and search will not be O(log n) and insert will be not be O(n).

Answer for b : Un-sorted array or Un-sorted linkedlist : Number of the items to be inserted is already known which is 1,000,000 but it is very high and at the same time search is low. Unsorted array or Unsorted linked list will be best option here.

7 0
3 years ago
How do you jumpstart a car in the middle of nowhere??? Explain using 2 paragraphs.
Julli [10]
Is there another car around? If not the best way would be to put the car in neutral, get the car moving, than pop the clutch (or slam into drive if it's not a manual) the key should be on to do this. This has the same effect as a starter just doesn't require a battery.<span />
7 0
3 years ago
Read 2 more answers
What is the output of the following code segment?
Aliun [14]

Answer:

o

Explanation:

8 0
2 years ago
Other questions:
  • How to remove a channel from favorite list on suddenlink?
    15·1 answer
  • Is backing up computer files done on the hard drive?
    5·1 answer
  • A _____ is a device that not only provides surge protection, but also furnishes desktop computers and network devices with batte
    7·1 answer
  • Suppose we eliminate tcp and instead rely exclusively on udp as our only transport layer protocol. ⢠how does this impact opera
    15·1 answer
  • A microphone, a track ball, and speakers are all examples of ____. hardware software
    6·2 answers
  • Print a message telling a user to press the letterToQuit key numPresses times to quit. End with newline. Ex: If letterToQuit = '
    12·1 answer
  • Define the missing method. licenseNum is created as: (100000 * customID) licenseYear, where customID is a method parameter. Samp
    14·2 answers
  • Describe two circumstances where access services might get implemented by organizations please.​
    9·1 answer
  • What is the FaFASA4caster used for
    10·1 answer
  • Which statement describes what the Conditional Formatting option in Excel 2016 allows users to do?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!