Download presentation
Presentation is loading. Please wait.
Published bySamuel Villers Modified over 10 years ago
1
Section 1 Introduction National 4/5 VB Course
2
What you should know after this lesson What is a program Who writes programs Why is sequence important in programs
3
Programming A program is a list of instructions that tell the computer what to do. A programmer writes the programs A user uses the programs You will be both programmer and user in this topic.
4
What is VB Visual Basic (VB) is a programming language that derived from BASIC – a general purpose programming language for beginners. Beginners All Purpose Symbolic Instruction Code. It’s aim was to create code to solve general types of problems.
5
Getting Started – Sample Program Launch VB We want to try running a VB program. Drag the Sample folder from the PupilArea > Computing > Comp Science > VB folder into your VB folder From the folder double click Sample.vbp (icon with the red line) and press run ► Experiment with the program, what can it do?
6
Sample Program The sample program uses code to make objects visible/invisible Has a This is how we join the program blocks together, you can unsnap a single or bunch of blocks by dragging them.
7
Drawing If we keep double clicking on the blocks you should notice the cat moves in a circular fashion. Drag the “pen down” block from the pen tab, to the top of the program What happens when you keep double clicking it?
8
Drawing a square I don’t want to double click the block every time to draw a side of the square, I would rather double click it once and have it draw the square for me. How can I change the program to make this happen? Hint on next page
9
Drawing a Square
10
Tasks Create a program to draw a square. Copy the diagram from the previous slide into your jotter. Write the program to draw a square into your jotter.
11
Adding a new Sprite Sometimes it is nice to have more than one sprite on the screen. Get a new surprise sprite Write a program to draw a triangle using the new sprite. Hint: the angle is 120
12
All at once Wouldn’t be easier if there was a start button? Well there is go to the control tab and drag “when flag clicked” to the top of each of your sprite’s program. Now when you click on the flag (top right) your program will run
13
Review Question Write the question & answers in your jotter 1.What is a program? 2.Who writes programs? 3.Why is sequence important in programs?
14
Extension Tasks Modify your program to draw the following shapes 1.A hexagon 2.A pentagon 3.A circle 4.A star
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.