Question: Use C# to write the program. An employee has a name, a payrate, and an hoursWorked. The pay amount can be calculated by multiplying payrate

Use C# to write the program. An employee has a name, a payrate, and an hoursWorked. The pay amount can be calculated by multiplying payrate and hoursWorked. Create a called called Employee with three fields (name, payrate, and hoursWorked). The data type for the name should be string. The data type for payrate and hoursWorked should be double. The class should hve a method called GetPayAmount that returns pay amount. The return data type must be double. The class should also include properties, constructor(s), and ToString method. The ToString method must display employee name and pay amount. The amount must be currency formatted. Make sure you use properties instead of fields in a method. The class must be in its own cs file. Then, inside the Main method of the program class, demonstrate the Employee class by instantiating two employee objects with made up data. One of the employees must be you. Next print both employees.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!