Saturday, 23 July 2011

salary calculator


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int mon,tues,wed,thurs,fri;
            int twhour, salrary;
            int ovtime;

            Console.WriteLine("working hour of monday");
            mon = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("working hour of tuesday");
            tues = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("working hour of wedday");
            wed = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("working hour of thursday");
            thurs = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("working hour of friday");
            fri = Convert.ToInt32(Console.ReadLine());

            twhour = mon + tues + wed + thurs + fri;
            Console.WriteLine("the total working hour is {0}",twhour);

            salrary = twhour * 500;
            Console.WriteLine("the total salary is {0} $", salrary);

            if(twhour>40)
            {
                ovtime = twhour - 40;
                Console.WriteLine("over time hour are{0} ",ovtime);
            }
            Console.ReadKey();
        }
    }
}

No comments:

Post a Comment