-
Notifications
You must be signed in to change notification settings - Fork 0
/
Q7.cs
29 lines (24 loc) · 875 Bytes
/
Q7.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
//Accept Passenger name
Console.WriteLine("Enter the passenger name : ");
string? passengerName = Console.ReadLine();
//Accept total miles travelled
Console.WriteLine("Enter the total miles travelled : ");
int milesTravelled = Convert.ToInt32(Console.ReadLine());
switch (milesTravelled)
{
case (>= 10000 and < 20000):
Console.WriteLine("You are awarded with 10 flyer points!");
break;
case (>= 20000 and < 30000):
Console.WriteLine("You are awarded with 20 flyer points!");
break;
case (>= 50000 and < 100000):
Console.WriteLine("You are awarded with 30 flyer points!");
break;
case (>= 100000):
Console.WriteLine("You are awarded with 50 flyer points!");
break;
default:
Console.WriteLine(+milesTravelled + "is not right!");
break;
}