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.
Answer:
1. Both Steve Jobs and Steve Wozniak raised $1000 by selling personal items, so that they could start Apple.
2. Steve Wozniak worked for Hewlett Packard designing calculators before starting Apple.
4. Steve Jobs never learned to code and primarily focused on design.
Explanation:
I just took the test.
Answer:
The solution code is written in Python 3
- firstStr = input("Enter first string: ")
- secondStr = input("Enter second string: ")
-
- if(firstStr < secondStr):
- print("The first string comes first alphabetically.")
- elif(firstStr > secondStr):
- print("The second string comes first alphabetically.")
- else:
- print("The first and second string are same")
Explanation:
Firstly, prompt the user to input two strings (Line 1 - 2).
Next create if else if statement to check if the firstStr is less than, greater than or equal to the secondStr and then print the appropriate message accordingly (Line 4- 9). For example, the program display message "The first string comes first alphabetically." if it find the firstStr is less than secondStr.
Answer:
Throughput of X, Y, Z will be 0.081
The network throughput will be 0.243
Explanation:
Throughput of X will be Tx = Px*(1-Py)*(1-Pz)=0.1*0.9*0.9=0.081
Throughput for Y and Z can be calculated in same way.
Throughput of network = Tx+Ty+Tz=0.081+0.081+0.081=0.243