Skip to content
MathsGenie logo
Open app

Course home

  1. GCSE
  2. Computer Science AQA
  3. Question bank

Programming concepts

EasyMediumHard
1234567891011121314151617181920212223
Question 17

Write a VB.Net program to check if a system has a sequence of four consecutive integers within its list of 120 recorded ID numbers.

When writing your program you should assume:

  • there is an array called readings that contains the 120 integer ID numbers
  • readings(0) contains the first value and readings(119) contains the last value
  • the values in readings are already stored in ascending numerical order
  • there is a Boolean variable called sequenceFound that has an initial value of False.

Your program should set sequenceFound to True if there is a valid run of four consecutive integers (for example: 45,46,47,4845, 46, 47, 4845,46,47,48).

You should use meaningful variable name(s) and VB.Net syntax in your answer.

[6]

Programming concepts Questions

  1. GCSE
  2. /Computer Science
  3. /Programming concepts