11.2 Constructs (3)

Resources | Revision Questions | Computer Science

Login to see all questions

Click on a question to view the answer

1.

Write pseudo-code for a 'CASE' structure that determines a student's letter grade based on their percentage score. The grading criteria are as follows:

  • 90% or above: A
  • 80% - 89%: B
  • 70% - 79%: C
  • 60% - 69%: D
  • Below 60%: F
2.

Write pseudo-code for a 'pre-condition' loop that repeatedly prompts the user for positive integer input until a number greater than 10 is entered. The loop should include input validation to ensure the user enters a valid integer.

3.

Consider a scenario where you need to process a list of numbers. Write pseudo-code for a 'pre-condition' loop that iterates through the list, adding each number to a running total, but only if the number is positive. Assume the list is stored in an array called numbers and the running total is stored in a variable called total, initialized to 0.