Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication1
- { class Program
- {
- static void Main(string[] args)
- {
- string value;
- int val;
- double totalAllowance,totalDeduction;
- Console.Write("Enter basic salary: ");
- value = Console.ReadLine();
- val = Convert.ToInt32(value);
- Console.WriteLine("--------------------------------------------------------------------------");
- Console.WriteLine("Allowances\t\t\t\t\tDeductions\n");
- Console.Write("HRA\t\t: {0:n2}", 0.15 * val);
- Console.WriteLine("\t\t\tSS\t\t: {0:n2}", 0.07 * val);
- Console.Write("DA\t\t: {0:n2}", 0.10 * val);
- Console.WriteLine("\t\t\tLevy\t\t: {0:n2}", 0.01 * val);
- Console.Write("EA\t\t: {0:n2}", 0.05 * val);
- totalDeduction = computeDeductions((0.07 * val), (0.01 * val));
- Console.WriteLine("\t\t\tDeductions\t: {0:n2}",totalDeduction );
- Console.WriteLine("TA\t\t: {0:n2}", 0.12 * val);
- totalAllowance = computeAllowance((0.15 * val), (0.10 * val), (0.05 * val), (0.12 * val));
- Console.WriteLine("Allowances\t: {0:n2}", totalAllowance);
- Console.WriteLine("--------------------------------------------------------------------------");
- Console.WriteLine("Gross Salary\t\t: {0:n2}",grossSalary(val,totalAllowance));
- Console.WriteLine("Gross Salary\t\t: {0:n2}\n", netSalary(grossSalary(val, totalAllowance), totalDeduction));
- }
- static double computeAllowance(double hra, double da, double ea, double ta)
- { return hra + da + ea + ta; }
- static double computeDeductions(double ss, double levy)
- { return ss + levy; }
- static double grossSalary(int basic, double allowance)
- { return basic + allowance; }
- static double netSalary(double gross, double deduct)
- { return gross - deduct; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement