Question: General Python Computer Science Questions Question 1 Write a program that completes the following pseudocode and comment the function appropriately. prompt a user for two
General Python Computer Science Questions
Question 1
Write a program that completes the following pseudocode and comment the function appropriately.
prompt a user for two integer inputs
invoke or call a function that returns the average of the two integers
output the average
Question 2
Rewrite the following statements using good coding practice to rename those variables that are highlighted.
n = {2, 4, 6, 8, 10, 12, 14, 16, , 100}
y = 0
for i = 0 to 49
x = n[i]*n[i]
y = y + x
Question 3: PLEASE PROVIDE PROPER INDENTATION
Properly format the following code such that the scope of each code block is properly indented.
#include
using namespace std;
void processArray(int nums[], int size){
for(int i = 0; i < size; i++){
if (i % 2 == 0)
cout << nums[i] << endl;
else
cout << "*****" << endl;
}
}
Question 4:
Document the following pseudo-code
numbersArray = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
sum = 0
size = length of numbersArray
for i = 0 to size-1
sum += numbersArray[i]
print(sum/size)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
