Answer:
Following are the code to this question:
code:
=IF(EXACT(I2,"Yes"),"Elected",IF(EXACT(K2,"Yes"),"Yes","No"))
Explanation:
In the given the data is not defined so we explain only the above code, but before that, we briefly define working of if the function that can be defined as follows:
-
The If() function, is used only when one of the logical functions and its value must return the value true. or we can say it only return a true value.
- In the above function, a column "Elected" is used that uses other column values to check this column value is equal if this condition is true it will return "yes" value.
Answer:
Given
The above lines of code
Required
Rearrange.
The code is re-arrange d as follows;.
#include<iostream>
int main()
{
int userNum;
scanf("%d", &userNum);
if (userNum > 0)
{
printf("Positive.\n");
}
else
{
printf("Non-positive, converting to 1.\n");
userNum = 1;
printf("Final: %d\n", userNum);
}
return 0;
}
When rearranging lines of codes. one has to be mindful of the programming language, the syntax of the language and control structures in the code;
One should take note of the variable declarations and usage
See attachment for .cpp file
Below is the function that takes two parallel lists;
List of times in increasing order and that of distance travelled by that point in time.
I put into consideration the instructions given in the question.
ANSWER;
def find_velocity(time, distance):
velocities = []
for i in range(1, len(time)):
velocities.append((distance[i] - distance[i - 1]) / (time[i] - time[i - 1]))
return velocities
times are = [1, 3, 5, 7]
distances are = [25, 29, 35, 70]
print(find_velocity(times, distances))
The answer is spreadsheet. I just did this lesson and I got all of the answers right so I know it's correct.