Presentation on theme: "A Level Computing#BristolMet Session Objectives#U2 S2 MUST describe the steps of an algorithm using a program flowchart SHOULD explain the data types and."— Presentation transcript:
A Level Computing#BristolMet Keywords
A Level Computing#BristolMet Planning a programme Before attempting to write a programme, the solution needs to be planned. This helps the coder to see what they want to achieve and how they can best achieve it by breaking the problem down into logical steps. Methods for planning a programme solution include the use of the flow charts and pseudocode. FLOW CHARTS – the following symbols are used START STOP Area = Width x Height Start or Stop a programme Represent a process i.e adding Represents input or output values A decision symbol i.e Yes or No, or a choice of paths START STOP Input Width Input Height Output Area What will this programme do?
A Level Computing#BristolMet Flow Charts Simple flow chart with decision symbols. START Check the weather outside Is it raining ? Wear waterproof trousers Don’t wear waterproofs STOP IF Yes Else No TASK 1: Create a flow chart for making a cup of coffee.
A Level Computing#BristolMet 3 basic program constructs RECAP: Can you remember what the 3 basic program constructs are? Sequence IterationSelection TASK 2: Prepare to explain the program constructs needed in your coffee program
A Level Computing#BristolMet Data Types (Variable Type) For this course, the data types you need to know about are: Integer Floating Point Real Boolean Character String TASK 3: In your course folders, make notes on each type giving examples. Data Types Resource - Teach-ICT TASK 4: Prepare to discuss the variable types which could be used for your coffee program.
A Level Computing#BristolMet Creating a coding solution TASK 4: Now create a flow chart for a program that will add any two numbers and give the result. ANSWER: Answer = N1 + N2 START STOP Input Number 1 Input Number 2 Output Answer Pseudocode Declare variables for number1, 2 and answer Prompt input number1 and store as variable Prompt input number2 and store as variable Answer of number1 + number2 stored as variable Alert user of answer as message.
A Level Computing#BristolMet Multiple Function Calculator TASK 5: Create a calculator which can perform all 4 maths operations. You must design the solution first by creating a flow chart. EXT: How could the efficiency of this program be improved??
A Level Computing#BristolMet Flow Chart for 4 Operations Calculator Answer = N1 + N2 START STOP Input Number 1 Input Number 2 Output Answer Answer = N1 / N2 STOP Input Number 1 Input Number 2 Output Answer Answer = N1 * N2 STOP Input Number 1 Input Number 2 Output Answer Answer = N1 - N2 STOP Input Number 1 Input Number 2 Output Answer Which Calculator If = + If = - If = * If = /