107 308
Assignments Done
98.9%
Successfully Done
In March 2023

# Answer to Question #257783 in C# for Maa

Question #257783

A company illustrates the use of a pay-type code to calculate an employee’s pay. Below are the formulas to calculate the pay for each pay – type code:

= Hourly        pay = rate * hours

= Piece work     pay = rate * number of pieces

= Commission    pay = commission * sales

= Salary         pay = salary

1
2021-10-27T18:50:51-0400
using System;

namespace Questions
{
class Program
{
static void Main()
{
Console.WriteLine("H = Hourly");
Console.WriteLine("P = Piece work");
Console.WriteLine("C = Commision");
Console.WriteLine("S = Salary");

decimal pay;

if(payTypeCode.Equals('H'))
{
Console.Write("hourly rate: ");

Console.Write("hours: ");

pay = hourlyRate * hours;
}
else if(payTypeCode.Equals('P'))
{
Console.Write("rate: ");

Console.Write("number of pieces: ");

pay = numberOfPieces * rate;
}
else if(payTypeCode.Equals('C'))
{
Console.Write("commision: ");

Console.Write("sales: ");

pay = commision * sales;
}
else
{
Console.Write("salary: ");

pay = salary;
}
Console.WriteLine("\nPay = " + pay);

}
}

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!