SUBMITTED TO: Ma'am Misbah SUBMITTED BY: Aiman Rizwan ROLL NO: Info-Tech 16010 Department: Bs It Semeter: 6

You are on page 1of 5

SUBMITTED TO: Ma’am Misbah

SUBMITTED BY: Aiman Rizwan


ROLL NO: info-tech 16010
DEPARTMENT: BS IT
SEMETER: 6
PROGRAM:1

class Program
{
static void Main(string[] args)
{
double sales,s,total, rate ,commission;
string i;

Console.Write("\n\t\t*** Calculating SalePerson Commission ***\n\n");

Console.Write(" \n Enter Name of SalePerson:");


i = (Console.ReadLine());

Console.Write(" \n Enter the amount of monthly sales:");


sales =Convert.ToDouble (Console.ReadLine());

if (sales <= 5000)


{
rate = 0;
commission = rate * sales;
Console.WriteLine("\n \t Sorry No Commission! \n \t %% BETTER LUCK NEXT TIME
%% !!! ");
Console.WriteLine("\n Commission is :{0}", commission);
}

else if (sales <= 10000)


{
rate = 5 / 100d;
commission = rate * sales;
Console.WriteLine(" \n Commission is Calculated at the rate is 5% \n So commission
will be:{0}", commission);
}
else if (sales <= 15000)
{
rate = 10 / 100d;
commission = rate * sales;
Console.WriteLine(" \n Commission is Calculated at the rate is 10% \n So commission
will be:{0}", commission);
}
else if (sales <= 20000)
{
rate = 15 / 100d;
commission = rate * sales;
Console.WriteLine(" \n Commission is Calculated at the rate is 15% \n So
commission will be:{0}", commission);
}

else if (sales <= 25000)


{
rate = 20 / 100d;
commission = rate * sales;
Console.WriteLine(" \n Commission is Calculated at the rate is 20% \n So
commission will be:{0}", commission);
}
else
{
rate = 25 / 100d;
commission = rate * sales;
Console.WriteLine(" \n Commission is Calculated at the rate is 25% \n So
commission will be:{0}", commission);
}
Console.Write("\n Enter the Salary:");
s = Convert.ToDouble(Console.ReadLine());
Console.Write("\n---------------------------------------------------------------\n");
Console.Write("\n\t\t\t *** TOTAL SALARY *** ");
total = commission + s;
Console.WriteLine("\n\t\t NAME:"+ i);
Console.WriteLine("\t\t COMMISSION:{0}", commission);
Console.WriteLine("\t\t SALARY:"+ s);
Console.WriteLine("\t\t TOTAL=SALARY+COMMISSION");
Console.WriteLine("\t\t TOTAL="+ total);
Console.Write("\n---------------------------------------------------------------\n");
Console.ReadKey();
}}}
RESULT:

You might also like