Electricity calculate your own home program in c#

May 02, 2013

Electricity calculate your own home program in c#

Create a class ElectricityBilling that contains a function which calculates total billing amount with the help of inputs and displays the yearly bill as well. Take name, consumer_id, consumer_type as input, where as pressure and consumed units are available by default as static members. Calculate the monthly bill based on the type of consumer. Also display the yearly bill. 


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

namespace Atif

    class ElectricityBilling
       static string name, consumerId, consumerType;
        static double pressure = 5.5;
        static  double consumerUnit=2.3;
        public static void totalBill()

            Console.Write("Enter Your Name       ::  ");
           name= Console.ReadLine();
            Console.Write("Enter Consumer Id     ::  ");
            consumerId = Console.ReadLine();
            Console.Write("Enter consumer Type   ::  ");
            consumerType = Console.ReadLine();
            double Month =( pressure * consumerUnit) * 1;
            Console.WriteLine("Your Monthly  Bill is ::  "+Month);
            double Yearly = (pressure * consumerUnit) * 12;
            Console.WriteLine("Your Yearly Bill is   ::  "+Yearly);


        class Program
         static  void Main(string[] args)


Screen Shor

You Might Also Like


Popular Posts

Like us on Facebook

Flickr Images