0% found this document useful (0 votes)
63 views

Assignment 1213123

This document provides instructions for an assignment to create a .NET console application in C# to manage employee wage calculation. The app should allow adding, editing, deleting, viewing and searching employees stored in memory. It describes creating an abstract Employee class with subclasses for different employee types, and using properties and inheritance to calculate earnings. The app menu should run continuously and handle invalid inputs without crashing.

Uploaded by

gtguide101
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

Assignment 1213123

This document provides instructions for an assignment to create a .NET console application in C# to manage employee wage calculation. The app should allow adding, editing, deleting, viewing and searching employees stored in memory. It describes creating an abstract Employee class with subclasses for different employee types, and using properties and inheritance to calculate earnings. The app menu should run continuously and handle invalid inputs without crashing.

Uploaded by

gtguide101
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Assignment – 1

PROG32356 – .NET Technologies using C#


Instructor: Gursharan Singh Tatla
Email: [email protected]

Note:
1. Assignment must be completed as an individual effort. Do not collaborate with anyone or
share it with any individual, party or entity.
2. Due date for submission is specified in SLATE.
3. All online submissions will be done via SLATE (Email submissions will NOT be accepted).
4. Late assignments will be penalized 10% each day for up to 3 days. After that, it is worth 0.
5. Corrupt/incorrect submissions will be graded as zero.
6. Please refer to the Academic Integrity Policy.
7. Refer to the School of Applied Computing's Academic Procedures for Evaluations for more
details regarding missed work: Procedures for Evaluations.
8. If you take code-snippets from somewhere such as StackOverflow, make sure to provide
references to the webpages as comments wherever the code is used.

Copyright Disclaimer:
The materials provided in class and in SLATE are protected by copyright. They are intended for
the personal, educational uses of students in this course and should not be shared externally
or on websites such as Chegg, Course Hero or OneClass. Unauthorized distribution may result
in copyright infringement and violation of Sheridan policies.
Gursharan Singh Tatla (Winter 2022)
Instructions:
1. Make a .NET Console App using C# in Visual Studio and name it as A1YourFirstnameLastname.
2. Implement the wage calculator for employees which is capable of doing the following:
• Add, edit, and delete employees.
• View and search employees.
3. The application must be menu-based app:
1 - Add Employee
2 - Edit Employee
3 - Delete Employee
4 - View Employees
5 - Search Employee
6 - Exit
4. When selecting Add, Edit or Delete Employee option from the above menu, display a
sub-menu which asks which type of employee is being added, edited, or deleted.
5. For example, if user selects 1 - Add Employee, then display the following sub-menu:
1 - Add Hourly Employee
2 - Add Commission Employee
3 - Add Salaried Employee
4 - Add Salary Plus Commission Employee
5 - Back to Main Menu

Page 1 of 5
6. The menu should run continuously until the user quits the application.
• Validate the inputs. Any invalid input should not crash the app.
• Display user-friendly messages wherever necessary.
• Always display the employee info in a tabular form.
• Always display column headers when displaying employee info.
• Format the numeric values with appropriate symbols, such as currency amount with $
symbol, commission rate with % symbol.

7. NOTE: At no point should the application save any information to disk. All information is
stored and managed in memory using a generic collection. The use of collections and the
object-oriented design of the solution are an important part of the evaluation of your
submission.
Gursharan Singh Tatla (Winter 2022)
8. Add Employee:
• When adding a new employee, ask the user for all the required info and then save it
to the collection.
• Then display a success message and print all the employees from that type of
employee category in a tabular form to verify that the new employee is added.
• NOTE: When adding a new employee, do not ask for Employee ID, rather generate a
new one. The Employee ID must be unique for every employee, just like a primary key
in database.

9. Edit Employee:
• When editing an employee info, first display a list of all employees from the selected
category.
• Then ask the user for the Employee ID of the employee that user wants to edit and
fetch that employee from the collection.
• And ask the user for all the required info and then display a success message.
• Print all the employees from that category in a tabular form to verify that the
employee is edited.
• NOTE: Do not ask the user to edit the Employee ID. It must be unique for every
employee and must not be edited.
Gursharan Singh Tatla (Winter 2022)
10. Delete Employee:
• When deleting an employee info, first display a list of all employees from the selected
category.
• Then ask the user for the Employee ID of the employee that user wants to delete and
fetch that employee from the collection.
• And remove the employee from the collection and then display a success message.
• Print all the employees from that category in a tabular form to verify that the
employee is deleted.

Page 2 of 5
11. View Employees:
• Display all the employees in a tabular form.
• Display column headers.
• Format currency and percentage amounts with appropriate symbols.
• Categorize the employees based on their employment type.
o Check the sample output video to get an idea.

12. Search Employees:


• Ask the user to enter the employee’s name and display all the employees that match
the search keyword.
• Partial match must fetch the results.
• Match should be case-insensitive, meaning if user enters lowercase “john” and the
employee’s name is “John” (with uppercase J), it must fetch the employee.
Gursharan Singh Tatla (Winter 2022)
13. The employees belong to four different categories: hourly, commission based, fixed weekly
salary, and fixed weekly salary plus commission based.

14. Create an employee class Employee which must be declared as abstract.


15. Then derive three child classes from the Employee class:
• HourlyEmployee
• CommissionEmployee
• SalariedEmployee
16. Inherit the SalaryPlusCommissionEmployee from the CommissionEmployee class.
17. Use enum to represent different types of employees. If you ever need to find what type of
employee it is, do not compare it with string, rather make use of enum.
• Do:
if (employeeType == EmployeeType.HourlyEmployee)
Where, EmployeeType is declared as an enum.
• Don’t:
if (employeeType == "HourlyEmployee")
Gursharan Singh Tatla (Winter 2022)
18. The parent class Employee has fields which are common to all employees, such as:
EmployeeType, EmployeeId, EmployeeName
19. The parent class Employee also declares an abstract property GrossEarnings, which will
be overridden in the derived classes.
• GrossEarnings property must only have get accessor.
• It only returns the gross earnings. There is no point setting the value for this property.
20. A property Tax (with only get accessor), that calculates and returns the 20% tax.
21. A property NetEarnings (with only get accessor), that returns the net earnings after tax
deductions.

Page 3 of 5
22. Class HourlyEmployee inherits from Employee:
• This class stores hours worked and hourly wage.
• Implements the GrossEarnings property that returns the earnings of this employee,
considering any overtime at the rate of 1.5.
Gross Earnings:
if hours <= 40 then wage * hours
if hours > 40 then 40 * wage + (hours - 40) * wage * 1.5

23. Class CommissionEmployee inherits from Employee:


• This class stores the gross sales and commission rate.
• Implements the GrossEarnings property that returns the earnings of this employee.
Gross Earnings = gross sales * commission rate
Gursharan Singh Tatla (Winter 2022)
24. Class SalariedEmployee inherits from Employee:
• This class stores the fixed weekly salary.
• Implements the GrossEarnings property that returns the earnings of this employee.
Gross Earnings = fixed weekly salary

25. Class SalaryPlusCommissionEmployee inherits from CommissionEmployee:


• This class stores the fixed weekly salary.
• Implements the GrossEarnings property that returns the earnings of this employee.
Gross Earnings = weekly salary + gross sales * commission rate

26. Use your Java and object-oriented programming knowledge to create this hierarchy.
• NOTE: Use C# properties to get/set the fields. Do not use getter/setter methods like you
would do in Java.
• You will get higher grades if:
i. Proper use of inheritance.
ii. User-Interface is user-friendly.
iii. App menu runs smoothly without crashing.
• Otherwise, there will be grade deductions.
Gursharan Singh Tatla (Winter 2022)
27. In the Program.cs file, create and maintain a generic collection of all employees.
• The generic collection must be of type parent class Employee and it must store objects
of derived classes.
• Populate this collection with some sample data when the program runs.

Marks Breakdown:
• 10% for correct submission.
• 10% for console menu system.
• 10% for user-friendly and tabular outputs.
• 30% for classes and inheritance.
• 20% for implementing all the operations.
• 20% for overall working of the application.

Page 4 of 5
Submission:
1. Once done, ZIP the entire project folder and upload it to Assignments on SLATE.
a. Double-check your submission by downloading it and running it.
2. You are to submit .ZIP and .TXT files, separately:
a. Upload the .ZIP file of your assignment to SLATE.
b. Upload the .TXT files to SLATE.
3. You must copy and paste all of your source code from your C# files into plain text files.
a. You can copy and paste the source code into Notepad.
b. Create a separate .TXT file for each source code file.
4. You do not have to format this code - it's used by TurnItIn (the originality checker in SLATE,
which is a piece of software that checks your submission for plagiarism against other
submissions in the college, in other colleges, from the web, and various other sources).
5. Submit this document in addition to your assignment ZIP file.
a. DO NOT add it inside your zip/rar file - it must be a separate file.
b. This is used for TurnItIn (it won't examine the contents of zip/rar files).
Gursharan Singh Tatla (Winter 2022)
Reference:
• I’ve used NuGet package ConsoleTables to print the output in the tabular form.
• Link: https://github.com/khalidabuhakmeh/ConsoleTables

Sample Output:
• Check out this video to see the sample output of this application:
https://www.loom.com/share/dc0f4b0b292942628e058706c9c3f43e

Page 5 of 5

You might also like