Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Part I:

Define a class Employee where one object of class Employee represents one Employee. Each Employee object will have:

  • instance variable for first name
  • instance variable for last name
  • instance variable for social security number
  • instance variable for salary
  • __init__() instance method as the initializer/constructor, with a parameter for the initial value of each instance variable
  • __str__() instance method to return the object's data in a string
  • giveRaise() instance method that takes a float"percentRaise" as parameter and doesn't return anything. When you call this method and send it a "percentRaise", this method adds "percentRaise" percent of the current salary to the salary instance variable of the object that calls it, thus giving that Employee a raise in salary.

Test each method one at a time. Make sure that all variables and methods work as expected before proceeding.

Part II:

Define a second class named "Manager" that is a subclass of class Employee with 2 additional instance variables and two additional methods:

  • instance variable for the title of the manager
  • instance variable for the dollar amount of annual bonus
  • __init__() instance method as the constructor,with a parameter for the initial value of each instance variable
  • __str__() instance method to return the object's data in a string

Do not define a method called giveRaise() in class Manager. Instead, test that you can call giveRaise() on objects of class Manager because it is a subclass of class Employee.

Part III:

Create a Python list and add Employee objects and Manager objects to the same list. Use a loop to give a raise() to every object in the list.

NOTES:

  • Create a third file that contains the test program. Your test program contains enough lines to prove that every method works on both types of objects. If your test program becomes too long, split it up into separate methods that your test program can call when it is testing different features of the two classes.
  • Make sure that you use mnemonic variable names
  • You only need to define the method giveRaise() on the superclass Employee because it will work exactly the same way on objects of both classes. This is because ManagersareEmployees, so Manager objects can call Employee methods. Thoroughly test that the one giveRaise() method that you defined in class Employee works on both types of Objects: Employees and Managers.
  • In order to earn the most points, make one final code review to make sure you have followed all program guidelines.
  • Submit three files, employee.py, manager.py and whatever file you have your test program in.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92524952
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Computer Engineering

The following conversation has some mistakes can u help me

The following conversation has some mistakes, can u help me point them out? what are the mistakes? Mark: Hi, David, my company does not use much computer technology and I would like to change that. But I have a few quest ...

Taylor found that 8 of the recipients of loans form a

Taylor found that 8% of the recipients of loans form a particular mortgage lender default within 3 years. If he takes a random sample of 736 customers who received loans 3 years ago, what is the average number of custome ...

1 explain how the following industries should adapt

1. Explain how the following industries should adapt their businesses to the ever expanding use of social networks and mobile computing (smart phones, tablet computers, etc.): 1) Media and Entertainment, 2) Department st ...

Should we be renegotiating nafta yes or no if it is

Should we be renegotiating NAFTA? yes or no? If it is renegotiated, should it be replaced? What reasons would make it better in your point of view? What is the best argument you can make why NAFTA should or should not be ...

Taylor found that 8 of the recipients of loans form a

Taylor found that 8% of the recipients of loans form a particular mortgage lender default within 3 years. If he takes a random sample of 736 customers who received loans 3 years ago, what is the average number of custome ...

Take the case in which all individuals are risk averse so

Take the case in which all individuals are risk averse, so that marginal costs slope down. In that case, why might it be optimal (socially efficient) for insurance take up to be less than 100%?

If the real interest rate is -15 per annum and the infla-

If the real interest rate is -1.5% per annum and the infla- tion rate is 3% per annum, then what is the present value of a $1,000,000 nominal payment next year?

Need help with a java program that takes two arrays a and b

Need help with a Java program that takes two arrays a and b of length 5 storing int values, and returns the dot product of a and b. That is, it returns an array c of length n such that c[i]=a[i]*b[i].

Fifteen batteries are tested to determine whether the

Fifteen batteries are tested to determine whether the battery life is as long as advertised. Four batteries fail the test. From all fifteen batteries, two are selected at random without replacement. Find the probability ...

Systems analysis project personal trainer inc owns and

Systems analysis project Personal Trainer, Inc. owns and operates fitness centers in a dozen Midwestern cities. The centers have done well, and the company is planning an international expansion by opening a new "superce ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As