Robust and secure programming

EasyMediumHard
123456789101112131415161718
Question 6
Easy

Complete the test plan below for the Python code shown in Figure 1.

Figure 1

valid_temp = False
while valid_temp == False:
    temp = int(input("Enter storage temperature in Celsius (2 - 8): "))
    if temp >= 2 and temp <= 8:
        valid_temp = True
    else:
        print("Error: Temperature out of safe limits")
print("Temperature accepted")
Test typeTest dataExpected result
Normal data5"Temperature accepted" message printed
Invalid data
Boundary data
[2]

Robust and secure programming Questions

  1. GCSE
  2. /Computer Science
  3. /Robust and secure programming