Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This is for C# Programming, you have to use the exact interface. Im having troub

ID: 3918184 • Letter: T

Question

This is for C# Programming, you have to use the exact interface. Im having trouble with the coding, can someone please help me!

The first assignment was....

Create a program that will calculate employee’s monthly gross pay as follows:

Inputs: Name,Annual Salary,Monthly Sales,

Keeps asking for additional inputs and creating the outputs until an empty name is entered.

Outputs:

Name

Monthly Base Pay (Salary / 12)

Commission calculated as follows:

Subtract 10 * Monthly Base Pay from Monthly Sales giving Net Sales

If the Net Sales is <= 0, then the Commission is 0

Otherwise the First $10,000 in Net Sales is commissioned at 5%

The next $15,000 in Net Sales is commissioned at 10%

The next $25,000 in Net Sales is commissioned at 15%

Any Net Sales over $50,000 is commissioned at 20%

Gross Pay (Monthly Base Pay + Commission).

If any of the inputs are unreasonable, tell user with a message and force reentry of the data (e.g. Negative Sales, Annual Salary > $120,000 or < $12,000, if not 0).

I have already completed this assignment now I need help with a similiar one with the interface below.

New Assignment

Create a windows program that will calculate employee’s monthly gross pay as follows:

Program will use the same rules as the 2 projects in CIS2342(see above) with the following additions:

Employees who are Managers, get commission on the total sales of all the sales reps

The sales are not lowered by the salary.

The percentages are ½ of the sales rep and the breakpoints are ten times the sales reps (e.g. if the sales rep first break point is at 50,000, then the managers is at 500,000.

Employees who are support get commissioned like managers, but they get 0.1 of what a manager gets.

You should create a class that saves the following information for an employee:

Last Name

First Name

Annual Salary

Type (Sales Rep, Manager, Support)

High Cost flag

When money information on the form changes, then the gross pay should be cleared.

The items shown in Cyan are not modifiable by entering data for this record, but may be modifiable at other times (e.g. the Last and First Name need to be modified for a new record).

Use a database to hold the data (I have attached an MS Access database that you can use). The relationship window is shown below:

fldEmployeeId is automatically generated.

fldEmployeeSalary, fldSalesSales, and fldSalesPay are currency

fldSalesMonth and fldMonthNumber are short integers between 1 and 12 (you can also figure out the month if it is in a combobox by adding 1 to the selectedIndex property).

All other fields are strings.

The database has 3 employees, 2 sales reps (Adam Ant, Tom Thumb) and one boss (The Boss) already included.

You need a form that looks something like this:

The form should show the different employees and their pay for various months.

The summary button displays the following form:

Do as much of this as you can. Start with the ability to display the various employees, then add new employees, then develop the summary form.

Use the Visual Studio help to see how the various database related components work.

On the bindingNavigator (the object at the top of the main form), I have added a save button, I am also including the bitmap for that button in the project. (If you wish you can use regular buttons instead of the bindingNavigator tool, but then you need to handle the record change code yourself).

The following is the PayCalcDataSet designer view for the main form. Note that I have created multiple additional queries.

.

tblEmployees tblSales tblMonths fldEmployeeld fldMonthName fldMonthNumber fldSalesEmployee 9 fldsalesMonth fldEmployeeLastName fldEmployeeFirstName fldEmployeeSalary fldEmployeeType ldSalesSales fldSalesPay

Explanation / Answer

As you asked for your 2nd assignment here i'm explaining it.

public class EmployeePay { //Data members, data fields, or characteristics

private String employeeFirstName;
private String employeeLastName;
private double basePay;
private double sales; //constructor with four data members


//constructor with three data memebers
public EmployeePay(String first, String last, double salary, double commissionBase) {
employeeFirstName = first;
employeeLastName = last;
basePay = salary;
sales = commissionBase;
}

//constructor with three data memebers
public EmployeePay(String first, String last, double salary) {
employeeFirstName = first;
employeeLastName = last;
basePay = salary;
}


//default constructor
public EmployeePay(String first, String last) {
employeeFirstName = first;
employeeLastName = last;
}


public String getEmployeeFirstName() { return employeeFirstName; }
public void setEmployeeFirstName(String value) { employeeFirstName = value; }

public String getEmployeeLastName() { return employeeLastName; }
public void setEmployeeLastName(String value) { employeeLastName = value; }

public double getBasePay() { return basePay; }
public void setBasePay(double value) { basePay = value; }

public double getSales() { return sales; }
public void setSales(double value) { sales = value; }


public double calculateBasePay() { return basePay / 12; }
public double calculateGrossPay() { return basePay / 12 + calculateCommission(); }


public double calculateCommission()
{
final double TIER_ONE = 0.05; // commission rate for $10,000 -14999
final double TIER_ONE_MAX = 749.95; // maximun comssion at 5%
final double TIER_TWO = 0.1; // comission rate for $15,000 -$24,999
final double TIER_TWO_MAX = 2499.90; // maximum commission at 10%
final double TIER_THREE = 0.15; // comission rate for $25,000 -$49,999
final double TIER_THREE_MAX = 7499.85; // maximum commission at 15%
final double TIER_FOUR = 0.20; // comission rate for sale over $50,0000

if (sales < 9999) {
return 0;
}
else if ((sales > 10000) && (sales < 14999)) {
return sales * TIER_ONE;
}
else if ((sales > 15000) && (sales < 24999)) {
return (sales - 14999) * TIER_TWO + TIER_ONE_MAX;
}
else if ((sales > 25000) && (sales < 49999)) {
return (sales - 14999 - 24999) * TIER_THREE + TIER_ONE_MAX + TIER_TWO_MAX;
}
else {
return
(sales - 1499 - 24999 - 49999) * TIER_FOUR
+ TIER_ONE_MAX + TIER_TWO_MAX + TIER_THREE_MAX;
}
}

public String toString() {
return
employeeFirstName + " " + employeeLastName
+ " Base Salary:" + basePay + " Sales:" + sales
+ " Commission :" + Double.toString(calculateCommission())
+ " Gross Pay:" + Double.toString(calculateGrossPay());
}

public static void main(String[] args) {
System.out.println("Hi");
}

}

Note - Please revert me if you find any difficulties. I will be glad to explain it more.

If you found this answer helpful please thumbs Up !

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote