According to a 24-hour clock, the show timings are 10.15, 13.30, 18.00 and 22.00. The normal price of an adult ticket is $8.00. However, the price of an adult ticket for the matinee show is $5.00. Adults are those over 13 years. The normal price of a child ticket is $4.00. However, the price of a child ticket for the matinee show is $2.00. Write a program that determines the price of a movie ticket.
Answers
Answer:
#include<iostream>
using namespace std;
int main()
{
int x;
double y;
std::cin>>x;
std::cin>>y;
if(y==13.30 && x>13)
{
std::cout<<"$5.00";
}
else if(y==13.30 && x<=13)
{
std::cout<<"$2.00";
}
else if(x>13)
{
std::cout<<"$8.00";
}
else
{
std::cout<<"$4.00";
}
}
Answer:- We need to write the program that determines the price of a movie ticket. The program is as follows:-
#include<iostream>
using name space std;
int main()
{
int x;
double y;
std::cin>>x;
std::cin>>y;
if(y==13.30 && x>13)
{
std::cout<<"$5.00";
}
else if(y==13.30 && x<=13)
{
std::cout<<"$2.00";
}
else if(x>13)
{
std::cout<<"$8.00";
}
else
{
std::cout<<"$4.00";
}
}
This is the program that determines the price of a movie ticket.
The program displays the price of a movie ticket. The price of the movie is based on the customer's age.
If the user will enter any negative number, then the program will display invalid age message.
To know more about the given topic please go through the following
Link1:- https://brainly.in/question/16635010?
Link2:- https://brainly.in/question/38585357?
#SPJ3