24Hard
0/6

Write a VB.Net program to check if a marine temperature logging system has a sequence of five consecutive integer degree Celsius readings (increasing by exactly 1 degree each time) within its list of 150 recorded measurements.

When writing your program you should assume:

  • there is an array called tempLogs that contains the 150 integer temperature measurements
  • tempLogs(0) contains the first value and tempLogs(149) contains the last value
  • the values in tempLogs are already stored in ascending numerical order
  • there is a Boolean variable called streakDetected that has an initial value of False.

Your program should set streakDetected to True if there is a valid run of five consecutive integers (for example: 12, 13, 14, 15, 16).

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

[6]

Programming concepts Questions

Practise AQA GCSE Computer Science Programming concepts with exam-style questions for GCSE Computer Science. 100 questions, matched to the AQA GCSE Computer Science (8525) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.

PreviousNext

Programming concepts Questions

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