Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

9

Programming 1
Grade 9 – Special Science Program
Quarter 2 Module 1 Week 1&2
Getting Started With Microsoft Small Basic
Programming 1 – Grade 9 (Special Science Program)
Alternative Delivery Mode
Module Writer: Noli A. Esmeña
Quarter 2 – Module 1, Week 1&2: Getting Started With Microsoft Small Basic
First Edition, 2020

Republic Act 8293, section 176 states that: No copyright shall subsist in any work
of the Government of the Philippines. However, prior approval of the government agency or
office wherein the work is created shall be necessary for the exploitation of such work for a
profit. Such agency or office may, among other things, impose as a condition the payment of
royalties.

Borrowed materials (i.e., songs, stories, poems, pictures, photos, brand names,
trademarks, etc.) included in this module are owned by their respective copyright holders.
Every effort has been exerted to locate and seek permission to use these materials from their
respective copyright owners. The publisher and authors do not represent nor claim
ownership over them.

Published by the Department of Education


Secretary: Leonor Magtolis Briones
Undersecretary: Diosdado M. San Antonio

Printed in the Philippines by


Department of Education – Region I – Division of Pangasinan II
Office Address: Canarvacan, Binalonan, Pangasinan
E-mail Address: [email protected]

Reminders in using this module:

1. Use the module with care. Do not put unnecessary mark/s on any part of the
module. Use a separate sheet of paper in answering the exercises.
2. Don’t forget to answer What I Know before moving on to the other activities included
in the module.
3. Read the instruction carefully before doing each task.
4. Observe honesty and integrity in doing the tasks and checking your answers.
5. Finish the task at hand before proceeding to the next.
6. If you encounter any difficulty in answering the tasks in this module, do not hesitate
to consult your teacher or facilitator. Always bear in mind that you are not alone. We
hope that through this material, you will experience meaningful learning and gain a
deep understanding of the relevant competencies. You can do it!

This module will introduce you to the basics of Microsoft Small Basic, a programming
software.

What I Need to Know

The module consists of two (2) lessons, namely:


• Lesson 1 – Microsoft Small Basic Programming Workplace
• Lesson 2 – Your First Program
After going through this module, you are expected to:
1. access program software and identify the different parts of the workplace
2. create a simple program
3. display program output on the computer’s screen
4. write and edit program statements
5. save a program on a computer
6. distinguish elements of a program statement

2
What I Know

Multiple Choice
Directions: Before you study this module, answer this to test your existing knowledge.
Write the capital letter of your chosen answer on a separate sheet of paper.

1. Which part of the small basic environment serves as the location of editors?
A. Editor B. Surface C. Toolbar
2. Which part of small basic environment issues commands?
A. Editor B. Surface C. Toolbar
3. This editor contains the program you are currently working on.
A. Main editor B. Active editor C. Current editor
4. How is a new editor created?
A. Using the toolbar B. Using the surface C. Using the main editor
5. Which part of small basic environment can you use to save a program?
A. Editor B. Surface C. Toolbar
6. Which part can you use to start creating a program?
A. Editor B. Surface C. Toolbar
7. Which part of the small basic environment contains your program statements?
A. Editor B. Surface C. Toolbar
8. What do you call the box where the program output is shown?
A. Window Pane B. Text Window C. Output Pane
9. Which is/are necessary for writing a program statement?
A. Object B. Operation C. Both A and B
10. To change the text that is being shown in the output, which should be edited?
A. Object B. Operation C. Input
11. Save command is found on what part of the small basic environment?
A. Editor B. Surface C. Toolbar
12. In the program, TextWindow.Writeline(“Hello World”), which describes TextWindow?
A. Object B. Operation C. Input
13. “Hello Teacher” is an example of which?
A. Object B. Operation C. Input
14. Objects has different ____________.
A. targets B. operations C. titles
15. TextWindow.WriteLine("Hello World") ____________.
A. is an incomplete program statement
B. consists of an object and an operation
C. displays nothing when run

3
Lesson 1 Microsoft Small Basic Programming Workplace

In the previous quarter, you have been oriented about the programming process.
You have been introduced to several programming concepts which will then be now
applied using programming software for beginners like you. Let’s start!

What’s In

Activity 1. Recalling the Concept of Programming


Directions: Answer the following questions based on what you have previously
learned. Write your answers on your paper.

1. What is programming?
2. What is a program?
3. What are the elements of a program?
4. What are programming languages?

What’s New

The BASIC Programming Language


BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of general-
purpose, high-level programming languages whose design philosophy emphasizes
ease of use. It was originally designed by Kemeny and Kurtz and released
at Dartmouth College in 1964. They aim to enable students in fields other than
science and mathematics to use computers. By that time, nearly all use of
computers required programming, which was something
only scientists and mathematicians tended to learn.
As computers evolved, several versions of BASIC were also developed
including Microsoft BASIC in 1975. BASIC was available for almost any computer of
the previous era, and naturally became the de-facto programming language of many
computers. Many versions of BASIC including Microsoft Small Basic is still used
today. (https://tinyurl.com/cwqgx37).

What is It

What is Microsoft Small Basic?


When computer languages were first started, they were easy to learn and
understand but as computers evolved, computer languages became more
sophisticated which poses a great challenge for beginners. Small Basic is a
programming language designed to make programming extremely easy,
approachable, and fun for beginners. Small Basic intends to bring down the barrier
brought by sophisticated programming and serve as a stepping stone to the amazing
world of computer programming (https://tinyurl.com/y9xykf38).

4
Activity 2. Installing Microsoft Small Basic
Note: It will be better if you could immediately use a computer so that you can study this
module while exploring the application.

Step 1: Download the application via http://smallbasic.com


Step 2: Proceed to the download section of your computer then click the file
Step 3: Read and follow the prompts that will appear.
Step 4: If the download cannot proceed (especially if you are using Windows 7 or
lower), you may need to download and install this file first
https://www.microsoft.com/en-us/download/confirmation.aspx?id=30653
The Small Basic Environment
Let us start with a quick introduction to the Small Basic Environment. When you
first launch Small Basic, you will see a window that looks like the following figure.

3
1

Figure 1. The Small Basic Environment

This is the Small Basic Environment, where we’ll write and run our Small Basic
programs. This environment has several distinct elements which are identified by
numbers.
1. The Editor, identified by [1] is where we will write our Small Basic programs.
When you open a sample program or a previously saved program, it will show
up on this editor. You can then modify it and save it for later use.
You can also open and work with more than one program at one time. Each
program you are working with will be displayed in a separate editor. The
editor that contains the program you are currently working with is called
the active editor.
2. The Toolbar, identified by [2] is used to issue commands either to the active
editor or the environment. We’ll learn about the various commands in the
toolbar as we go.
3. The Surface, identified by [3] is the place where all the editor windows go.
https://tinyurl.com/y9xykf38

5
What’s More

Activity 3. Identification
Directions: Identity what part of Microsoft's small basic workplace is being
mentioned on each item. Write your answers on your paper.

1. This is where you will write small basic programs.


2. This is where you can see the save button.
3. This part contains the various commands.
4. This is the location of the editor windows.
5. This is where you can see the button that will create a new editor.

What I Have Learned

Activity 4. Reflection
Question: Do you agree that Microsoft Small Basic is suited for beginners like you?
Why? Write your answer on your paper.

What I Can Do

You can continue exploring the different parts and features of a small basic work
environment on your computer. Remember, being familiar with the basic features is
very important.

6
Lesson 2 Your First Small Basic Program

In the previous lesson, you have been introduced to the small basic workplace
environment. In this lesson, you will now write your first program using small
basics.

What’s In

Activity 5. Recalling Lesson 1


Directions: Answer the following questions based on what you have previously
learned. Write your answers on your paper.

1. Which part of the small basic work environment will you use to write a
program?
2. Which part enables you to run your program?
3. Which part enables you to save your program on your computer?

What’s New

Programming Process in Small Basic


Below is a graphic organizer that summarizes the programming process in Small
Basic.

Write your Test the program Save your program


program using using the Run using Save
the editor command command

Figure 2. Programming Process in Small Basic

What is It

Activity 6.1. Writing your First Program


Now that you are familiar with the Small Basic Environment, we will go ahead and
start programming in it. As you can see in Figure 2, the editor is the place where we
write our programs. So let’s go ahead and type the following line in the editor in
Microsoft small basic.
TextWindow.WriteLine("Hello World")
This is our first Small Basic program. And if you have typed it correctly, you should
see something similar to Figure 3.1.

Figure 3.1. First Program


7
Activity 6.2. Running your First Program
After writing a program, you have to test if it works by running it and displaying its
output. We can run our program either by clicking on the Run button on the toolbar
or by using the shortcut key, F5 on the keyboard. If everything goes well, our
program should run with the result as shown in Figure 3.2.

Figure 3.2. First Program Output

Activity 6.3. Saving your First Program


You can save the current program by either clicking on the “Save” icon on the
toolbar or by using the shortcut “Ctrl+S” (press the S key while holding down the
Ctrl key).

Congratulations! You have just written, run, and save the first Small Basic program.
This is just a simple program but a big step towards becoming a real computer
programmer! Now, there’s just one more detail to cover before we go on to create
bigger programs. We have to understand what just happened – what exactly did we
tell the computer and how did the computer know what to do? Let’s analyze the
program we just wrote, so we can gain that understanding.

Note: As you typed your first program, you might have noticed that a popup
appeared with a list of items (Figure 4). This is called “Intellisense” and it helps you
type your program faster. You can browse the list by pressing the Up/Down arrow
keys, and when you find something you want, you can hit the Enter key to insert the
selected item in your program.

Figure 4. Intellisense

Understanding Our First Program


TextWindow.WriteLine("Hello World")
This is a very simple program that consists of one statement. This statement tells the
computer to write a line of text which is Hello World, into the Text Window. You
might have already noticed that the statement consists of smaller segments just like
sentences can be split into words. The statement in our first program has 3 distinct
segments: a) TextWindow b) WriteLine c) “Hello World” Our first program is broken
down into segments as can be seen in Figure 5 on the next page. The dot,
parentheses, and quotes are all punctuations that have to be placed at appropriate
positions in the statement, for the computer to understand our intent.
8
Figure 5. Breaking Down Our First Program
The TextWindow is called an object. There are many objects available for us to use
in our programs. We can perform several different operations on these objects.
We’ve already used the WriteLine operation in our program. You might also have
noticed that the WriteLine operation is followed by Hello inside quotes. This text is
passed as input. Punctuations such as quotes, spaces, and parenthesis are
essential segments that should be used properly.
You might remember the black window that appeared when we ran our first
program. That black window is called the TextWindow or sometimes referred to as
the Console. That is where the result of this program goes.
https://tinyurl.com/y9xykf38, https://tinyurl.com/yaukgd9m

What’s More

Activity 7: TRUE or FALSE


Directions: Write TRUE if the statement is correct and FALSE if it is not. Write your
answers on your paper.
1. You can write a program in the editor.
2. You can run or test a program using the Play command.
3. You can save a program using the editor keys.
4. You can run a program by pressing F5.
5. The intelligence feature helps you to type your program faster.
6. TextWindow is an example of an object.
7. TextWindow is the only object that can be used in a small basic program.
8. TextWindow can perform different operations.
9. Hello World is an example of input.
10. Commas are placed in between an object and an operation.

What I Have Learned

Activity 8: My Realizations
In this lesson, you have created your first program. In your paper, answer the
question: What did I realize after creating my first program?

9
10

You might also like