Question
An amateur meteorologist keeps a list of daily temperatures and wants a program to calculate how many times the maximum temperature occurred. For example, if
An amateur meteorologist keeps a list of daily temperatures and wants a program to calculate how many times the maximum temperature occurred. For example, if the list of temperatures is [21, 24, 24, 23, 20, 19, 21, 24], the maximum of 24 occurs 3 times. a.Consider the problem of calculating how many times the maximum temperature occurs.
i.What are the admissible inputs of the problem?
ii.What is the output of this problem? (2 marks)
b.Write three tests for this problem. The inputs should be different from the example given in the scenario description above. At least one of your tests must be a borderline case. Present the tests in a table, with a column for each input and output, and an extra column with a brief explanation of why you selected each test, as is done for example in Block 2 Part 2 Activity 2.10. (3 marks)
c.Decompose the problem into sub-problems. Use the > notation and state in brackets the type of the problem and of each sub-problem, following the example in Block 2 Part 2 Activity 2.44. (6 marks)
Choose the patterns for the subproblem types you identified, instantiate the patterns into an algorithm, and translate the algorithm into code.'
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started