Arrays (3)

Resources | Revision Questions | Computer Science

Login to see all questions

Click on a question to view the answer

1.

Consider a program that needs to store the names of 5 friends. Write pseudocode to demonstrate how you would use an array to store these names. Include how you would access the name of the second friend in the array.

2.

Consider an array of student marks in a class. The marks are stored in an array called marks. Write a program (in a language of your choice) that uses a for loop to find the highest mark in the array and display it. Assume the array has at least one element.

3.

Describe what an array is and explain why arrays are useful for storing multiple values of the same data type in a computer program. Give an example of a scenario where using an array would be more efficient than using multiple individual variables.