Task 1 Task 2 Task 3
Task 1 Task 2 Task 3
Random Name

Task 1

A computer program stores the ages of 10 students in an array data structure. All of the elements have a datatype of INTEGER.

Create a sample array of 10 values and give it an identifier of ages.

Calculate the avarage age of all of the values stored in the array and display the result.

Write this program.

Random Name

Task 2

A teacher keeps a list of 10 student names in an array data-structure. All of the elements' datatype is, of course, STRING.

Create a sample array of 10 student names and give it an identifier of students.

If the first name in the array is the same as the last name in the array, a message Data Entry Error! is displayed.

Write this program.

Random Name

Task 3

Take some time to think about this idea, using an array of REAL numbers:

heights ← [165.3, 167.2, 181.0, 176.2, 159.9]

numTall ← 0

FOR i ← [1,2,3,4,5]

IF heights[i] > 180.0 THEN

numTall ← numTall + 1

END IF

END FOR

OUTPUT "The number of tall people is ",numTall,"."

Can you figure out how this works?

Can you write this algorithm in Python?

algorithm: a set of defined steps to solve a problem