Lawn moving fee

 using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;



namespace Sololearn

{

    class Program

    {

        static void Main(string[] args)

        {

        const double low = 25;

        const double medium = 35;

        const double high = 50;

        double weekFee,twenty_session_fee;

        

        

            Console.WriteLine("Enter length of your lawn");

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

            Console.WriteLine("Enter width of your lawn");

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

            double area = length * width;

            if(length ==0 || width ==0)

            {

                Console.WriteLine("Error\"Value can not be zero\"");

            }

            else if(area < 400)

            {

                weekFee = area * low;

                twenty_session_fee=weekFee * 20;

                Console.WriteLine("Length :{0}\nWidth : {1}\nArea Calculated : {2}\nCost per week : {3}\n20week session fee : {4}",length ,width ,area ,weekFee ,twenty_session_fee);


            }

            else if(area >= 400 && area < 600)

            {

            weekFee = area * medium;

            twenty_session_fee=weekFee * 20;

                Console.WriteLine("Length :{0}\nWidth : {1}\nArea Calculated : {2}\nCost per week : {3}\n20week session fee : {4}",length ,width ,area ,weekFee ,twenty_session_fee);


            }

            else

            {

            

            

            weekFee = area * high;

            twenty_session_fee=weekFee * 20;

                Console.WriteLine("Length :{0}\nWidth : {1}\nArea Calculated : {2}\nCost per week : {3}\n20week session fee : {4}",length ,width ,area ,weekFee ,twenty_session_fee);


            }

        }

    }

}











Comments

Popular Posts