Paragraph Spacing
Paragraph Spacing means providing extra space before or after a paragraph
when you have multiple paragraphs in document.
Step 1: Select the required paragraph or place
the cursor in paragraph.
Step 2: In the Paragraph group, click on Dialog
Box Launcher. A paragraph dialog box
appears.
Step 3: Under Spacing, in Before and After
boxes, click on the up or down arrows
to adjust the distance before or after
each paragraph.
Step 4: Click on OK.
51 vedanta Let's Log in (A course in Computer Science) Book 5
Working with Graphics
MS-Word provides feature to add different graphic elements to your document.
These graphic elements help to grab the reader’s attention, or to make them
more visually appealing. These graphic elements can include a wide variety of
objects and effects, including:
a) Pictures
This type of graphic object includes photographs from cameras, clip art images
or files created by using a computer graphics program. Pictures are not created
inside MS-Word.
b) Drawing objects
These objects can be created in MS-Word by using different WordArt and
Shapes tools. You can re-size, move, and format both pictures and drawing
objects in MS-Word.
Inserting Pictures
You can insert digital photographs or pictures into
a Word document. To insert a picture, you have to
specify the source of the picture you want to insert
by clicking on one of these two buttons (Pictures and
Online Pictures). They are located in the Illustrations
group on Insert tab:
i) Picture
Step 1: Go to Insert tab and click the Pictures button from Illustrations group.
The "Insert Picture" dialog box appears.
Step 2: Go to the desired location of image file. (Here, the folder "Images" of
Drive D: is chosen).
Step 3: Select the desired image. (Here, the image file "Nepal flag" is
selected).
Step 4: Click on Insert button.
vedanta Let's Log in (A course in Computer Science) Book 5 52
ii) Online Pictures
Step 1: Click the Online Pictures button from Illustrations group to insert
royalty-free images from the different online sources.
Step 2: The "Insert Pictures" dialog box will appear.
Step 3: Type any keyword related with your desired images in the "Bing
Image Search" text box (here, the keyword "computer" is typed) and
a group of related pictures will appear.
Step 4: Select the desired image or group of images.
53 vedanta Let's Log in (A course in Computer Science) Book 5
Step 5: Click on Insert button.
Page Orientation
Page orientation helps in setting the way in which a
Word document may be printed. The default setting
of page is portrait, which displays the page in a
vertical order. We can change the page orientation
by following the given steps:
Step 1: Click on the Layout tab.
Step 2: Click on Orientation button from Page Setup group. A drop-down list
opens.
Step 3: Click on Landscape to change the orientation and observe the change.
In Landscape, the page is displayed in horizontal order.
vedanta Let's Log in (A course in Computer Science) Book 5 54
Page Border
A border is an outline given to a page to make it look
more attractive. We can apply the page border by
following the given steps:
Step 1: Click on the Design tab.
Step 2: Click on Page Borders button from Page Background group.
The Borders and Shading dialog box appears.
Step 3: Choose the style, color, and width of the border.
OR
Click on the Art drop-down list to choose an artistic border.
Step 4: Click on OK.
Page Color
We can further increase the presentability and appeal of page by filling it with
a desired color. To fill color in a page, follow the steps given below:
55 vedanta Let's Log in (A course in Computer Science) Book 5
Step 1: Click on the Design tab.
Step 2: Click on Page Color drop-down arrow to open a list of colors.
Step 3: Click and select a desired color for the page. The selected color
is applied to the whole page.
Main Points to Remember
Ribbon contains several tabs such as Home, Insert, etc.
Working area is the place where you type, edit, and format your text.
Highlighting text means placing a colored transparent rectangle over it.
Superscript reduces the size of the selected text and raises it above the
normal line.
Subscript reduces the size of the selected text and lowers it below the
normal line.
Format Painter is used to copy the format of any text to another.
Paragraph formatting is a process of making paragraph attractive and
more readable.
Line spacing is the process of adjusting space between lines of the
same paragraph.
Paragraph spacing means providing extra space before or after
paragraph.
vedanta Let's Log in (A course in Computer Science) Book 5 56
EXERCISE
1. Tick ( ) the correct option (MCQs):
a. Line spacing is the vertical space between successive ………………
of the text.
i) pages ii) paragraphs iii) lines iv) words
b. To fill page color, click on ……………………….. tab.
i) Insert ii) Design iii) Layout iv) Home
c. Portrait page orientation displays the page in ……………………….. order.
i) correct ii) horizontal iii) vertical & horizontal
iv) vertical
d. MS-Word provides ……………………….. types of paragraph alignment.
i) 4 ii) 3 iii) 2 iv) 5
e. A/an……………………….. is an outline given to a page.
i) orientation ii) border iii) shading iv) design
2. Match the icons to their names.
a. (i) Text Highlighting
b. (ii) Orientation
c. (iii) MS-Word
d. (iv) Page Color
e. (v) Page Borders
57 vedanta Let's Log in (A course in Computer Science) Book 5
3. Complete the crossword given below.
ACROSS
1 Name of tab that contains Orientation button
3 Contains several tabs in MS-Word window
6 Name of tab that contains Paragraph group
7 Displays the page in horizontal order
8 Aligns the paragraph with equal edges on both sides of the page
Down
2 Adjusting the text with the edges of the paragraph
4 An outline given to a page
5 Lowers text below normal line
1. 2.
3.
4.
5. 6.
7.
8.
vedanta Let's Log in (A course in Computer Science) Book 5 58
4. Answer the following question.
a) Define Word processor.
b) Write any three features of Microsoft Word.
c) What are the steps to apply page border in MS-Word document.
d) What is page orientation? Mention its types.
e) What is paragraph alignment? What are the different alignments
supported by MS-Word?
5. Write T for True and F for False statements.
a) Superscript reduces the size and lowers the text
below the normal line.
b) Grow Font command increases the size of font by
two points.
c) Graphic elements help to grab the reader’s attention.
d) We can insert pictures from Layout tab.
e) It is possible to insert online pictures directly in
MS-Word.
f) Format Painter is used to copy the format.
g) Landscape page orientation displays the page in
horizontal order.
Lab Activities
A) Type the given text in Microsoft Word.
H2SO4 (a + b)2
a3 + 3a2b + 3ab2 + b3 Fe2O3
59 vedanta Let's Log in (A course in Computer Science) Book 5
B) Write two paragraphs on "Mt. Everest" in MS-Word
and do the following:
i. Keep Double line spacing and 12 points after paragraph spacing.
ii. Insert a picture of Mt. Everest at the top of the page.
iii. Apply a page border and page color of your choice.
C) Type an essay of about 150 words on "Advantage
of Internet" in 3 paragraphs using the following
features:
i. Set the paragraph spacing 18 points after each paragraph.
ii. Apply Double line spacing in the middle paragraph.
iii. Set the font size 30 and underline the title of essay.
iv. Highlight the important text with a suitable color.
v. Insert a suitable picture.
vi. Apply suitable page border and page color.
vii. Set the page orientation in landscape.
vedanta Let's Log in (A course in Computer Science) Book 5 60
7Lesson Doing Calculation in
Computer
Doing Calculation in Computer
As you know, the word "computer" is derived from the Latin word "Computare"
which means "calculate." So, computer is a device that is used to calculate our
data and provide us with the meaningful result.
Doing Calculation Through Calculator App
Calculator App is a free application available in Windows operating system.
You can do simple to complex calculation on this app. Let's have a small
demonstration using Calculator App.
How to Open Calculator App
Step 1: Press on Windows Key and R at the same
time. Run window appears.
Step 2: Type ‘calc’ as shown in the figure alongside.
Step 3: Finally click on OK button.
Now, the "Calculator" application appears on the screen.
This calculator works on different modes.
To change the mode:
• Click on the Navigation button.
• Select the appropriate mode:
61 vedanta Let's Log in (A course in Computer Science) Book 5
Note: Standard mode is used for basic calculation such as addition, subtraction,
multiplication, and division.
Now, do some calculation using standard mode of calculator.
Doing Calculation using MS-Excel
Introduction
A spreadsheet is a large sheet in which data and information are arranged in
rows and columns. Spreadsheet is useful in working with numbers. We can do
several calculations such as addition, subtraction, multiplication, and division,
using spreadsheet application.
Some of the popular spreadsheet applications are
Microsoft Excel, Libre Office Calc, Google Sheets,
Lotus 1-2-3, etc. In this chapter, we learn how to
perform different calculation, using Microsoft Excel.
vedanta Let's Log in (A course in Computer Science) Book 5 62
Microsoft Excel
Microsoft Excel is one of the most popular
spreadsheet applications developed by Microsoft.
MS-Excel allows you to create worksheets that can
perform automatic calculations.
Features of MS-Excel
• It allows us to organize data in rows and columns.
• It provides different formula to perform the different calculations.
• It allows us to represent data in different kind of charts.
• It allows us to save and print the calculated data.
How to Open MS-Excel
Step 1: On the Windows desktop, click on the Search Windows icon.
Step 2: In the search box, type excel.
Step 3: Click on the Excel 2016 option in the search results.
Click here to run
MS-Excel
Search Window Icon
Windows Search Box
63 vedanta Let's Log in (A course in Computer Science) Book 5
Alternative method to Run MS-Excel
1. Press on Windows Key and R at the same time.
2. Run window appears.
3. Type ‘excel’ as shown in the figure alongside.
4. Finally click on OK button or Press Enter key.
MS-Excel Window
Title Bar Maximize Button
Minimize Button
Home Tab
Close bottom
File Tab
Ribbon
Font Group
Formula Bar
Cell
MS-Excel Worksheet
Commonly used terms in MS-Excel
Worksheet
A worksheet is a group of cells made up of horizontal rows and vertical columns.
Workbook
A collection of multiple worksheets is called a workbook. It is another name
for Excel file.
vedanta Let's Log in (A course in Computer Science) Book 5 64
Cell
Cell is the smallest unit of worksheet. Intersection of row and column is called a
cell. A cell can contain a numeric value, text, or formula. To refer to a cell, enter
the column letter followed by the row number.
For example, D7 is the intersection of column D and row 7. It is called Cell
Reference.
Rows and Columns
The horizontal lines of cells are called rows and the vertical lines of cells are
called columns.
Active Cell or Selected Cell
A cell that is selected is called the active cell. It has a dark border around it. It is
the cell where the insertion point is located. You can select a new active cell by
using the keyboard arrow keys or clicking on a new cell with the mouse.
Entering Data in Excel
To enter data into cells, follow the steps given below:
• Select the cell where you want to enter data and start typing data.
• Another way is to click in the formula bar after selecting a cell, and enter data
or modify data already present there.
The formula bar buttons are activated only when you are entering data into a
cell.
(a) The button is called cancel button and it can be used to cancel data
entry.
(b) The button is called the Enter button and can be used to accept data
entry.
Suppose you want to enter ‘School” in the cell A1, and
the number 5 in the cell B1. Follow the steps below.
Step 1: Click on the cell A1.
Step 2: Type School using keyboard.
Step 3: Press right arrow to select the cell B1 or you can click on the cell B1.
Step 4: Type 5 and press on Enter.
65 vedanta Let's Log in (A course in Computer Science) Book 5
Editing Data in a Cell
Editing your Excel worksheet data is very easy. You can edit your data by any of
the following ways:
• Select the cell containing data you want to edit.
• Press on F2.
• Use Backspace key and erase the wrong entry, and retype the correct entry.
OR
• Select the cell and simply retype the correct entry.
• If you want only to clear the contents of the cell, select the cell and press
on Delete key.
• To bring back the previous entry, either click on Undo button on standard
Toolbar or select Edit and Undo command, or use keyboard shortcuts CTRL+Z.
Data Types
You can enter various kinds of data in a cell. There are two types of data:
Numbers and Text
Numbers:
It can be a whole number (example: 45, -67) or a decimal number (example:
456.3, 4.5). You can do addition, subtraction, multiplication, and division on
these numbers.
Text:
It can be a single character (example: G, c) or a group of characters (example:
Ram, Sunday, Nepal). It also supports alphanumeric values such as A30, SE89
etc.
Saving a Workbook
To save a workbook, follow the steps below.
Step 1: Select Save option from the File
menu.
Step 2: Click on Browse. The Save As dialog
box appears.
Step 3: Select the desired drive and the
folder where you want to save the
workbook.
Step 4: In the File name box, type the
suitable name for your workbook.
Step 5: Click on Save button.
vedanta Let's Log in (A course in Computer Science) Book 5 66
Opening a Saved Workbook
Step 1: Click on Open option from the File menu.
Step 2: Click on Browse. The Open dialog
box appears.
Step 3: Select the desired drive and the
folder where your file is saved.
Step 4: Select the file.
Step 5: Click on Open button.
Exiting from MS-Excel
Step 1: Click on the File menu and Close option.
Note : Save workbook before closing it.
Doing Calculation in Excel
Type the data as shown in the MS-Excel worksheet.
Calculating Sum,
Step 1: Click on Cell C2.
Step 2: Type = (equal to ) sign
Step 3: Click on Cell A2, type + (plus) sign and Click on Cell B2
Step 4: Press on Enter
Calculating difference,
Step 1: Click on Cell C3.
Step 2: Type = (equal to ) sign
Step 3: Click on Cell A3, type -(minus) sign and Click on Cell B3
Step 4: Press on Enter
Calculating product, 4
Step 1: Click on Cell C4.
Step 2: Type = (equal to ) sign
67 vedanta Let's Log in (A course in Computer Science) Book 5
Step 3: Click on Cell A4, type * (asterisk) sign and Click on Cell B4 4
Step 4: Press on Enter
Calculating division,
Step 1: Click on Cell C5.
Step 2: Type = (equal to ) sign
Step 3: Click on Cell A5, type / (slash) sign and Click on Cell B5
Step 4: Press on Enter
Note : A formula must begin with 'equal to' (=)sign.
Main Points to Remember
MS-Excel is an application that allows us to create worksheets that
can perform automatic calculations.
A worksheet is a group of cells made up of horizontal rows and
vertical columns.
A collection of multiple worksheets is called a workbook.
Intersection of a row and column is called a cell.
A cell that is selected is called an active cell.
The horizontal lines of cells are called rows.
The vertical lines of cells are called columns.
MS-Excel supports mainly two types of data: Numbers and Text
A formula must begin with the 'equal to' (=) sign.
vedanta Let's Log in (A course in Computer Science) Book 5 68
EXERCISE
1. Write ‘T’ for true and ‘F’ for false statements.
a) Spreadsheet is about creating presentations.
b) Text cannot be inserted in the cells.
c) Collection of multiple workbooks is called worksheet.
d) In MS-Excel data is entered in a cell.
e) Formula must begin with the (equal to) = sign.
f) =A5*B5 is written to divide the number in cell A5 by B5.
2. Fill in the blanks with correct words.
(Microsoft, worksheet, divide, cell, active cell, MS-Excel)
a) _______________ is useful application to work with numbers.
b) Microsoft Excel is a spreadsheet application developed by
_______________.
c) Intersection of a column and a row in MS-Excel is called a
_______________.
d) The cell in which cell pointer is kept is called a/an _______________.
e) A _______________ is a group of cells made up of horizontal rows and
vertical columns.
f) =A7/B7 is written to ___________ the number in cell A7 by B7.
3. Match the following.
Group "A" Group "B"
a)Spreadsheet i) B5
b)Cell Reference ii) Undo
c)Text iii) MS-Excel
d)= iv) Formula
e)=A3*B3 v) Data Type
f)CTRL+Z vi) Multiplication
69 vedanta Let's Log in (A course in Computer Science) Book 5
4. Give one word for the following:
a) Intersection of row and column.
b) The first cell address of a worksheet.
c) The horizontal lines of cells.
d) Collection of worksheet.
e) Bar that displays the formula.
5. Answer the following questions.
a. Write any three features of Microsoft Excel.
b. How do you differentiate between a workbook and a worksheet?
c. Mention the steps to open MS-Excel program.
d. What is cell?
e. Which cell is known as active cell?
6. Circle ten terms used in MS-Excel in the adjoining
grid.
T G V B A W L O P Q W W
F X A Z Q O E R T Y D O
O P E N R R O W S N B R
R Q Y I T K F V B M R K
M W U O P S C F X G Y B
U N D O O H O I T K J O
L S A Q C E L L Y L S O
A Z T W L E U E U C A K
R T A Y O T M H I A V P
S A T O S B N U M B E R
M N C V E J K L Y A Z R
Y T G H J K L P O E W Q
vedanta Let's Log in (A course in Computer Science) Book 5 70
Lab Activities
1. Prepare a spreadsheet as shown below to record the temperature of
different days. From the record, you have to identify which day is the
hottest and which day is the coldest day of the week.
2. Prepare class routine as shown below using MS-Excel. Fill the subjects
with the help of your class teacher. Print and put it in your study
room.
71 vedanta Let's Log in (A course in Computer Science) Book 5
3. Prepare a spreadsheet as shown below. In the result column using
the formula, get the result using the operation mentioned in the
operation column. Instructions are given below:
i. In D2, find the sum of B2 and C2
ii. In D3, find the difference between B3 and C3
iii. In D4, find the product of B4 and C4
iv. In D5, Divide B2 by C2
vedanta Let's Log in (A course in Computer Science) Book 5 72
Lesson
8 Typing Techniques
Typing
Typing is the process of writing or inputting text by pressing on keys on a
typewriter, keyboard, cell phone, or a calculator. A computer system also has
an input device, Keyboard. We type our data/information or give instruction to
computer through it.
Typing skill
Learning to keyboard is very important. We have to
follow some rules while typing. It takes lots of self-
discipline and patience. One key factor to mastering
keyboarding is good technique.
These good techniques are speed and accuracy. We have to type at a good
speed without making mistakes. We have to use proper finger for particular
keys.
Keyboarding Tips and Rules
i) Use the correct finger to strike each key.
ii) Do not look at your hands while typing (Put the keyboard reaches to memory).
iii) Sit up straight and put your feet flat on the floor.
iv) Keep home row fingers touching home row keys even in a difficult reach.
73 vedanta Let's Log in (A course in Computer Science) Book 5
The HOME ROW!
The Home row is a place where you have to set
your fingers while typing.
Another thing to keep in mind is that your goal at
first should be to learn the keys and HOME ROW
before you begin to build speed. Accuracy is much
more important to a typist in the beginning.
Finger Chart
We have to use proper finger to strike keys on keyboard. Given below is a finger
chart showing which fingers strike which keys:
Left Hand Right Hand
L R M I I I I M R L
Q W E R T Y U I O P
A S D F G H J K L ;
Z X C V B N M , . /
L – Little Finger
R – Ring Finger
M – Middle Finger
I – Index Finger
vedanta Let's Log in (A course in Computer Science) Book 5 74
Practice your typing using TuxTyping
Tux Typing is a free and open source typing tutor created especially for children.
You can play several typing games at different difficulty levels. It is designed
learn and improve typing speed with fun.
Tux Typing Screen
Run Tux Typing by clicking on Tux Typing icon on Desktop.
Fish Cascade
This is an interesting game where you have to feed hungry fish. Choose different
level you want from the screen given below.
75 vedanta Let's Log in (A course in Computer Science) Book 5
After choosing the level, choose one of the options you like and start playing
game. Remember, always use the current finger while typing.
If you choose Finger Exercises, the following screen will appear.
Why are the keys all mixed up?
vedanta Let's Log in (A course in Computer Science) Book 5 76
The reason for mixing up all the keys was to speed up typing while slowing down
the typist. Christopher Latham Sholes invented the machine called the "Type-
Writer" in 1872. He faced a problem that the keys were jammed if the typist
went too fast. Sholes redesigned the layout of the letters on the keyboard to
force the typist to slow down. We call his layout the "QWERTY" keyboard (after
the first six letters of the typewriter's second row).
Note to teacher:
Let the students play other games and do the practice of Tux Typing in practical
session to teach typing.
77 vedanta Let's Log in (A course in Computer Science) Book 5
EXERCISE
1. Answer the following question.
a) Why are the keys all mixed up?
b) Draw Home Row of your keyboard.
c) Who invented the Typewriter and when?
d) List 4 keyboarding Tips and Rules
e) Draw the finger chart for typing.
Lab Activities
2. Run Tux Typing application and do the following
activities.
Activities 1 Activities 2
Go to Fish Cascade > Easy > Plants and Go to Comet Zap > Pilots > Short
type the name of plants that appear Words and type the words that
on the screen. appear on the screen.
Activities 3 Activities 4
Go to Practice and type the letter Go to Comet Zap > Commander >
that appear on the screen using a Long Words and type the words
correct finger. that appear on the screen using
correct fingers.
vedanta Let's Log in (A course in Computer Science) Book 5 78
3. Create a document in MS-Word as below format:
4. Type the poem in MS-Word following the given format
and save it with your name.
79 vedanta Let's Log in (A course in Computer Science) Book 5
9Lesson Program and
Programming Tools
Planning with Flowcharts
What is a program?
Any series of tasks we do is a program. For example, doing homework, preparing
a cup of tea, etc. are programms. We need to do any work or program with
proper plan.
What is planning?
Planing refers to thinking about how to do a task is planning. A plan has step-
by-step instructions so that we know what to do after completing each task. It
helps us to avoid mistakes.
Preparing a plan
A plan can be written in several steps. We can also make a plan using some
specific symbols.
A plan should always have a starting point and an ending point.
Look at the plan to celebrate your birthday party.
In Steps,
Step 1: Start
Step 2: Select the place where to celebrate.
Step 3: Choose the appropriate time.
Step 4: Make a list of your friends.
Step 5: Invite your friends
Step 6: Order the birthday cake
Step 7: Order the food.
Step 8: Confirm the time when to finish.
Step 9: Stop
vedanta Let's Log in (A course in Computer Science) Book 5 80
Oval Shape Rectangular box Arrow
A n oval box indicates the A rectangular box shows An arrow shows next
start and the end of the what action to do. step of plan and
birthday party plan. direction of plan.
A pictorial plan is better because it is very clear and easy to understand. Such
a pictorial chart is called flowchart.
Let's see another example:
Steps to buying a chocolate
Step 1: Start
Step 2: Take money and go to the chocolate shop
Step 3: Tell the shopkeeper about the chocolate
Step 4: Take the chocolate
Step 5: Pay the money
Step 6: Take the change from the shopkeeper
Step 7: Stop
As we follow the above steps serially, computer also has to follow similar set
of instructions while doing any kind of task. Such a series of instructions is a
computer program.
Computer Program
Computer programms is a set of instructions that tells the computer what to
do and how to do it.
A computer program has three major parts: input, process, and output.
- Input refers to the data that we give to the program for calculation.
- Process refers to the calculation of data.
- Output refers to the result obtained after calculation.
81 vedanta Let's Log in (A course in Computer Science) Book 5
Drawing flowchart of a computer program
In the beginning of the chapter, we learned about the oval shape and rectangular
shape of the flowchart. There are some other symbols which we need to learn
to make a complete flowchart.
- This parallelogram shape is used for input and
output of the program.
- This diamond symbol is used when you have to make decision
either in YES or NO.
A computer program to add any two numbers:
In Steps,
Step 1: Start
Step 2: Type two numbers from keyboard
Step 3: Add these two numbers
Step 4: Show the sum on the monitor.
Step 5: End
Flowchart with decision making
In the above flowchart, a diamond-shaped box is used to ask whether to add
more or not. If the answer is YES, the arrow takes you to the beginning of the
program.
If the answer is NO, the arrow takes you to the end of the program.
vedanta Let's Log in (A course in Computer Science) Book 5 82
Start
Ask any two numbers
Add these two numbers
Show the sum
More Yes
Calculation?
No
End
Main Points to Remember
A plan has step-by-step clear instructions on how to do a job.
Planning is important for any task to do it systematically and it avoids
mistakes.
Planning can be written in simple steps.
A pictorial chart is called a flowchart.
The oval symbol is used to indicate start and end of a program.
The rectangle symbol is used to indicate calculation.
The parallelogram symbol is used to indicate input and output of a
program.
The diamond symbol is used to make decision.
83 vedanta Let's Log in (A course in Computer Science) Book 5
EXERCISE
1. You are feeling unwell. You want to check if you
have fever. The steps are given below. Show the
plan on a flowchart.
a) Get a thermometer.
b) Shake it well so that the mercury level falls below 98°.
c) Open your mouth.
d) Place the thermometer below your tongue.
e) Keep it there for one minute.
f) Take it out.
g) Read the mercury level.
h) If the reading is 99 or above, tell your parents that you have fever.
2. Draw the symbol of the flowchart for the following
cases.
i. Start/End ii. Action iii. Decision
3. Here is a plan for finding the greater one between
any two numbers.
Show the plan on a flowchart.
i. Ask any two numbers.
ii. Is the first number greater than second one?
If yes, display the first number.
If no, display the second number.
vedanta Let's Log in (A course in Computer Science) Book 5 84
4. Answer the following questions:
a) What is computer program?
b) What is planning? Why is it necessary?
c) What is flowchart?
d) Mention the different symbols used to draw a flowchart of program.
5. Write true or false for the following statements:
a) A flowchart cannot be drawn on a paper.
b) A flowchart uses different symbols and flow lines.
c) The rectangular shape is used to indicate start and end of a program.
d) An oval shape is used for calculation.
e) A diamond symbol is used to make decisions.
6. Make a plan and draw a flowchart to perform the
following tasks:
a) To prepare a cup of tea.
b) To do social studies homework.
c) To shut down your computer.
85 vedanta Let's Log in (A course in Computer Science) Book 5
Lesson Programming
in LOGO
10
LOGO is a simple educational programming language used to draw figures, type
text, and perform simple arithmetic calculations.
Programming language is used to write programs. A program is a set of
instructions given to the computer to perform a specific task.
Before this, let us quickly revise what we had covered in previous class.
LOGO Turtle
The cursor of LOGO programming language is called Turtle. It has two parts:
Head and Tail.
Fig. MSWLogo Main Screen with Turtle
LOGO Primitives
The commands used in LOGO are called LOGO Primitives. These Primitives are
instructions, which are followed by the computer to perform a task. There are
many commands we can give to the turtle in LOGO program.
vedanta Let's Log in (A course in Computer Science) Book 5 86
Some important LOGO Commands
Command Work
FORWARD or FD Moves turtle forward
BACKWARD or BK Moves turtle backward
RIGHT or RT Turns turtle right
LEFT or LT Turns turtle left
CLEARSCREEN or CS Clears screen
HOME Brings turtle to the center of screen
CLEARTEXT or CT Clears all the commands from Recall List Box
HIDETURTLE or HT Hides turtle
SHOWTURTLE or ST Shows turtle
PENUP or PU Deactivates turtle's pen
PENDOWN or PD Reactivates turtle's pen
PENERASE or PE Erases a line or part of a line
PENPAINT or PPT Changes Turtle's erase mode to paint mode
SETSCREENCOLOR Changes color of the screen
SETPENCOLOR Changes turtle's pen colour
SETFLOODCOLOR Sets color to fill closed shapes
FILL Fills with color in a closed shape
Recall what you had learnt in previous class
Write the Logo primitives to draw the following pictures:
A. B.
87 vedanta Let's Log in (A course in Computer Science) Book 5
Looping in Logo
To draw a square, you have to type the following commands in Command Input
box.
FD 60 RT 90
FD 60 RT 90
FD 60 RT 90
FD 60 RT 90
Note: You can also type two commands on
the same line.
Have you noticed that we used the
commands [FD 60 RT 90]four times to draw a
square? Instead of writing these commands
four times, we can write these only once
with the use of REPEAT command.
REPEAT Command
REPEAT means doing the same work again for a specified number of times. This
command tells the Turtle to do the same work again. This primitive is given as
below:
REPEAT <number of times> [Primitives]
Example: To draw the above square using a REPEAT command
REPEAT 4 [FD 60 RT 90]
So, you can save your time from REPEAT command if you have to give same
commands again and again. Repeating the same set of commands again and
again is called Looping.
Making different Shapes using REPEAT Command
The REPEAT command makes it very simple to draw different shapes. Look at
following examples:
vedanta Let's Log in (A course in Computer Science) Book 5 88
Shape Number of Angle Command
sides
3 360° ÷3 = 120° REPEAT 3 [FD 50 RT 120]
Triangle
4 360° ÷ 4 = 90° REPEAT 4 [FD 50 RT 90]
Square
5 360° ÷5 = 72° REPEAT 5 [FD 50 RT 72]
Pentagon
6 360° ÷6 = 60° REPEAT 6 [FD 50 RT 60]
Hexagon
In the same way, draw an octagon, with 8 equal sides.
Drawing a Circle
You can draw a circle from the following commands:
89 vedanta Let's Log in (A course in Computer Science) Book 5
REPEAT 360 [FD 1 RT 1]
Remember:
To increase or decrease the size of a shape
(such as triangle, square, rectangle), increase
or decrease the number of steps in the
FORWARD or FD command.
For Example:
REPEAT 360 [FD 3 RT 1]
From the above command, you can draw a
bigger circle than the previous one.
PRINT Command
This command is used to display text or
numbers in the Recall List Box.
To display a number:
PR 15
To display text
PR [Logo is a programming language.]
Remember:
PRINT or PR command displays the output
only in Recall List Box, not in Drawing Area.
Math with Logo
You can give command in Logo to do different mathematical calculations. Turtle
is very good at math and never makes any mistakes if you give right command.
It also provides result very fast.
Arithmetic Operations in Logo
Logo can perform different arithmetic operations such as addition, subtraction,
multiplication, and division. For these operations, you have to use PRINT
command with arithmetic operators.
vedanta Let's Log in (A course in Computer Science) Book 5 90
Arithmetic Operators
These are the symbols used for different arithmetic operations:
Arithmetic Operations Arithmetic Operators
Addition + (plus)
Subtraction - (minus)
Multiplication * (asterisk)
Division / (slash)
Addition
You can find the sum of two or more numbers in Logo.
Type the following instruction in the Command Input Box:
PRINT 10 + 4
14
The output is displayed in Recall List Box.
Remember:
Recall List Box is the text window of Logo Screen.
Alternate Command:
PR (SUM 45 7 80)
You can use SUM keyword instead of " + " operator. When you execute the
above command, turtle calculates the sum of three numbers 45, 7 and 80, and
gives the output 132 immediately.
If you want to add only two numbers with SUM keyword, try the following
example without brackets:
PR SUM 40 21
Try another example:
PR 456 + 890 + 11
The turtle immediately replies 1357 in Recall List Box.
91 vedanta Let's Log in (A course in Computer Science) Book 5
Subtraction
You can find the difference of two numbers in Logo.
Type the following instruction in Command Input Box:
PR 67 – 9
58
As soon as you press on Enter key ( ), Turtle calculates and displays the output
in the Recall List Box.
Alternate Command:
PR DIFFERENCE 12 4
8
You can use DIFFERENCE keyword instead of " – " operator. When you execute
the above command, Turtle subtracts 4 from 12, and gives the output 8
immediately.
Multiplication
You can multiply two or more than two numbers in Logo.
Type the following instruction in the Command Input Box:
PR 6 * 7
42
Try another example and check whether it multiplies:
PR 699 * 76 * 8
Alternate Command:
PR PRODUCT 4 5
20
PR (PRODUCT 4 5 6)
120
You can use PRODUCT keyword instead of " * " operator.
vedanta Let's Log in (A course in Computer Science) Book 5 92
Division
You can also divide by using division operator '/'.
Type the following instruction in the Command Input Box:
PR 100 / 5
20
Alternate Command:
PR QUOTIENT100 5
20
You can use QUOTIENT keyword instead of "/" operator.
Calculating Remainder
You can also find out the remainder when the first number is divided by the
second number.
Type the following instruction in the Command Input Box:
PR REMAINDER 10 3
1
Turtle divides 10 by 3 and gives 1 as remainder.
93 vedanta Let's Log in (A course in Computer Science) Book 5
Operator Command Details Example
+ SUM Calc ulates the s um PR 10 + 4
onuf mtwboeors r more PRINT 6 + 7 + 8
PR SUM 4 5
PR (SUM 6 7 9 8)
- DIFFERENCE Calcula tes the differe nce PR 12 – 9
be tween two n umbers PRINT 34 – 8
PR DIFFERENCE 7 8
* PRODUCT Ca lculate s the p roduct PR 10 * 4
of two or mor e numb ers PRINT 6 * 7 * 8
PR PR0DUCT 4 5
PR (PRODUCT 6 7 9 8)
/ QUOTIENT Div ides th e first numbe r PR 10 / 6
by the second numbe r PRINT 35 / 5
and ca lculates the qu o- PR QUOTIENT 10 2
tient
REMAINDER Ca lculat es th e rem ainder PR REMAINDER 25 8
when the first numbers
is divided by the second
number
Procedures in Logo
Procedure
Procedure is a set of Logo primitives, written in a particular order to perform
a desired task. Procedure saves our time. For example, if you have to draw a
square five times on the drawing area, you do not need to type all the primitives
vedanta Let's Log in (A course in Computer Science) Book 5 94
five times. You will just save these primitives under a single name (let's say
square). Whenever you want square shape, just type square and the shape will
appears on your screen.
Rules for naming a procedure
a) A procedure name accepts letters in capital or small, number (0 to 9) and
symbols (@,~,#,$, etc.)
b) A procedure name should always start with a letter.
c) A procedure name does not accept colon (:) and arithmetic operators such
as +,-,*,/.
d) A procedure does not accept any Logo's keyword such as FD, RT, PU, etc.
Examples of valid Procedure name:
MYPRO, Sq1, House$, ABC321 etc.
Examples of invalid Procedure name:
123, RT, 8Ab1, B+, #Hello
Parts of a Procedure
A logo procedure has three parts:
a) TITLE
It is the name of the procedure. The title line begins with
the keyword TO, followed by the name of the procedure.
Example:
TO SQUARE
The keyword "TO" indicates the beginning of the procedure.
b) BODY
It consists of all the primitives, required to do a specific task.
Example:
FD 50
RT 90
FD 50
RT 90
FD 50
RT 90
FD 50
95 vedanta Let's Log in (A course in Computer Science) Book 5
c) END
The "END" keyword must be typed after writing all the primitives
Example:
END
After pressing on enter, Logo gives the message as shown below:
SQUARE DEFINED
The above message tells us that the procedure is created successfully.
Steps to make a procedure named SQUARE:
Step 1: Type TO SQUARE in the Command Input
Box and press on Enter ( ) key.
Note : After pressing on Enter ( ) key, a "To
Mode" input box will appear.
"To Mode" input box.
Step 2: Type the following primitives one by one in the "To Mode" input box
and press on OK button or on Enter ( ) key.
FD 100
RT 90
FD 100
RT 90
FD 100
RT 90
FD 100
Step 3: After typing all the primitives, type "END" and press on OK button or
on Enter ( ) key to end the procedure.
Logo gives a message "SQUARE defined" in Recall List Box after successful
creations the procedure "SQUARE."
vedanta Let's Log in (A course in Computer Science) Book 5 96
To execute a procedure:
We just need to type the procedure name in the Command Input Box that we
want to execute.
Example: SQUARE
Here, the command SQUARE draws a square
shape in the drawing area.
Saving a Logo procedure
Logo saves our procedures permanently in a file. We can load the saved
procedure in the memory in the next Logo program, whenever required.
Follow the given steps:
Step 1: Click on File menu and select Save As option. A
SaveAs… dialog box appears on screen.
Step 2: Type a suitable file name (for example: SQ) and
click on Save button.
The file is saved as SQ.LGO. (.lgo is the extension of
Logo's file.)
Note: Remember the folder where you saved the
procedure.
97 vedanta Let's Log in (A course in Computer Science) Book 5
Loading a Logo procedure
We can use the saved procedure. We need to load the
procedure file into the memory.
Follow the given steps:
Step 1:
Click on File menu and select Load… option. An Open
dialog box appears on screen.
Step 2:
Select the file you want to load and click on Open
button or press on Enter ( ) key.
Editing a Logo procedure
Once a procedure is created, we can open it and make correction or modify as
vedanta Let's Log in (A course in Computer Science) Book 5 98
required.
Follow the given steps:
Step 1:
Click on File menu and select Edit… option. An Edit
Procedure dialog box appears on screen.
Step 2:
Click on the procedure you want to edit and click on OK
button. [Here, the procedure square is selected.]
Editor screen with the command of square procedure
appears on screen.
Step 3:
Make correction or modify the command
as you require.
Step 4:
Click on File menu of Editor window. Click
on Save and on Exit option to save the
changes.
99 vedanta Let's Log in (A course in Computer Science) Book 5
Did you know?
You can also edit the procedure by clicking on the Edall button on the Logo
window.
Main Points to Remember
Logo is a simple educational programming language.
Some important Logo primitives are: FD, BK, RT, LT, CS, CT, PU, PD, PE,
PPT, HT, ST, FILL, SETPENCOLOR, SETSCREENCOLOR, and HOME
REPEAT command performs looping in Logo.
Logo helps us to do mathematical calculation using PRINT or PR
command.
The output of the mathematical calculation is displayed in Recall List
Box in Commander Window.
We can add, subtract, multiply, and divide in Logo.
Procedure is a set of Logo primitives, written in a particular order to
perform a desired task.
The three parts of a procedure are: Title line, Body, and End Line.
We can make changes in the procedure using the EDIT command.
vedanta Let's Log in (A course in Computer Science) Book 5 100