#include <iostream>
usingnamespace std;
int age;
int option;
int input;
int avengers();
int batman();
int django();
int main ()
{
cout<<"Welcome to my program"<<endl;
cout<<"Please choose what movie you would like to see"<<endl;
cout<<"Enter 1: The Avengers"<<endl;
cout<<"Enter 2: Batman The Cartoon"<<endl;
cout<<"Enter 3: Django"<<endl;
if (input == 1)
{
int avengers();
}
if (input == 2)
{
int batman();
}
if (input == 3)
{
int django();
}
if (input != 1 && input !=2 && input !=3)
{
cout<<"Error! only 1, 2 or 3 is accepted"<<endl;
cout<<"Please check and try again";
}
system("pause");
}
int avengers();
{
int age;
cout<<"Enter your age";
cin>>age;
if (age<16)
cout<<"You are not allowed to watch this movie"<<endl;
elseif (age>=16)
cout<<"You are allowed to watch this movie"<<endl;
}
int batman();
{
int age;
cout<<"Enter your age";
cin>>age;
if (age<12)
cout<<"You are not allowed to watch this movie"<<endl;
elseif (age>=12)
cout<<"You are allowed to watch this movie"<<endl;
}
int django();
{
int age;
cout<<"Enter your age";
cin>>age;
if (age<18)
cout<<"You are not allowed to watch this movie"<<endl;
elseif (age>=18)
cout<<"You are allowed to watch this movie"<<endl;
}
}
#include <iostream>
#include <cstdlib>
usingnamespace std;
void avengers();
void batman();
void django();
int main ()
{
cout << "Welcome to my program" << endl;
cout << "Please choose what movie you would like to see" << endl;
cout << "Enter 1: The Avengers" << endl;
cout << "Enter 2: Batman The Cartoon" << endl;
cout << "Enter 3: Django" << endl;
int input = 0;
cin >> input;
switch( input )
{
case 1:
avengers();
break;
case 2:
batman();
break;
case 3:
django();
break;
default:
cout<<"Error! only 1, 2 or 3 is accepted"<<endl;
cout<<"Please check and try again";
break;
}
system( "pause" );
}
void avengers()
{
int age;
cout << "Enter your age: ";
cin>>age;
if ( age < 16 )
cout << "You are not allowed to watch this movie" << endl;
else
cout << "You are allowed to watch this movie" << endl;
}
void batman()
{
int age;
cout << "Enter your age";
cin >> age;
if ( age < 12 )
cout << "You are not allowed to watch this movie" << endl;
else
cout << "You are allowed to watch this movie" << endl;
}
void django()
{
int age;
cout << "Enter your age";
cin >> age;
if ( age < 18 )
cout << "You are not allowed to watch this movie" << endl;
else
cout << "You are allowed to watch this movie" << endl;
}