Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Text Based Coding. We’re learning to explore how text based programming works You will display and enter text into a window You will use.

Similar presentations


Presentation on theme: "Introduction to Text Based Coding. We’re learning to explore how text based programming works You will display and enter text into a window You will use."— Presentation transcript:

1 Introduction to Text Based Coding

2 We’re learning to explore how text based programming works You will display and enter text into a window You will use variables with in a program Objective

3 Teacher Lead Activity: What is a variable?

4 Small basic should be found in your program files: Open Up Small Basic

5 What is small basic Click here to RUN your codeEditor – Used to write code Check this area, from time to time you will see some help. These tips may show you how to solve a problem with your code.

6 Teacher Lead Activity Type in the code shown in the window above. You should notice that it changes colour. This is to help you to spot the code. Push the run button when you’re finished. What happens?

7 Can you spot what is wrong with this code? Have you noticed anything else about the code which you haven’t learnt about yet?

8 We’ve left out a number of things? We’re missing a number of brackets, this will stop our programming from running. Commas, brackets or symbols which are used incorrectly cause a SYNTAX error. This is why we need to test regularly in our code. Throughout your time at UCC you must show evidence of testing / fixing your code What else have you noticed?

9 A variable is like a bucket / storage container When you code, you need to use a variable as a way of storing data. You can see that this example uses Name. This will store the information. We use the + symbol to concatenate the information. If you had a sock draw…. You wouldn’t put t-shirts in it? If you had a pencil case…. You wouldn’t put your lunch in it would you? This is why it’s important to name our variables carefully. I’ve included the fixed example below:

10 Task 1: - You’re required to write a program which asks a number of questions about a person. It should respond by repeating the information and saying something nice to them. Here is an example: In a word document, you should show evidence of your testing and you should also comment on any errors you have had. Challenge: - Use the internet to find out how you can use an IF statement in Small Basic. What does it do and can you give an example within your own work.

11 Task 2: - Ever worked in a team? Ever had a friend off sick? Sometimes programmers need to continue your work. This is why we use commenting, it explains what you were doing or what the specific section of code is for. When coding in SMALL BASIC an apostrophe is used to help us comment our code. Have a look at the example below: Using the snipping tool, finish your code and comment on it. Explain what is happening. At the end of your document explain why we comment code and also the definition of a variable.

12 What is wrong with it?

13


Download ppt "Introduction to Text Based Coding. We’re learning to explore how text based programming works You will display and enter text into a window You will use."

Similar presentations


Ads by Google