Presentation is loading. Please wait.

Presentation is loading. Please wait.

Starter Question In your jotter write the pseudocode to take in two numbers, add them together then display the answer. Declare variables RECEIVE firstNumber.

Similar presentations


Presentation on theme: "Starter Question In your jotter write the pseudocode to take in two numbers, add them together then display the answer. Declare variables RECEIVE firstNumber."— Presentation transcript:

1 Starter Question In your jotter write the pseudocode to take in two numbers, add them together then display the answer. Declare variables RECEIVE firstNumber FROM KEYBOARD RECEIVE secondNumber FROM KEYBOARD SET sum TO firstNumber + secondNumber SEND sum TO DISPLAY

2 Learning Intention I will learn about data types and variables.

3 Analysis Design Implementation Testing Documentation Evaluation

4 Data Types and Variables
Once you have your design, you are ready to create your program. The first step is identifying the pieces of information you will need to store.

5 Data Types and Variables
A variable is used to store data in a program. It’s like a storage box – you can put data in then retrieve it again. Each variable is given a unique name so it can be identified. FirstName age

6 Data Types and Variables
Age 17 Height 1.64 FirstName Mike LikesCoffee true Gender m

7 Data Types and Variables
Each variable must also be given a Data Type. This decides what kind of information can be stored in it.

8 Data Types and Variables
Type of Data Example data VB Data Type Text hello, Sam54, 006 String Whole Numbers 1, 50, -100 Integer Real Numbers 1.2, -0.1, 3.97 Single Boolean True, False Character A, a, #, = Char

9 Data Types and Variables
Complete question 1 on the following worksheet in your jotter:

10 Programming Tasks Complete the tasks on pages

11 Data Types and Variables
Naming variables Creating variables in Visual Basic Programming on PC

12 Data Types and Variables
Variables must be given meaningful names: a F age FirstName Variable names cannot start with a number or contain a space.

13 Data Types and Variables
e.g. a variable to store the registration plate of a car Which of the following are not allowed? a) carRegistration b) Reg Number c) registration_plate

14 Data Types and Variables
Complete question 2 on the worksheet:

15 Data Types and Variables
The way that we declare variables in VB is to use the Dim statement: Dim <variable name> As <type> e.g. Dim age As Integer Dim LastName As String

16 Data Types and Variables
Complete question 3 on the worksheet. Type of Data Example data VB Data Type Text hello, Sam54, 006 String Whole Numbers 1, 50, -100 Integer Real Numbers 1.2, -0.1, 3.97 Single Boolean True, False Character A, a, #, = Char

17 Programming Tasks Complete the tasks on pages including the Extension Task

18 Success Criteria I can identify the correct data types for storing information.


Download ppt "Starter Question In your jotter write the pseudocode to take in two numbers, add them together then display the answer. Declare variables RECEIVE firstNumber."

Similar presentations


Ads by Google