Tempo Accœnt

Tempo Accœnt

  • NA
  • 2
  • 634

Age Comparison - Cinema Admittance Programme

Nov 30 2016 4:40 AM
Hello Im new to this so don't know how the site works.
 
I'm trying to have the user into a movie number then their age, once they have done so I'll compare the age of the movie with the age inputed. If they are younger then the age rating it should say you are too young.
 
However, all it does right now is say any age is accepted.
 
 
using System;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Welcome To CinemaWorldCinema");
Console.WriteLine("Films on Show Today:");
Console.WriteLine("1. Trolls - U");
Console.WriteLine("2. Insidious - 15");
Console.WriteLine("3. Pulp Fictions - 18");
Console.WriteLine("4. Legend - 18");
Console.WriteLine("5. Macbeth - 12");
Console.WriteLine("6.Hotel Transylvania 2 - U");
Console.Write("Which Film Would You Like To See Today? "); 
string filmNumber = Console.ReadLine();
int filmNo = int.Parse(filmNumber);
 
Console.Write("Please Input Your Age: ");
string personsAge = Console.ReadLine();
int Age = int.Parse(personsAge);
 
string admitResponse = "Enjoy Your Movie!";
string refuseResponse = "You Are Too Young, Sorry!";
 
if (Age >= 18 )
 
Console.WriteLine(admitResponse);
 
else if (Age >= 15 )
Console.WriteLine(admitResponse);
 
else if (Age >= 12 )
Console.WriteLine(admitResponse);
 
else Console.WriteLine(refuseResponse);
}
}
 
I need it so when someone says they are 17 and pick an 18 film then it says they can go to view it, if they are 14 and want a 15/18 then they can't view it etc. 

Answers (1)