In: Computer Science
•A theater owner agrees to donate a portion of gross ticket sales to a charity
•The program will prompt the user to input:
−Movie name
−Adult ticket price
−Child ticket price
−Number of adult tickets sold
−Number of child tickets sold
−Percentage of gross amount to be donated
•Inputs: movie name, adult and child ticket price, # adult and child tickets sold, and percentage of the gross to be donated
•The program needs to:
1.Get the movie name
2.Get the price of an adult ticket price
3.Get the price of a child ticket price
4.Get the number of adult tickets sold
5.Get the number of child tickets sold
PLEASE USE C++
#include<iostream>
using namespace std;
int main()//main function
{
int adult_ticket_price,child_ticket_price,num_of_adult_ticket,num_of_child_ticket,donation_percentage;
char movie_name[100];
double total_donation;
cout<<"enter the movie name:";//inputs
cin>>movie_name;
cout<<"Enter the price of an adult ticket price";
cin>>adult_ticket_price;
cout<<"enter the price of a child ticket price";
cin>>child_ticket_price;
cout<<"enter the number of adult tickets sold";
cin>>num_of_adult_ticket;
cout<<"enter the number of child tickets sold";
cin>>num_of_child_ticket;
cout<<"enter the percentage of donation";
cin>>donation_percentage;
total_donation=((adult_ticket_price*num_of_adult_ticket)+(child_ticket_price*num_of_child_ticket))*donation_percentage/100;
cout<<"the donation is "<<total_donation <<" for the movie "<<movie_name;
}
output:-
/*
enter the movie name:endgame
Enter the price of an adult ticket price10
enter the price of a child ticket price5
enter the number of adult tickets sold100
enter the number of child tickets sold50
enter the percentage of donation10
the donation is 125 for the movie endgame
*/