Pages

Write a c# programme that take input your data and calculate your ticket for workshop by applying discount condition

INPUT:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication16
{
classProgram
    {
staticvoid Main(string[] args)
        {
Char g,S;
Console.WriteLine(" Please select grade which you want\n1) A\n2) B\n3) C\n4) D");
            g = Convert.ToChar(Console.ReadLine());
switch (g)
            {

case'1':
                    {

Console.WriteLine(" Please Select your status:\na) Senior\nb) Employs\nc) Junior");
                        S = Convert.ToChar(Console.ReadLine());
switch (S)
                        {
case'a':
                                {
int Price;
                                    Price = (200 * 20) / 100;
Console.WriteLine(" Price of the ticket is {0}", Price);
break;
                                }


case'b':
                                {
int Price;
                                    Price = (200 * 50) / 100;
Console.WriteLine(" Price of the ticket is {0}", Price);
break;
                                }


case'c':
                                {
int Price;
                                    Price = (200 + 20);
Console.WriteLine(" Price of the ticket is {0}", Price);
break;
                                }
                        }
break;
                    }
case'2':

                        {

Console.WriteLine(" Please Select your status:\na) Senior\nb) Employs\nc) Junior");
                            S = Convert.ToChar(Console.ReadLine());
switch (S)
                            {
case'a':
                                    {
int Price;
                                        Price = (150 * 20) / 100;
Console.WriteLine(" Price of the ticket is {0}", Price);
break;
                                    }


case'b':
                                    {
int Price;
                                        Price = (150 * 50) / 100;
Console.WriteLine(" Price of the ticket is {0}", Price);
break;
                                    }


case'c':
                                    {
int Price;
                                        Price = (150 + 20);
Console.WriteLine(" Price of the ticket is {0}", Price);
break;
                                    }
                            }
break;
                        }


case'3':

                        {

Console.WriteLine(" Please Select your status:\na) Senior\nb) Employs\nc) Junior");
                            S = Convert.ToChar(Console.ReadLine());
switch (S)
                            {

case'a':
                                    {
int Price;
                                        Price = (100 * 20) / 100;
Console.WriteLine(" Price of the ticket is {0}", Price);
break;
                                    }


case'b':
                                    {
int Price;
                                        Price = (100 * 50) / 100;
Console.WriteLine(" Price of the ticket is {0}", Price);
break;
                                    }


case'c':
                                    {
int Price;
                                        Price = (100 + 20);
Console.WriteLine(" Price of the ticket is {0}", Price);
break;
                                    }
                            }
break;
                        }
case'4':

                        {

Console.WriteLine(" Please Select your status:\na) Senior\nb) Employs\nc) Junior");
                            S = Convert.ToChar(Console.ReadLine());
switch (S)
                            {
case'a':
                                    {
int Price;
                                        Price = (50 * 20) / 100;
Console.WriteLine(" Price of the ticket is {0}", Price);
break;
                                    }


case'b':
                                    {
int Price;
                                        Price = (50 * 50) / 100;
Console.WriteLine(" Price of the ticket is {0}", Price);
break;
                                    }


case'c':
                                    {
int Price;
                                        Price = (50 + 20);
Console.WriteLine(" Price of the ticket is {0}", Price);
break;
                                    }
                            }
break;
                        }
                        }



                        }
                    }

            }

OUTPUT:


No comments:

Post a Comment