1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
yulyashka [42]
2 years ago
10

Given a member function named set_age() with a parameter named age in a class named Employee, what code would you use within the

function to set the value of the corresponding data member if the data member has the same name as the parameter
Computers and Technology
1 answer:
BaLLatris [955]2 years ago
6 0

Answer:

Explanation:

This would be considered a setter method. In most languages the parameter of the setter method is the same as the variable that we are passing the value to. Therefore, within the function you need to call the instance variable and make it equal to the parameter being passed. It seems that from the function name this is being written in python. Therefore, the following python code will show you an example of the Employee class and the set_age() method.

class Employee:

   age = 0

   

   def __init__(self):

       pass

   

   def set_age(self, age):

       self.age = age

As you can see in the above code the instance age variable is targeted using the self keyword in Python and is passed the parameter age to the instance variable.        

You might be interested in
4. What two important events occurred early in the formation of the universe?
Annette [7]
C. When they separated it created the big bang
4 0
3 years ago
What happens to formulas with relative cell references when they are copied using the fill handle?
Masteriza [31]
The correct answer is D
4 0
4 years ago
Examples of domain names and usernames<br><br><br><br>​
svp [43]

Answer:

examples are:

com or .edu is a top-level domain name (TLD)

cornell.edu is a second-level domain name (SLD)

bigred.cornell.edu is a third-level or three-part domain name

project.bigred.cornell.edu is a fourth-level or four-part domain name

hope this helps you.

4 0
3 years ago
A low concentration of market power has positive affects. A low concentration of market share has which of the following effects
lisov135 [29]
A or b i think hope it helps good luck and i hope it helps
6 0
3 years ago
The while loop and the do loop are equivalent in their expressive power; in other words, you can rewrite a while loop using a do
sleet_krkn [62]
I think False...

I hope this helps
8 0
2 years ago
Other questions:
  • The four functions of a computer are
    5·1 answer
  • . Hackers generally disguise their IP address. True False
    9·1 answer
  • Which statement about the Paste Link option is true? A)Even if the source file (spreadsheet) is deleted, the data updates automa
    11·1 answer
  • What is NOT a good habit when presenting to an audience?
    5·2 answers
  • WHAT IS A COMPUTER ????
    14·2 answers
  • The process of adding a header to the data inherited from the layer above is called what option below
    8·1 answer
  • It is not important to keep financial records since they can all be found online.
    5·2 answers
  • In the code segment below, assume that the int variable n has been properly declared and initialized. The code segment is intend
    5·1 answer
  • Question # 1
    12·2 answers
  • Do you guys answer questions about cyber security?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!