Question: This is a ruby programming assignment. please provide the copy of the output as well. The objective of this homework is to give you experience

This is a ruby programming assignment. please provide the copy of the output as well.

This is a ruby programming assignment. please provide the copy of the

The objective of this homework is to give you experience using inheritance with Ruby. You will refactor the software you generated for Homework 4 in C++ by implementing the same functions using Ruby. For this assignment you will use the base class Employee, which was implemented with the files Employee.h and Employee.cpp. Each employee object has a user id; a first and last name; a middle initial; and a department code (integer). Your implementation must now add two derived classes. The first one will be for a salaried employee, which will require a monthly salary variable. You will need member functions including a constructor, set and get salary functions, a salary calculation function, and a print function. For versatility, you might include a variable that specifies what fraction of time the person worked and use the fraction in the salary calculation. Your second class should represent an hourly worker. In this case you will need to store the hours worked and the hourly rate. You should also include provisions for overtime hours, which will be paid at 1.5 times the regular hourly rate. Include all of the class definitions and the test code in one ruby file. Your test code must instantiate at least two of each type of worker to test the classes for proper operation. I recommend a full-time and half-time salaried worker and two hourly worker test cases, one of which earns overtime. Execute your test program and copy the outputs to a text file to demonstrate proper execution. What to submit: Please submit a copy of your ruby source code file and a text file(s) that includes execution output that demonstrates proper operation. The objective of this homework is to give you experience using inheritance with Ruby. You will refactor the software you generated for Homework 4 in C++ by implementing the same functions using Ruby. For this assignment you will use the base class Employee, which was implemented with the files Employee.h and Employee.cpp. Each employee object has a user id; a first and last name; a middle initial; and a department code (integer). Your implementation must now add two derived classes. The first one will be for a salaried employee, which will require a monthly salary variable. You will need member functions including a constructor, set and get salary functions, a salary calculation function, and a print function. For versatility, you might include a variable that specifies what fraction of time the person worked and use the fraction in the salary calculation. Your second class should represent an hourly worker. In this case you will need to store the hours worked and the hourly rate. You should also include provisions for overtime hours, which will be paid at 1.5 times the regular hourly rate. Include all of the class definitions and the test code in one ruby file. Your test code must instantiate at least two of each type of worker to test the classes for proper operation. I recommend a full-time and half-time salaried worker and two hourly worker test cases, one of which earns overtime. Execute your test program and copy the outputs to a text file to demonstrate proper execution. What to submit: Please submit a copy of your ruby source code file and a text file(s) that includes execution output that demonstrates proper operation

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 Databases Questions!