Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ********HourlyEmployee.cs********
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ARTPLibrary
- {
- public class HourlyEmployee: Employee
- {
- //fields
- //none b/c automatic properties
- //properties
- public decimal HoursWorked { get; set; }
- public decimal HourlyWage { get; set; }
- //ctors
- public HourlyEmployee(int id, string fName, string lName, DateTime dob, string jobTitle, DateTime hireDate, decimal hoursWorked, decimal hourlyWage, bool isDirectDeposit): base (id, fName, lName, dob, jobTitle, hireDate, isDirectDeposit)
- {
- HoursWorked = hoursWorked;
- HourlyWage = hourlyWage;
- }
- //methods
- //ToString()
- public override string ToString()
- {
- return $"{base.ToString()}\nHours Worked: {HoursWorked:f2}\nHourly Wage: {HourlyWage:c}";
- }
- }
- }
- ********Program.cs********
- HourlyEmployee he = new HourlyEmployee(456, "James", "Smith", new DateTime(1985, 06, 05), "Janitor", new DateTime(2020, 03, 30), 38.7m, 12.25m, false);
- Console.WriteLine("\nCreate and output an Hourly Employee object.\n" + he);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement