Respuesta :
Answer:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
employeeNamespace EmployeeProgram
{
public class employee
{
private int employeeNumber;
private string employeeName;
private string employeeHireDate;
private int employeeMonthlySalary;
private string employeeDescription;
private string employeeDepartment;
public employee(int employeeNumber, string employeeName, string dateOfHire, int employeeMonthlySalary, string employeeDescription, string employeeDepartment)
{
this.employeeNumber = 79;
this.employeeName = "David";
this.employeeHireDate = "09/03/20";
this.employeeMonthlySalary = 34834;
this.employeeDescription = "Manager";
this.employeeDepartment = "Engineering";
}
public int EmployeeNumber
{
get
{
return employeeNumber;
}
set
{
employeeNumber = value;
}
}
public string employeeName
{
get
{
return employeeName;
}
set
{
employeeName = value;
}
}
public string employeeHireDate
{
get
{
return employeeHireDate;
}
set
{
employeeHireDate = value;
}
}
public int employeeMonthlySalary
{
get
{
return employeeMonthlySalary;
}
set
{
employeeMonthlySalary = value;
}
}
public string employeeDepartment
{
get
{
return employeeDepartment;
}
set
{
employeeDepartment = value;
}
}
public string employeeDescription
{
get
{
return employeeDescription;
}
set
{
employeeDescription = value;
}
}
public override string ToString()
{
return "Employee ID: " + employeeNumber +
"Employee employeeName: " + employeeName +
"Employee Hire Date: " + employeeHireDate +
"Employee Monthly Salary: " + employeeMonthlySalary +
"Employee employeeDescription: " + employeeDescription +
"Employee employeeDepartment: " + employeeDepartment;
}
public void Print()
{
Console.WriteLine(this.ToString());
}
}
Int32 weeklySales = 0;
while (weeklySales.Equals(0))
{
Console.WriteLine("What are your weekly sales?");
String input = Console.ReadLine();
try
{
weeklySales = Int32.Parse(input);
}
catch
{
Console.WriteLine("There is an error in your input, try again!");
}
}
Double grossPay = weeklySales * .07;
Double federalTax = grossPay * .18;
Double retirement = grossPay * .1;
Double socialSecurity = grossPay * .06;
Double totDeductions = socialSecurity + retirement + federalTax;
Double homePay = grossPay - totDeductions;
Console.Write("\nYour Weekly Sale amount is :" + weeklySales + "$\nGross Pay: " + grossPay + "$\nFed Tax: " + federalTax + "$\nRetirement: " + retirement + "$\nSocial Security: " + socialSecurity + "$\nTotal Deductions: " + totDeductions + "$\nMaking your take home pay: " + homePay + "$");
Explanation:
- Declare the variables to store information about employees.
- Initialize the getter and setter methods for the Employee class.
- Calculate the rates by multiplying them with a suitable percentage as given in the question.
- Finally display all the results to the console.