Question

C# visual studio This project tests your skills at building an Object-Oriented Programming project. The purpose...

C# visual studio This project tests your skills at building an Object-Oriented Programming project. The purpose is to calculate pay for various types of employees. Use your same file for your [Your Name] Review.cs that contains your 2D Shape classes.

Submit only your [Your Name] Review.cs file.

The classes will contain:

Employee

Abstract class with the following properties:

  • EmployeeId int
  • FirstName string
  • LastName string
  • Pay (abstract, read only) double

Sales

Concrete class inherits Employee. Contains the following properties:

  • Draw double
  • CommissionRate double
  • GrossSales double
  • Pay double. Calculated as CommissionRate * GrossSales. If that calculation is less than the Draw, then the Draw is used.

Salary

Concrete class inherits Employee. Salaried employees are paid a salary at a monthly rate. They are paid the same salary each pay period. They are paid twice a month so the pay is half of the monthly salary amount. They are sometimes paid a bonus in addition to their salary. Salary contains the following properties

  • MonthlySalaryAmount double
  • Bonus: double
  • Pay double: Salaried employees are paid twice / month. Calculated as half of Monthly Salary Amount + Bonus.

Hourly

Concrete class inherits Employee. Hourly employees are paid by the hour at an hourly rate. They are paid weekly. Any week where the Hourly employee works more than 40 hours earns overtime pay. Overtime pay is for the hours over 40 and is paid at 1.5 times the hourly rate. Hourly contains the following properties:

  • Hours: double
  • HourlyRate double
  • Pay (read only) double. Pay is the Hourly Rate * the number of hours up to 40. Overtime pay is paid at the rate of 1.5 * the Hourly Rate for all hours over 40 hours / week. Overtime pay is in addition to the pay for the first 40 hours / week.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

SOURCE CODE IN C#:

Employee.cs

abstract class Employee

{

public int EmployeeId;

public string FirstName,LastName;

public abstract double Pay();

}

Sales.cs

using System;

class Sales : Employee

{

public double Draw,CommissionRate,GrossSales;

public override double Pay()

{

return Math.Max(CommissionRate*GrossSales,Draw);

}

}

Salary.cs

class Salary : Employee

{

public double MonthlySalaryAmount,Bonus;

public override double Pay()

{

return (MonthlySalaryAmount/2)+Bonus;

}

}

Hour.cs

class Hour : Employee

{

public double Hours,HourlyRate;

public override double Pay()

{

if(Hours<=40)

return Hours*HourlyRate;

else

return (HourlyRate*40)+((Hours-40)*HourlyRate*1.5);

}

}

main,cs

using System;

class MainClass

{

public static void Main (string[] args)

{

//testing classes

Sales e1=new Sales();

e1.Draw=500;

e1.CommissionRate=9.99;

e1.GrossSales=100;

Console.WriteLine("Pay of Sales: {0:C}",e1.Pay());

Salary e2=new Salary();

e2.MonthlySalaryAmount=1000;

e2.Bonus=199.99;

Console.WriteLine("Pay of Salary: {0:C}",e2.Pay());

Hour e3=new Hour();

e3.Hours=50;

e3.HourlyRate=9.99;

Console.WriteLine("Pay of Hour: {0:C}",e3.Pay());

}

}

OUTPUT:

Add a comment
Know the answer?
Add Answer to:
C# visual studio This project tests your skills at building an Object-Oriented Programming project. The purpose...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Within c++ Create a simple Employee class with name, department, and title. Create an hourlyEmployee class...

    Within c++ Create a simple Employee class with name, department, and title. Create an hourlyEmployee class (which inherits from the Employee class) for a basic payroll program to compute the net pay salary of hourly based employees. Your program should also find the average net pay for a small company. To define the class, include the appropriate data members, member functions, constructors, and access modifiers. For simplicity, use a constant tax rate of 30% to compute the tax amount. Employees...

  • use java You are asked to create a record management system for a university. There are...

    use java You are asked to create a record management system for a university. There are two type of employees in a university: Salaried employee: they are salaried, and they are paid by monthly salary Waged employee: they are on wage and paid biweekly You are asked to implement three classes: Employee, SalariedEmployee and WagedEmployee. We have the following properties, and you need to identify these properties and associate them with appropriate classes. name: name of the employee ssn: ssn...

  • The purpose of this lab is to practice the concept of inheritance. We will create an...

    The purpose of this lab is to practice the concept of inheritance. We will create an Hourly class that is an Employee class. In other words, the Hourly class inherits from the Employee class. In addition, we will create a Salary class that inherits from the Employee class. Finally, we will make a Child class work as a Parent class. We will create a Manager class that inherits from the Salary class. Create a C++ project, and call it Week...

  • use visual studio, this is the step how to creat the project. creat new project in...

    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...

  • Visual C# C# Visual Studio 2017 You are to create a class object called “Employee” which included eight private variable...

    Visual C# C# Visual Studio 2017 You are to create a class object called “Employee” which included eight private variables - firstN - lastN - idNum -wage: holds how much the person makes per hour -weekHrsWkd: holds how many total hours the person worked each week. - regHrsAmt: initialize to a fixed amount of 40 using constructor. - regPay - otPay After going over the regular hours, the employee gets 1.5x the wage for each additional hour worked. Methods: -...

  • ASAP Please. Python Program Description Create an object-oriented program that allows you to enter data for...

    ASAP Please. Python Program Description Create an object-oriented program that allows you to enter data for employees. Specifications Create an abstract Employee class that provides private attributes for the first name, last name, email address, and social security number. This class should provide functions that set and return the employee’s first name, last name, email address, and social security number. This class has a function: get_net_income which returns 0. Create a Manager class that inherits the Employee class. This class...

  • PROBLEM 2 Elder is paid a monthly salary of $2,250. Overtime is paid for hours beyond...

    PROBLEM 2 Elder is paid a monthly salary of $2,250. Overtime is paid for hours beyond 40 in each workweek. One week, Elder works 7 hours overtime. Elder’s gross pay for the week is PROBLEM 3 Ides receives 16 cents for every unit produced. Ides produces 2,976 pieces in a 43-hour workweek. For overtime, Ides is paid a sum equal to one-half the regular hourly pay rate multiplied by the number of overtime hours. Ides’ total piecework and overtime earnings...

  • Logic Exercise 40 Points This exercise tests your ability to understand logic in the form of...

    Logic Exercise 40 Points This exercise tests your ability to understand logic in the form of IF Statements. You will be given the rules and the data that will follow the logic. At the end of the explanation, a series of questions will be asked. Place your answers in the area provided. Program explanation - You are provided with pseudocode that calculates the total amount of money to pay an employee after working for 1 week. The amount of money...

  • Add an HourlyPlusCommissionEmployee class to the PayrollSystem app by subclassing an existing class. A HourlyPlusCommissionEmployee is...

    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...

  • Continuing Payroll Problem, 2B: Chapter 2 Olney Company, Inc. is a small manufacturing firm located in...

    Continuing Payroll Problem, 2B: Chapter 2 Olney Company, Inc. is a small manufacturing firm located in Newtown, Pennsylvania. The company has a workforce of both hourly and salaried employees. Each employee is paid for hours actually worked during each week, with the time worked being recorded in quarter-hour increments. The standard workweek consists of 40 hours, with all employees being paid time and one-half for any hours worked beyond the 40 regular hours. Wages are paid every Friday, with one...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT