Presentation is loading. Please wait.

Presentation is loading. Please wait.

DO NOW – Decompose a Problem

Similar presentations


Presentation on theme: "DO NOW – Decompose a Problem"— Presentation transcript:

1 DO NOW – Decompose a Problem
In pairs, discuss this problem. How would you solve it? Write your ideas in the top space on the sheet. A scientist has measured the temperature every day for a week. She now wants to type these into a computer program and receive a report of the average temperature and highest temperature.

2 Meet the NEA Understand the Non-Examined Assessment (Grade 3)
Decompose a problem into steps and draw a flowchart (4-5) Write Pseudocode and Python code (6-7)

3 GCSE Big Picture Exams Paper 1 - 50 % (1 h 40)
"Principles of Computer Science" – All six topics Paper % "Application of Computational Thinking" – Problem Solving and Programming Project (Non-Examined Assessment) Paper 3 – not marked A programming project running for 20 hours. You will work in this room, in exam conditions, with little help from the teacher. This will test your skills in Problem Solving and Programming.

4 The Project (aka NEA) The project consists of 4 stages: Analysis
Introduction, Requirements, Decomposition, Subtasks Design Algorithms (flowcharts or pseudocode) Initial test plan Implementation Python programs Updated test table debugging evidence Testing, refining and evaluation

5 Analysis We need to decompose into input, process and output. We need to decide how to store the data, what data structure? Input, Process, Output, Data spells IPOD! A scientist has measured the temperature every day for a week. She now wants to type these into a computer program and receive a report of the average temperature and highest temperature.

6 Analysis stage: Decomposition
A scientist has measured the temperature every day for a week. She now wants to type these into a computer program and receive a report of the average temperature and highest temperature. Discuss in pairs again: What are the inputs? What processes do we need? What are the outputs? How will we store the data? 7 temperatures calculate average temp and calculate highest temp average temp and highest temp in a list e.g. temp=[35,24,26…]

7 Design stage: Algorithms
A scientist has measured the temperature every day for a week. She now wants to type these into a computer program and receive a report of the average temperature and highest temperature. Design stage: Algorithms We now need to design an algorithm. We can do this in a flowchart or pseudocode or both. The algorithm should input the temperatures, calculate average and highest temperature and output the results. In pairs, design a flowchart now. Extension: attempt the pseudocode

8 Design Stage: Flowchart
A scientist has measured the temperature every day for a week. She now wants to type these into a computer program and receive a report of the average temperature and highest temperature. Design Stage: Flowchart This is a simple flowchart for the algorithm. NB there is no exact, correct answer for a flowchart, as long as it makes sense and explains the algorithm well. For example we could have had seven separate Input shapes, or a loop to input the temps that runs 7 times. We could have had two process boxes, one for each calculation. As long as the flowchart is clear and accurate. Now write the pseudocode

9 Design: Pseudocode Now code this program in Python
A scientist has measured the temperature every day for a week. She now wants to type these into a computer program and receive a report of the average temperature and highest temperature. Design: Pseudocode FOR i FROM 0 TO 6 DO RECEIVE temp[i] FROM (REAL) KEYBOARD END FOR SET average TO SUM(temp) / 7 SET highest TO MAX(temp) SEND average, highest TO DISPLAY RECEIVE temp[0] FROM (REAL) KEYBOARD RECEIVE temp[1] FROM (REAL) KEYBOARD RECEIVE temp[6] FROM (REAL) KEYBOARD Now code this program in Python

10 Implementation FOR i FROM 0 TO 6 DO
A scientist has measured the temperature every day for a week. She now wants to type these into a computer program and receive a report of the average temperature and highest temperature. Implementation FOR i FROM 0 TO 6 DO RECEIVE temp[i] FROM (REAL) KEYBOARD END FOR SET average TO SUM(temp) / 7 SET highest TO MAX(temp) SEND average, highest TO DISPLAY for i in range(6): temp[i] = float(input("temp?")) average = sum(temp) highest = max(temp) print("highest =",highest," average =",average)

11 Implementation FOR i FROM 0 TO 6 DO
A scientist has measured the temperature every day for a week. She now wants to type these into a computer program and receive a report of the average temperature and highest temperature. Implementation FOR i FROM 0 TO 6 DO RECEIVE temp[i] FROM (REAL) KEYBOARD END FOR SET average TO SUM(temp) / 7 SET highest TO MAX(temp) SEND average, highest TO DISPLAY temp=[0,0,0,0,0,0,0] for i in range(7): temp[i] = float(input("temp?")) average = sum(temp) / 7 highest = max(temp) print("highest =",highest," average =",average)

12 Testing How do we know this works?
A scientist has measured the temperature every day for a week. She now wants to type these into a computer program and receive a report of the average temperature and highest temperature. Testing How do we know this works? We write a test plan. What would that look like? Can you think of anything else we should test? negative numbers, fractions, two numbers the same etc. and in each case the output should be correct. for i in range(6): temp[i] = float(input("temp?")) average = sum(temp) highest = max(temp) print("highest =",highest," average =",average) I will test with the following data: 25,26,27,28,29,30,31 I expect to get an average of 28 and a highest of 31

13 Analysis Design Implementation Testing Plenary
In your book, summarise the Project task and explain each stage in a sentence.


Download ppt "DO NOW – Decompose a Problem"

Similar presentations


Ads by Google