Answer:
the first argument listed after IF
Explanation:
The Logical... argument in an IF function formula is always the first argument listed after IF. And the second option is the value to be printed if the logical...argument is true, and if it is false then the value mentioned as third argument is assigned, or printed. And the logical...argument never comes before the IF function formula. Hence, the right option is the first argument.
Answer:
def average_strings(lst):
total_length = 0
avg = 0
for s in lst:
total_length += len(s)
avg = total_length/len(lst)
return avg
Explanation:
Create a function called average_strings that takes one parameter, lst
Initialize the total length and avg variables
Create a for loop that iterates through the lst. Get each string's length and put it to the total length
When the loop is done, calculate the average, divide total length by length of the lst
Return the average
Answer:
The power function can be written as a recursive function (using Java) as follows:
- static int power(int x, int n)
- {
- if(n == 0){
- return 1;
- }
- else {
- return power(x, n-1 ) * x;
- }
- }
Explanation:
A recursive function is a function that call itself during run time.
Based on the question, we know x to the 0th power is 1. Hence, we can just create a condition if n = 0, return 1 (Line 3 - 5).
Next, we implement the logic "x to the nth power can be obtained by multiplying x to the n-1'th power with x " from the question with the code: return power(x, n-1 ) * x in the else block. (Line 6 -8)
In Line 7, power() function will call itself recursively by passing x and n-1 as arguments. Please note the value of n will be reduced by one for every round of recursive call. This recursive call will stop when n = 0.
Just imagine if we call the function as follows:
int result = power(2, 3);
What happen will be as follows:
- run Line 7 -> return power(2, 2) * 2
- run Line 7 -> return power(2, 1) * 2
- run Line 7 -> return power(1, 0) * 2
- run Line 4 -> return 1 (Recursive call stop here)
Next, the return value from the inner most recursive call will be return to the previous call stack:
- power(1, 0) * 2 -> 1 * 2
- power(2, 1) * 2 -> 1 * 2 * 2
- power(2, 2) * 2 -> 1 * 2 * 2 * 2 - > 8 (final output)
Answer:
3. ReFS
Explanation:
Only in ReFS include and others do not have all of the below features
1. Automatic integrity checking and data scrubbing
2. Removal of the need for running chkdsk
3. Protection against data degradation
4. Built-in handling of hard disk drive failure and redundancy
5. Integration of RAID functionality
6. A switch to copy/allocate on write for data and metadata updates
7. Handling of very long paths and filenames
8. Storage virtualization and pooling