-
Notifications
You must be signed in to change notification settings - Fork 0
/
Project1 (1).cpp
39 lines (36 loc) · 1.51 KB
/
Project1 (1).cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//Kayla Jamar
//Project 1
//This project was made to compute the gross box office revenue, the distributor amount, and the net profit from the users inputs
//which are the amount of children and adult tickets.The final output is the movie name, gross box revenue, distributor amount, and net profit.
//9/8/2020
#import <iostream>
#import <iomanip>
using namespace std;
const int MAX= 200;
int main(){
//need from user
//movie name
char Moviename [MAX] = ""; //c-string
cout<<"What is the name of the movie?"<<endl;
cin.getline(Moviename, 200);
//int tickets sold
int numAdultTicketS;
cout<<"How many adult tickets sold?"<<endl;
cin>>numAdultTicketS;
int numChildrensTicketS;
cout<<"How many children tickets sold?"<<endl;
cin>>numChildrensTicketS;
//outputs
double Adultprice,Childprice,greenboxrev,Distributoramount,NetProfit;
Adultprice = 7.50;
Childprice = 4.75;
greenboxrev = (numAdultTicketS * Adultprice) + (numChildrensTicketS * Childprice);
Distributoramount = greenboxrev * .8;
NetProfit = greenboxrev * .2;
cout<<fixed<<setprecision(2);//exact two decimals
//set the columns with outputs
cout<<setw(35)<<"Movie Name:"<<setw(36)<<Moviename<<endl;
cout<<setw(35)<<"Gross Box Office Revenue:"<<setw(30)<<"$"<<greenboxrev<<endl;
cout<<setw(35)<<"Distributor Amount:"<<setw(30)<<"$"<<Distributoramount<<endl;
cout<<setw(35)<<"Net Profit:"<<setw(30)<<"$"<<NetProfit<<endl;
return 0;}