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 basic program constructs required for a given program COULD create a simple one function calculator in Javascript Create a multiple function calculator with end or continue screen.
12
Embed
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.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
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 basic program constructs required for a given program
COULD create a simple one function calculator in Javascript
Create a multiple function calculator with end or continue screen.
A Level Computing#BristolMet
Keywords
Selection
Data TypesVariables & Constants
Algorithm Sequence
Iteration
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 waterproofsSTOP 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 IterationSelectionTASK 2: Prepare to explain the program constructs needed in your coffee program
A Level Computing#BristolMet
Data Types (Variable Type)
In databases we already know that the software needs to know what type of data is being held in each data field. This is known as the field type.
Similarly when writing programs it is necessary to understand the type of data that will be held by the variables used in the program.
The reasons are the same as databases:i) It provides limited validation of dataii) Certain operations can only be performed on certain data types (NB: the
prompt() command in Javascript is set to string therefore it cannot automatically perform mathematical operations )
iii) Memory can be efficiently allocated to store data.
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.