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
_____ create computer programs by using their knowledge of computer science, math, and other disciplines.
zimovet [89]
B.) Software designers
5 0
3 years ago
A normal HDMI signal has a colour depth of 8 bits per each of RGB colour. The maximum number
Marysya12 [62]

Answer: B

Explanation:

if each color can be represented as 8 bits and you have 3 colors total that would mean you would need 24 bits to represent the entirety of the RGB spectrum. And each bit can either be on or off so you have two choices for each one. So the total amount of colors you can have for 8bit RGB would be 2^{24} which is 16,777,216.

6 0
3 years ago
Write an expression that prints 'You must be rich!' if the variables young and famous are both True.
Rufina [12.5K]

Answer:

Following are the expression to this question:

if (young and famous==True):

Explanation:

For print, the given expression the code requires some modification that can be defined as follows:

young = True#defining a bool variable that holds a value True

famous = True#defining a bool variable that holds a value True

if (young and famous==True):#defining if block that check variable value

   print('You must be rich!')#print message

else:#else block  

   print('There is always the lottery...')#print message

Output:

You must be rich!

Code explanation:

In the above-given code, two variable "young and famous" is declared, that hold a "True" which is a bool value, in this code, a conditional statement has used, that checks variable value, which can be defined as follows:

  • In the if block, it uses the above declared variable with and gate to check its value is equal to true.
  • If the condition is true, it will print the true block message, otherwise, go to the else block in this, it will print the else block message.
4 0
2 years ago
Disadvantages of Batch<br>operation system​
jok3333 [9.3K]

Answer:

Disadvantages of Batch Operating System:

  1. The computer operators should be well known with batch systems.
  2. Batch systems are hard to debug.
  3. It is sometime costly.
  4. The other jobs will have to wait for an unknown time if any job fails.
8 0
3 years ago
Edhesive unit 4 test
sergij07 [2.7K]

Answer:

padna jana ta yarrr kasto this yarr

8 0
2 years ago
Other questions:
  • Design a data structure to support the following two operations for a set S of inte- gers, which allows duplicate values: • INSE
    15·1 answer
  • Which is an example of correct HTML?
    10·1 answer
  • William found out that someone used his report on American culture without his permission. What is William a victim of? A. plagi
    7·2 answers
  • ____________ hackers break into systems legally for non-malicious reasons such as to test system security vulnerabilities
    7·2 answers
  • Select the antonym for given word freedom
    7·2 answers
  • Which of the following is the Boolean logical operator for OR in C#?
    12·2 answers
  • 16 to 19 year old drivers are how many more times likely to crash? 1.7,2.7,0.7 ,3.7
    12·2 answers
  • Travis just got promoted to network administrator after the previous administrator left rather abruptly. There are three new hir
    14·1 answer
  • Can I get the code for the Edhesive Assignment 3 Chatbox in python? Thanks.
    15·1 answer
  • Write a pseudocode that receives a positive number from the user, and then,
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!