9.2 Algorithms (3)

Resources | Revision Questions | Computer Science

Login to see all questions

Click on a question to view the answer

1.

Convert the following pseudo-code into a flowchart. The pseudo-code calculates the sum of numbers from 1 to n, where n is provided by the user.

Pseudo-code:

  • Begin
  • Input n
  • Set sum to 0
  • For i = 1 to n do
  • sum = sum + i
  • End For
  • Display sum
  • End
2.

You are designing a database to store information about students in a university. The database needs to hold details such as student ID, name, course of study, and contact information. Explain how you would choose appropriate identifier names for the data fields in this database. Provide examples of both good and bad identifier names, justifying your choices. Then, create an identifier table to represent the key attributes of a student.

3.

Consider the problem of finding the largest number in an unsorted list of integers. Explain how an algorithm provides a solution to this problem. Describe the key characteristics of an algorithm that make it suitable for solving this type of problem.