Building expected results for batch tests

An engineering laboratory is developing an algorithm that summarizes a batch of temperature readings. Its specification requires it to:

  • Accept readings from −10 to 50 °C, inclusive, and ignore readings outside that interval.
  • Report the arithmetic mean of the accepted readings when at least one reading is accepted.
  • Report the words no data when no readings are accepted.

Complete the expected results below to create tests for the algorithm. Enter exact integers for accepted counts and means in °C. Enter no data when required. Start each batch with a fresh count and total.

TestReadings (°C)Accepted countMean (°C) or message
A12, 24, 60
B-10, 50
C-11, 51
D0

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Algorithm Development Questions: