Starter Hint

One starter strategy is to imagine your main program and write comments for everything that needs to happen eg:

def main():

#set total to 0

#set average to 0

#set 28-Count to 0

#start a loop of 100 times

#get a valid temp from a helper function, getTemp

#add the temp to a total

#if temp is greater than 28, update count

#end of loop

#get average by calling helper function, getAverage

#display final results by calling helper function, displayResults

Covid-19 Temperatures

Task 1

A doctor in a hospital in New York City is checking patients for symptoms of Covid-19.

He has recorded all of the statistics on paper which has been time consuming.

He needs a system that will allow temperature data from a digital thermometer to be added to a total and finally output the total, the average temperature and the number of temperatures that were above 28.

Note: the system will reject any input that is below 22 and above 45 - this could simply be a thermometer malfunction.

The program will be able to process 100 patients.

Write a program that will allow 100 valid temperatures to be input by a doctor, creating a total and outputting:

  • the total temperature
  • the average temperature
  • the number of temperatures greater than 28

In your solution, use as many programming concepts as you can and make sure your design is modular.

Possible Concepts

  • local / global variables
  • selection if-elif-else:
  • iteration for i in range():
  • assignment =
  • comparison operators == > < >= <= !=
  • parameters multiply(5,2)
  • return statements result = multipy(5,2)
  • exception handling try: except:

Task 2 - Pseudocode

This is recommended for students of IB or IGCSE Computer Science

Research pseudocode used in this course and try to translate your solution into pseudocode.

Task 3 - screencasting

Create a screencast for your portfolio. Describe how your code works and run the program to show your audience.

Recommended software is screencastomatic.

Testing

Make sure you are thoughtful when testing your solution.

If your code has a validation check, test your code with acceptable/valid data and unacceptable/invalid data.