Write a C program for the calculation of the total price of the tickets that a group of visitors will pay to enter a museum .The regular price is 10.0 U.S per visitor. However students get 30% reduction , kids under 5 do not pay , kids between 5 and 10 have 50% reduction , and visitors above 60 have 20% reduction . In addition , if the number of visitors is more than 10, 15% reduction will be applied to the total price of the tickets.Write C program that ask the user to enter the number of student and number if the kids under 5 and the number of kids between 5 and 10 and the number of visitors above 60 and the number of visitors who do not have any special discounts .The program will calculate and display the total amount of the tickets requested ;
I try this but not sure
#include<iostream>
using namespace std;
int main()
{
double TotalPrice ,kids1,kids2,student ,vistor,vistor1;
double const price=10.0 ;
double ticket1,ticket2,ticket3,ticket4,ticket5;
cout<<"Enter the number of students : ";
cin>>student;
cout<<"Enter the number of kids under 5 : ";
cin>>kids1;
cout<<"Enter the number of kids betwwen 5 and 10 : ";
cin>>kids2;
cout<<"Enter the number of vistor above 60 : ";
cin>>vistor;
cout<<"Enter the number of vistor with no discount: ";
cin>>vistor;
ticket1=price*student*0.3;
ticket4=price*vistor*0.2;
ticket2=price*kids1*0.0;
ticket3=price*kids2*0.5;
ticket5=price*vistor*0.15;
if(vistor==student)
{
cout<<"The ticket price is : "<<ticket1<<endl;
}
else if(vistor==kids1 && vistor<5)
{
cout<<"The ticket price is : "<<ticket2<<endl;
}
else if(vistor==kids2 && vistor>=5 &&vistor<=10)
{
cout<<"The ticket price is : "<<ticket3<<endl;
}
else if(vistor==vistor && vistor>=60)
{
cout<<"The ticket price is : "<<ticket4<<endl;
}
else if(vistor==vistor && vistor>=10)
{
cout<<"The ticket price is : "<<ticket5<<endl;
}
TotalPrice= ticket1 ticket2 ticket3 ticket4 ticket5;
cout<<"The total price is : "<<TotalPrice<<" U.S "<<endl;
system("pause");
return 0;
}