Use Visual Studio for the following:
Add an HourlyPlusCommissionEmployee class to the PayrollSystem app by subclassing an existing class. A HourlyPlusCommissionEmployee is a kind of CommissionEmployee with the following differences and specifications:
HourlyPlusCommissionEmployee earns money based on 2 separate calculations:
CommisionEmployee
public class CommissionEmployee : Employee
{
private decimal gS;
private decimal cR;
public CommissionEmployee( string fst, string lst, string
ssn,decimal sls, decimal rt ) : base( fst, lst, ssn )
{
SalesOfGross = sls;
RateOfCommision = rt;
}
public decimal RateOfCommision
{
get
{
return cR;
}
set
{
cR = ( value > 0 && value < 1 ) ?
value : 0;
}
}
public decimal SalesOfGross
{
get
{
return gS;
}
set
{
gS = ( value >= 0 ) ? value : 0;
}
}
public override decimal Earnings()
{
return RateOfCommision * SalesOfGross;
}
public override string ToString()
{
return string.Format( "{ 0 }: { 1 } { 2 }: { 3 : C } {
4 }: { 5 : F2 }", "commission employee", base.ToString(), "gS",
SalesOfGross, "cR", RateOfCommision );
}
}
HourlyEmployee
public class HourlyEmployee : Employee{
private decimal payment;
private decimal time;
public HourlyEmployee( string fst, string lst, string ssn,decimal
WagePerHour, decimal TotalWorkedHours ): base( fst, lst, ssn
)
{
payment = WagePerHour;
time = TotalWorkedHours;
}
public decimal payment
{
get
{
return payment;
}
set
{
payment = ( value >= 0 ) ? value : 0;
}
}
public decimal time
{
get
{
return time;
}
set
{
time = ( ( value >= 0 ) && ( value <= 168 ) ) ?
value : 0;
}
}
public override decimal Earnings()
{
if ( time <= 40 )
return payment * time;
else
return ( 40 * payment ) + ( ( time - 40 ) * payment *
1.5M );
}
public override string ToString() {
return string.Format("hourly employee: {0} {1}: {2:C}; {3}:
{4:F2}", base.ToString(), "WagePerHour", payment,
"TotalWorkedHours", time );
}
}
Use Visual Studio for the following: Add an HourlyPlusCommissionEmployee class to the PayrollSystem app by subclassing...
Add an HourlyPlusCommissionEmployee class to the PayrollSystem app by subclassing an existing class. A HourlyPlusCommissionEmployee is a kind of CommissionEmployee with the following differences and specifications: HourlyPlusCommissionEmployee earns money based on 2 separate calculations: commissions are calculated by the CommissionEmployee base class hourly pay is calculated exactly the same as the HourlyEmployee class, but this is not inherited, it must be duplicated in the added class BasePlusCommissionEmployee inherits from CommissionEmployee and includes (duplicates) the details of SalariedEmployee. Use this as...
Please write below code in C++ using Visual Studio. Write program that uses a class template to create a set of items. The program should: 1. add items to the set (there shouldn't be any duplicates) • Example: if your codes is adding three integers, 10, 5, 10, then your program will add only two values 10 and 5 • Hint: Use vectors and vector functions to store the set of items 2. Get the number of items in the...
help please Perform the following steps: a) Using NetBeans, Create a New Java Application Project with Project Name BasePlusCommission Employee Test with Create Main Class check box selected. Create comments to form a descriptive header that has the course name, your name, the assignment title, and a pledge that you have neither received nor provided help to any person. Assignments submitted without this pledge will not be graded. When you have completed the steps (b) and (c) below, you will...
In the processLineOfData, write the code to handle case "H" of the switch statement such that: An HourlyEmployee object is created using the firstName, lastName, rate, and hours local variables. Notice that rate and hours need to be converted from String to double. You may use parseDouble method of the Double class as follows: Double.parseDouble(rate) Call the parsePaychecks method in this class passing the HourlyEmployee object created in the previous step and the checks variable. Call the findDepartment method...
// Write the compiler used: Visual studio // READ BEFORE YOU START: // You are given a partially completed program that creates a list of patients, like patients' record. // Each record has this information: patient's name, doctor's name, critical level of patient, room number. // The struct 'patientRecord' holds information of one patient. Critical level is enum type. // An array of structs called 'list' is made to hold the list of patients. // To begin, you should trace...
use visual studio, this is the step how to creat the project. creat new project in the next page make sure to select visual C++ then empty project on the next dialog box. after you create new project click on add new item and then select C++ source file (cpp file) and click add. after you finish, make sure you send me the run file ( result) as well Write a program that calculates and prints the amount of wages...
For this assignment, you will use your knowledge of arrays and ArrayLists to write a Java program that will input a file of sentences and output a report showing the tokens and shingles (defined below) for each sentence. Templates are provided below for implementing the program as two separate files: a test driver class containing the main() method, and a sentence utilities class that computes the tokens and shingles, and reports their values. The test driver template already implements accepting...
Take the class Person. class Person: """Person class""" def __init__(self, lname, fname, addy=''): self._last_name = lname self._first_name = fname self._address = addy def display(self): return self._last_name + ", " + self._first_name + ":" + self._address Implement derived class Student In the constructor Add attribute major, default value 'Computer Science' Add attribute gpa, default value '0.0' Add attribute student_id, not optional Consider all private Override method display() Test your code with the following driver: # Driver my_student = Student(900111111, 'Song', 'River')...