Answer:
a. Partly True
b. True
Explanation:
(a) "new" keyword or syntax is used for the constructors while working in Perl and Moose object system for Perl.
For Visual Basics .Net, keyword "New" is used
For Python, "___new___" is used which allocates memory for instance and receives class as an argument.
For Objective-C, "alloc" and "init" are used for constructor method. "alloc" allocates memory for the instance and "init" handles the bulk of initializing the instance. Whereas, the "new" keyword calls both "alloc" and "init" for class instance.
(b) A constructor does not return any value because it is called by the memory allocation and object initialization code in the runtime and not directly by your code.
Answer:
Following are the program in python language
def prob3_6(k): #function definition
c = 0 #variable declaration
while k != 1: #iterating the while loop
print(k) #print k
if k % 2 == 0:#check if condition
k= k // 2 #divisible by 2
else: #else condition
k = k * 3 + 1
c = c + 1
print(k) #print k
print c #print count
prob3_6(3)#function call
Output:
3
10
5
16
8
4
2
1
7
Explanation:
Following are the description of program
- Create a function "prob3_6" in this function we passing an integer parameter of type "int" named "k".
- Inside that function we declared a variable "c" of type "int" that is used for counting purpose .
- After that we iterated the while for print the value of when it is not equal to 1 .
- We check if condition when k gives 0 on modulus then k is divisible by 2 otherwise else block will be executed in the else part we multiply by 3 to k and add 1 to the k variable .
- Finally print "k" and "c"
Most likely not but I think you’ll have to log in your account like if you have an Apple phone . You’ll have to log into your Apple ID
office 2013 can intergrute directly with the cloud