Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please comment out the code. 1. We learned how to build the first class Students in our class. Using it as an example, create another

Please comment out the code.

image text in transcribed

1. We learned how to build the first class "Students" in our class. Using it as an example, create another class named "Company" containing 5 variables: fname, Iname, pay, raise rate, num of employees and 2 class methods: fullname(), apply raise(). a. Try to create this class using all the above variables and methods. Set the default raise rate to 1.04. b. Create one instance "John Smith" with salary $50000 and the default raise rate, and another instance "Bruce Lee" with salary $60000 and new raise rate to 1.10. c. Create two new methods called display old() to print out the old salary, and another method called display new() to print out the new salary. Apply the apply raise() method respectively to both instances to calculate salaries. d. Result should be: The former salary for John Smith is 50000 The new salary for John Smith is 52000 The former salary for Bruce Lee is 60000 The new salary for Bruce Lee is 66000 e. Answer the Question in comment: can you combine these two methods display old() and display new() to only one method display() to print out the same result? If so, rewrite your code; if not, give the reasons

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions

Question

Q.1. Taxonomic classification of peafowl, Tiger and cow ?

Answered: 1 week ago

Question

Q .1. Different ways of testing the present adulterants ?

Answered: 1 week ago

Question

Q.1. Health issues caused by adulteration data ?

Answered: 1 week ago