-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
32 lines (29 loc) · 1011 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
namespace practice_1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Please enter your age to know the price of the movie ticket");
int age = Convert.ToInt32(Console.ReadLine());
string price = "";
if (age <= 5) {
price = "free";
Console.WriteLine("The price for your movie ticket is " + price);
}
else if (age > 5 && age < 14) {
price = "$7.99";
Console.WriteLine("The price for your movie ticket is " + price);
}
else if (age > 14 && age < 65) {
price = "$11.99";
Console.WriteLine("The price for your movie ticket is " + price);
}
else if (age > 65) {
price = "$9.99";
Console.WriteLine("The price for your movie ticket is " + price);
}
}
}
}