Box Office problem

A movie theater only keeps a percentage of the revenue earned from ticket sales. The remainder goes to the movie distribution. Write a program that calculates a theater's gross and net box office profit for a night. The program should ask for the name of movie, and how many adult and child tickets were sold. (the price of an adult ticket is $6.00 and a child's ticket is $3.00.) It should display a report similar to

Movie Name: "Wheels of Fury"
Adult Tickets Sold: 382
Child Tickets Sold: 127
Gross Box Office Profit: $ 2673.00
Net Box Office Profit: $ 534.00
Amount Paid to Distributor: $ 2138.40


Note: Assume the theater keeps 20 percent of the gross box office profit
We're not going to do the problem for you, make an attempt and then if you encounter problems post your code here with your questions.
Ok, I am getting an error now, please help


// Hasnain Attarwala
// Lab2 problem 5
// Page 143
// Box office

#include <iostream>
#include <iomanip>;
using namespace std;

int main ()
{
// declare variables
float adult;
int noAdult;
float child;
int noChild;
float gross;
float net;
float CHILD_PRICE = 3.00;
float ADULT_PRICE = 6.00;
float cut;
float CUT_AMT = (20 / 100);
char movieName;






// assign data





// Input
cout << "Enter name of Movie: " << endl;
movieName = cin.get ();
cin.ignore ();


cout << "Enter how many Adult tickets were sold" << endl;
cin >> noAdult;
cout << "Enter how many Child tickets were sold" << endl;
cin >> noChild;



// calculation
adult = noAdult * ADULT_PRICE;
child = noChild * CHILD_PRICE;
gross = adult + child;
cut = gross * CUT_AMT;
net = gross - cut;

// Print


cout << "Movie Name:" << setw (10) << movieName << endl;
cout << "Adult Tickets Sold:" << setw (10) << noAdult << endl;
cout << "Child Tickets Sold:" << setw (10) << noChild << endl;
cout << "Gross Box Office Profit: $ " << setw (10) << gross << endl;
cout << "Net Box Office Profit: $ " << setw (10) << net << endl;
cout << "Amount Paid to Distributor: $ " << setw (10) << cut << endl;

return 0;
}

/// Derired output

//Movie Name: "Wheels of Fury"
//Adult Tickets Sold: 382 (all these figures should be in line in accordance with the decimal place
//Child Tickets Sold: 127
//Gross Box Office Profit: $ 2673.00
//Net Box Office Profit: $ 34.00
//Amount Paid to Distributor: $ 2138.40
Last edited on
Topic archived. No new replies allowed.