avatar
eb

Guest 57 9th Dec, 2019

MARKUP 1.00 KB
                                           
                         using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace bill
{
    class Program
    {
        static void Main(string[] args)
        {
            int unit;
            Console.WriteLine("enter the units consumed");
            unit = int.Parse(Console.ReadLine());
            if (unit < 200)
                Console.WriteLine(unit * 1.20);
            else if (unit < 400)
                Console.WriteLine(199 * 1.20 + (unit - 199) * 1.50);
            else if (unit < 600)
                Console.WriteLine((199 * 1.20) + ((399 - 200) * 1.50) + ((unit - 399) * 1.80));
            else if (unit >= 600)
                Console.WriteLine((199 * 1.20) + ((399 - 200) * 1.50) + ((599 - 400) * 1.80) + (unit - 599) * 2.00);
            else 
                Console.WriteLine("dont enter wrong number");
            Console.ReadLine();
       
        }
    }
}
                      
                                       
To share this paste please copy this url and send to your friends
RAW Paste Data
Recent Pastes