Bahria Payment system give discount to selected student in c#. using switch case
CODE:
using System;
public class HelloWorld
{
public static void Main(string[] args)
{
Console.WriteLine("\t\"Welcome To Bahria University Payment System\"");
Console.WriteLine("Enter Your Total Fees:");
double fees = double.Parse(Console.ReadLine());
Console.WriteLine("\nSelect Catagory in Which You Belong");
Console.WriteLine("1.Naval Background");
Console.WriteLine("2.Armed Force");
Console.WriteLine("3.Sibling");
Console.WriteLine("4.Orther Students");
double choose = double.Parse(Console.ReadLine());
double discount=0;
switch (choose)
{
case 1:
discount = fees * 0.5;
break;
case 2:
discount = fees * 0.3;
break;
case 3:
discount = fees * 0.2;
break;
case 4:
discount =0;
break;
default:
Console.WriteLine("Invalid Option");
break;
}
Console.WriteLine("Total Fees:{0}",fees);
Console.WriteLine("Discounted Price:{0}",discount);
double payment = fees - discount;
Console.WriteLine("Total Payment is :{0}",payment);
}
}
Comments
Post a Comment