Create a console program that will compute for the fare of passengers, depend on
its passenger type.
-Regular Passenger
- Senior Passenger
- PWD Passenger
using ConsoleApp1.ServiceReference1;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Security;
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter passenger type(1 - regular, 2 - senior, 3 - PWD)");
int fare = 0;
int type = Convert.ToInt32(Console.ReadLine());
switch (type)
{
case 1:
fare = 10; break;
case 2:
fare = 15; break;
case 3:
fare = 20; break;
}
Console.WriteLine("Passenger fare is ${0}", fare);
Console.ReadLine();
}
}
Comments
Leave a comment