Mart Payment system in c# and give discount to customer.

 CODE:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;


namespace CP__TH__task

{

    class Program

    {

        static void Main(string[] args)

        {

            double payment, billamt=0, discount = 0,pamt, cnt = 0;

            string rep;

            do

            {

                Console.WriteLine("Enter Amount OF Product:{0}",cnt+1);

                pamt = double.Parse(Console.ReadLine());

                billamt = billamt+ pamt;

                

                cnt++;

                Console.WriteLine("Do you want to add More Item");

                rep = Convert.ToString(Console.ReadLine());

               

            } while (rep=="yes" || rep=="YES");

           

            if (billamt>25000)

            {

                 discount = billamt * 0.1;

                 

            }

            else

            {

                discount = 0;

            }

            

            payment = billamt - discount;

            Console.WriteLine("Your Bill Amount is{0}",billamt);

            Console.WriteLine("discounted price is{0}",discount);

            Console.WriteLine("Your Total Paymentable amount is {0}",payment);

            Console.WriteLine("\n Thank you!");

        }

    }

}


Comments

Popular posts from this blog

Vertical and Reverse Paramid in c# using loop.

Calculator in c# using Static Methods

Calculator in c# using Method void method