Vedanta Let’s Log in Computer Science _ Book 7
Note: Think about the resolution of image. The output will be in
low quality, if you increase the size of low-resolution image.
Step 5 : Click on OK button to accept the changes.
Note: The smallest addressable element of a Pixel (Picture
Element). Resolution refers to the number of pixels in an
image.
Creating a new image file
Follow the steps below to create a new image file:
Step 1 : Click on File Menu > New… (Shortcut Key: Ctrl+N)
A New dialog box appears:
Step 2 : Type the target value for width, height and resolution of
your page.
Step 3 : Select Color Mode and Background Contents.
Step 4 : Click on OK.
Now, a blank image file appears on the workspace.
Tools Panel
This palette contains some groups of tools that are used to edit and
manipulate images. Here, text tool and some selection tools of tools panel
are discussed below:
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 151
Vedanta Let’s Log in Computer Science _ Book 7
Rectangular Marquee Tool (M) Move Tool (V)
Lasso Tool (L) Magic Wand Tool (W)
Crop Tool (C) Slice Tool (K)
Brush Tool (B)
Spot Healing Brush Tool (J) History Brush Tool (Y)
Clone Stamp Tool (S) Paint Bucket Tool (G)
Eraser Tool (E) Dodge Tool (O)
Blur Tool (R) Horizontal Type Tool (T)
Pen Tool (P) Rounded Rectangle Tool (U)
Eyedropper Tool (I)
Path Selection Tool (A) Zoom Tool (Z)
Notes Tool (N)
Hand Tool (H) Background Color
Foreground Color
Edit in Quick Mask Mode (Q)
Jump to ImageReady (Ctrl+Shift-M)
Note: The character in the bracket in Tools Panel is shortcut key to activate the
required tool. For example, press V to activate Move tool.
Type Tool
Type tool is used to add text onto your image file. You might have to add
text while creating poster, invitation, or any other graphical design. You can
also apply different effects to text in Photoshop.
152 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
Adding Text
Follow the steps below to add text:
Step 1 : Create a new file or open an existing image file.
Step 2 : Click on Type tool from Tools panel or simply press "T".
The Type tool is activated.
Step 3 : Various Options related with text be appear in the Options
Bar.
Set the font family Set the font size Set the text colour
Step 4 : Options bar of Type Tool
Step 5 :
Choose the target font, text size, and color.
Step 6 : Click and drag anywhere in the workspace (new image or
existing image) window to create a text box.
A new text layer is added to your image.
Step 7 : Text Box over the image Text layer
Type the text of your choice. 153
Saving an image file
Follow the steps below to save an image file:
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
Step 1 : Open and edit or create a new image file.
Step 2 :
Click on File Menu > Save (Ctrl+S) or Save As…
Step 3 : Shift+Ctrl+S)
Step 4 : Save As dialog
box appears:
Step 5 :
Step 6 : Type name in
filename drop-
down list box if
you want to give
another name.
Select the target
folder if you
want to save in
another location.
Select the
file format that you want to change.
Click on Save button.
Note: The default extension of Photoshop file is PSD. You can edit PSD file in
Photoshop file later on. Other common formats are JPG, GIF, BMP, PNG, etc.
Selection Tool
Selection tool is one of the mostly used tool in Photoshop while manipulating
or designing images. Selection tool is used to isolate different part of an
image so that we can work only on that particular area without affecting
the rest of the image.
Marquee Tool
Marquee tool is a basic selection tool
available in Photoshop. It allows the
user to make rectangular or elliptical
selection of a certain part of an image.
It also provides 1pixel rows and columns
selection.
154 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
Follow the steps below to select a part of an image using Marquee tool:
Step 1 : Open the target image file.
Step 2 : Select either Rectangular or Elliptical selection tool.
Step 3 : Click and drag over the area of the image you want to
select.
Note: Hold down shift button while dragging to constrain the marquee to square or
circle. You can cut, copy, or apply some other effects on the selected portion
of the image.
Lasso Tool
Lasso Tool allows the user to draw freehand
selections around objects. Beside the
standard Lasso tool, Photoshop provides
two other types of Lasso tool: Polygonal
Lasso Tool and Magnetic Lasso Tool.
Follow the steps below to select a part of
an image using Lasso tool:
Step 1 : Open the target image file.
Step 2 : Select Lasso Tool.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 155
Step 3 : Vedanta Let’s Log in Computer Science _ Book 7
Click and drag to draw a freehand selection border over a
desired part of the image.
Step 4 : Release the mouse button.Note:
Press Ctrl+D to deselect the image.
Cropping Images
Cropping images is one of the most basic, and important photo editing
features available in Photoshop. Cropping feature allows you to remove
unwanted outer parts of image.
In Photoshop, you can crop your images
using either crop tool or selection tool.
Follow the below steps to crop an
image:
Step 1 : Open the target
image.
Original Image before cropping
156 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
Step 2 : Select Crop tool from Tools panel or press C to activate
Step 3 : Crop tool.
Select the area of the image that you want to preserve.
Step 4 : Click on Image Menu > Crop or Press on Enter.
Cropping After Cropping
Painting Tools
Photoshop provides several tools for painting and editing image color. Brush
tool and Pencil tool work like traditional drawing tools by applying color
with brush strokes. Gradient tool, Fill command and Paint Bucket tool
apply color to large areas.
Paint with the Brush tool or Pencil tool
The Brush tool and Pencil tool paint the current foreground color on an
image. The Brush tool creates soft strokes of colour. The Pencil tool creates
hard-edged lines. Follow the steps below to paint with Brush
tool.
Step 1 : Create a new image document.
Step 2 : Choose a foreground color.
Step 3 : Select either Brush
tool or Pencil Tool from
Step 4 : Tools panel.
Step 5 : Choose a brush from
Step 6 : Brush Presets picker.
Set tool option for mode, opacity, and so on, in options
bar.
Do one or more of the following:
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 157
Vedanta Let’s Log in Computer Science _ Book 7
Drag in the image to
paint.
To draw on a straight
line, click a starting
point on the image.
Then hold down Shift
and click an ending
point.
While using Brush
tool as an airbrush,
hold down the
mouse button
without dragging to
build up color.
POINTS TO REMEMBER
Computer Graphics includes everything that is presented through images
developed or designed using different graphical software.
Some popular image editing software includes Adobe Photoshop, Google
Drawing, CorelDraw, Blender, Paintshop Pro, PicPick, etc.
158 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
Type tool is used to add text to your image file.
Some selection tools available in Photoshop are Marquee Tool and Lasso
Tool.
Marquee tool allows rectangular or elliptical selection of a part of an image.
Lasso tool allows freehand selections around objects.
The Brush tool creates soft strokes of color.
The Pencil tool creates hard-edged lines.
Image size refers to the length and width of a digital image, also called pixel
dimensions.
Resolution refers to the number of pixels in an image.
Cropping feature allows the user to remove unwanted outer parts of image.
Exercise
1. Answer the following questions:
a) What do you mean by Graphics editing?
b) Write any four Graphics software.
c) Mention any six tools available in Tools panel of Photoshop and explain any two
of them.
d) Differentiate between Marquee and Lasso tools.
e) Write down the steps to add text on an image file in Photoshop.
2. Tick (√) the correct options:
a) Photoshop is developed by ………..
(i) Microsoft (ii) Google
(iii) Apple Inc. (iv) Adobe Systems
b) Which is not the image editing software?
(i) Blender (ii) PicPick
(iii) MS-Access (iv) CorelDraw
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 159
Vedanta Let’s Log in Computer Science _ Book 7
c) The default extension of Photoshop file is ……….. .
(i) GIF (ii) PNG
(iii) JPG (iv) PSD
d) Which one of the following tools is not available in Tools panel of Photoshop?
(i) Brush Tool (ii) Crop Tool
(iii) Type Tool (iv) Copy Tool
e) The ……….. tool creates hard-edged lines.
(i) Blur (ii) Type
(iii) Brush (iv) Pencil
f) The ……….. tool is used to remove unwanted outer part of an image.
(i) Crop (ii) Cut
(iii) Pencil (iv) Lasso
3. Match the following: Group "B"
(i) Open File
Group "A" (ii) Save As
a) Shift+Ctrl+S (iii) Activate Move tool
b) Alt+Ctrl+I (iv) Image Size
c) Ctrl+O
d) V
4. Match the following: Group "B"
Group "A"
a) (i) PicPick
b) (ii) Blender
c) (iii) Adobe Photoshop
d) (iv) CorelDraw
e) (v) Google Drawing
160 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
5. State whether the following statements are True or False:
a) Pixel is the smallest element of an image.
b) PSD file is editable in Photoshop.
c) Crop tool is used to add other things over an image.
d) You have to click on Edit menu to change the image size.
e) Marquee tool is used to insert text in an image.
Lab Activity
1. Open any image file in Photoshop and change its width to 500 pixels and
height 900 pixels, and save the picture in jpg format.
2. Create a collage of 7 heritage sites of Nepal, write their names, and save in
your computer.
3. Design a New Year Card by inserting various images on it. Use the various
tools you have learnt to make it beautiful and save it in JPG format.
4. Open any graphic file in Photoshop and add some text in the file.
5. Open any graphic file and demonstrate the uses of Marquee and Lasso
tools.
6. Open any one JPG file. Remove some unwanted portion using Crop tool and
save it.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 161
Vedanta Let’s Log in Computer Science _ Book 7
Lesson
13 Multimedia and its Uses
Introduction
Multimedia has become an inevitable part of any presentation. It has found
a variety of applications right from entertainment to education.
As the name implies, multimedia is the combination of more than one
medium used to present information. Technology allows user to control and
combine different forms of media to present information in more interesting
manner. It is called multimedia technology. Multimedia is a term used to
describe multiple means of media used to convey information. It includes
text, image, audio, video and animation.
Television Tutorial/
Presentation
Radio
Entertainment Film
Multimedia
Game ICT
Printing Music
Computers and electronic devices such as Mobile phone, Video player,
Television, Tablets, iPad, etc., are normally used to record and play
multimedia contents.
162 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
Multimedia Applications
Multimedia finds its application in various areas like Education,
Entertainment, Engineering, Medicine, Mathematical, and Scientific
Research, etc.
In Education, multimedia is Education
used to produce Computer Based
Training courses (popularly called
CBTs), and reference books like
encyclopaedias. A CBT lets the user
go through a series of presentations,
and text about a particular topic and
associated illustrations in various
information formats. Educational
CDs are available for different subjects.
In Engineering, (especially in Mechanical and Automobile
Engineering), multimedia is
primarily used for designing
machinery or automobile.
In Medicine, doctors can get Medicine
trained by looking at a virtual
surgery (without it being performed)
or they can simulate how human
body is affected by diseases spread
by viruses and bacteria, and then
develop techniques to prevent the
same.
In Mathematical and Scientific
Research, multimedia is mainly
used for modeling and simulation.
For example, a scientist can look at
a molecular model of a particular
substance and manipulate it to
arrive at a new substance.
In advertising, multimedia is the Mathematical and Scientific Research
most effective way to present one’s
product to public. The ads which
you see on Television and Internet, are multimedia product.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 163
Vedanta Let’s Log in Computer Science _ Book 7
In Business, multimedia is used Business
to promote their new products. It
can also be used to train employees,
present plans, policy, and sales and
for many other purposes.
In Games, the on-screen 3-D games
we play in the computer are examples
of multimedia. Some examples of
computer games are: Call of Duty,
Need for Speed, Batman Arkham
Asylum, Battlefield Bad Company,
Tomb Raider, Mafia 2, FIFA, Angry
Birds, etc.
In Movies, all the cartoons and
animated movies that we watch are
made with the help of multimedia
computer.
Multimedia Computer Cartoon movie
A computer that is used to create, play, and store multimedia products is
called multimedia computer. It is capable to handle all the components of
multimedia, i.e., text, graphics, audio, video, and animation. A multimedia
computer contains high speed microprocessor, RAM, good VGA, large volume
of hard disk¸ speaker, headphone, CD/DVD drive, and the multimedia
software like VLC media player, Adobe Photoshop, Maya, 3D Studio Max,
etc.
microprocessor speakers VGA
RAM hard disk headphone CD/DVD
164 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
Advantages of Multimedia
Information, views, ideas, and knowledge can be shared in an attractive
and effective way.
The realistic visual effect can be added to the games and animated
movies.
Electronic advertising through television and the internet can be more
effective and attractive.
Self-learning materials can be developed for the students.
Easy to reproduce or replicate as the multimedia contents are stored in
CD and DVD.
Information presented through multimedia retains longer in human
memory than that from other sources of information.
Multimedia Extensions
Components of Multimedia
To use multimedia as an effective means to convey information, it is
important to use all its components efficiently. The various components that
constitute multimedia are text, graphics, sound, animations, and video.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 165
Vedanta Let’s Log in Computer Science _ Book 7
Text
Text is the main component of Multimedia. Most multimedia systems use a
combination of text and other media to produce multimedia contents. Several
text effects such as font size, color, border, shading, etc., can be applied to
enhance the presentation.
Graphic
Graphics is an important component
of multimedia because a picture is a
powerful way to illustrate information.
For example, in a multimedia application
for education of children, display of
photograph of a horse along with its
textual description makes illustration
more effective. Without the photograph,
it is very difficult to explain, how a horse
looks like through text only.
Audio
Audio is yet another important component of multimedia because in many
cases, audio can substantially reinforce our understanding of information
presented in other ways. In some cases, audio is the only way to provide
desired information. For example, in a multimedia application for education,
voice explanation can be added to an animation clip for describing what is
being shown, and pointing out what to look for that makes a horse’s gallop
different from a horse’s walk. It is nearly impossible to provide an accurate
description of horse’s neigh, lion’s roar, or bird’s chirp using text, and
graphics. Several audio formats including M4A, FLAC, MP3, MP4, WAV
etc. are mostly used to produce multimedia contents.
lion’s roar horse’s neigh bird’s chirp
166 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
Animation
Animation is an important component of
multimedia, because just as a picture is a
powerful way to illustrate information, a small
animation clip is even more powerful and useful
for illustrating concepts involving movement.
It is used commonly in advertisements, cartoon
films, and video games.
Video
Like animation, computer video deals with recording and display of a sequence
of images at a reasonable speed to create an impression of movement. Each
individual image of a sequence of images is called a frame. Like animation,
video is also an important component of multimedia because it is very useful
for illustrating concepts that involve movement.
Advertisement Cartoon film Video game
POINTS TO REMEMBER
Multimedia is the integration of multiple form of media.
Multimedia is made up of two words: ‘Multi’ and ‘Media’.
‘Multi’ means many and ‘Media’ means all the modes of communication.
Multimedia is defined as the combination of multiple media, such as text,
graphics, sound, animations, and video.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 167
Vedanta Let’s Log in Computer Science _ Book 7
Multimedia computer can play video and audio file.
Multimedia is used for various purposes like Education, Advertising, Playing
Games, Business, Watching Movies, Medicine, etc.
Too much time spent playing on computer, iPad games can make you dull.
Exercise
1. State whether the following statements are True or False:
a) Multimedia presents the information in more attractive and
effective way.
b) All computers can play or handle multimedia.
c) You cannot play audio or video on your computer.
d) Text is the primary component of multimedia.
e) Multimedia technology is used in limited areas.
f) The 3-D games we play on computer are examples of multimedia.
g) Multimedia helps to make advertisement more attractive.
h) Graphics is one of the multimedia components.
i) Multimedia computer can play one medium at a time.
2. Write the technical terms of the following:
a) The combination of text, graphics, audio, video and animation.
b) The moving images of real events.
c) The moving images of artworks.
d) Computer that has the capacity to play or create multimedia contents.
3. Answer the following questions:
a) What is multimedia? Explain it with some examples.
b) List out advantages of multimedia.
168 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
c) List out different components of multimedia.
d) Write any four application areas where multimedia is used.
e) Differentiate between animation and video.
Activity
1. Paste the pictures - Uses of multimedia in various fields.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 169
Vedanta Let’s Log in Computer Science _ Book 7
Lesson Concept of
14 Program Designing Tools
Introduction
As you know, computer is a versatile machine. It can perform various types of
functions in different areas like solving mathematically complex problems,
playing games, engineering design, making presentation, and many more.
House plan
Remember, computer cannot do anything by itself. It requires proper
instructions to do any task. These set of instructions are called computer
programs. These programs are written using a computer language.
Before writing any program, programmer needs to think over the necessary
steps that are required to solve any specific problem. Before building a house,
we need to design its map. Likewise, before writing a program, we need to
define the flow of program. This flow of program is called program logic.
A program logic helps programmer to develop good and correct program. To
design logic, we can use different program design tools, such as algorithm
and flowchart.
Algorithm
An algorithm is a sequence of procedures arranged in a specific order to
solve a problem. It is written in simple language.
170 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
Algorithm helps programmer to think logically and find out the best way to
solve a problem.
Persian scientist, astronomer and mathematician Abdullah Muhammad bin Musa
al-Khwarizmi created the term "Algorithm" in the ninth Century.
Advantages of Algorithm
It is written in simple English language.
It is easy to understand.
It is easy to write and modify.
Rules for Writing an Algorithm
Always begin with 'Start'.
Statement are written in steps as Step1, Step 2, and so on.
Language must be simple and understandable.
Each statement must be given in separate lines.
Finish the algorithm with 'Stop'.
An algorithm to take marks of a student in 5 subjects, calculate and print total marks:
Step 1 : Start
Step 2 : Take marks in 5 subjects as M1, M2, M3, M4, M5
Step 3 : Add all 5 marks and store as SUM
Step 4 : Print the value of SUM
Step 5 : Stop
Some Examples of Algorithm
Making a phone call to your friend:
Step 1 : Start
Step 2 : Pick up the receiver.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 171
Step 3 : Vedanta Let’s Log in Computer Science _ Book 7
Step 4 : Listen to the dial tone.
Step 5 : Dial your friend's number.
Step 6 : Say Hello
Step 7 : Talk to your friend.
Step 8 : Say Bye Bye, after talking.
Step 9 : Put down the receiver.
Stop
To save a document in Microsoft Word
Step 1 : Start
Step 2 : Click on File Menu.
Step 3 : Click on Save.
Step 4 : Choose the target folder.
Step 5 : Type Filename.
Step 6 : Click on Save.
Step 7 : Stop
Calculate the area of a room
Step 1 : Start
Step 2 : Read L and B as length and breadth.
Step 3 : Multiply L and B & store as A.
Step 4 : Print A.
Step 5 : Stop
172 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
Flowchart
A flowchart is the pictorial presentation of a program. It uses some standard
symbols to represent the operations.
Symbols of Flowchart
(1) Start/Stop Block
It is a rounded rectangle. It represents the start and end of the
flowchart.
Start Stop
Note: There must be only one Start and one Stop block in a flowchart.
(2) Input/Output Block
It is a parallelogram. It is used to show input and output.
Read A, B Print SUM
(3) Process Block
It is a rectangle. It is used to show the calculation part of the program.
SUM = A + B
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 173
Vedanta Let’s Log in Computer Science _ Book 7
(4) Decision Block
It is a diamond shaped block. It is used in condition.
Is Yes Print "Pass"
M>=40?
No
Print "Fail"
(5) Flow lines
It is an arrow-shaped symbol. It shows the direction of the flow of
instructions.
Start
174 Read A, B
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
Let's have a complete flowchart:
Start
Read A, B
SUM = A + B
Print SUM
Stop
The above flowchart illustrates the flow of program that reads any two
numbers from keyboard, calculates their sum, and display the result.
Some other examples of Flowchart: Start
Making a phone call to your friend Pick up the receiver
Listen to the dial tone
Dial your friend's number
Say Hello
Talk to your friend
Say Bye Bye, after talking
Put down the receiver
Stop
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 175
Vedanta Let’s Log in Computer Science _ Book 7
Calculate the area of a room
Start
Read L, B
A=L*B
Print A
Stop
Checks pass or fail
Start
Input M
Is
M>=40?
Print "Pass" Print "Fail"
Stop
Yes
176 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
POINTS TO REMEMBER
A program logic is the idea that tells how your program solves a particular
problem.
An algorithm is a step-by-step procedures written in simple English to solve a
problem
A flowchart is a diagrammatic representation of a program.
An algorithm or a flowchart is helpful in writing a good and correct program.
A flowchart uses different standard symbols to show the flow of program.
Exercise
1. Tick (√) the correct options:
a) ........................ defines the flow of program.
(i) Flowchart (ii) Algorithm
(iii) Program Logic (iv) Process
b) Step-by-step procedure of a program is ........................ .
(i) Program Logic (ii) Decision
(iii) Algorithm (iv) Flowchart
c) Pictorial representation of a program is ........................ .
i) Algorithm (ii) Program Logic
(iii) Graphics (iv) Flowchart
d) Input/output block is ............................... in shape.
i) square ii) rounded rectangle
iii) diamond iv) parallelogram
e) A rectangle-shaped block is used to show ............................... in a flowchart.
i) input ii) output
iii) process iv) decision
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 177
Vedanta Let’s Log in Computer Science _ Book 7
2. State whether the following statements are True or False:
a) A rectangular box is used for input and output.
b) A flowchart is a pictorial representation of a program.
c) An algorithm is written in a computer language.
d) Each flowchart can have more than one Stop block.
e) Flow lines connect the parts of a flowchart.
3. Fill in the blanks:
a) A flowchart is a .............................................. representation of a program.
b) A ........................ is used to represent input and output steps in a flowchart.
c) The ............................................ symbol is used for processing.
d) The rounded rectangle symbol is called ..................................... .
e) .......................... box is used to make decisions.
4. Answer the following questions:
a) What is an algorithm? What are the advantages of it?
b) What is a flowchart?
c) Draw a table to illustrate the various symbols of the flowchart with their uses.
Flowchart Symbols Uses
Practice Yourself
1. Write an algorithm and draw a flowchart for the following problems:
a) Find average of marks in 5 subjects.
b) Calculate simple interest
c) Calculate area of a rectangle
d) Find the greater number from any two numbers
178 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
2. Open Microsoft Word and draw the flowchart which you have
developed for the above question number 1(d) using different shape
tools.
Worksheets
1. Complete the crossword puzzle given below.
ACROSS DOWN
3 Flow of program. 1 Rectangular shape in flowchart.
6 I join the parts of a 2 Pictorial representation of a program.
flowchart.
4 Step-by-step solution of a problem.
5 I am used in decision-making in
flowchart.
1
2
3
45
6
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 179
Vedanta Let’s Log in Computer Science _ Book 7
2. Which of following statement(s) is/are true about the arrows used in
a flowchart?
a) Arrows show the direction of the flow in a program.
b) Arrows can be used to represent an output.
c) Arrows are used to show the sequence of the problem solving.
d) Arrows are used to connect the segments of a flowchart.
a. b. c. d.
3. Which of the following statement is not true about the flowchart?
(Tick the correct option)
a) Diamond shape is used for decision-making.
b) Square is used to represent process.
c) Parallelogram is used to represent input and output.
d) Ellipse is used at the beginning of the program.
a. b. c. d.
180 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
Lesson Programming in
15 QBASIC
Introduction to QBASIC
You have created document using MS-Word, prepared presentation slides
using MS-PowerPoint and played many games on computer. Do you
know how these software are created? These software are written using
a programming language like QBASIC, C, C++, Python, etc. This lesson
provides you with the basic idea of writing a program.
QBASIC is a popular and easy to learn high-level programming language.
This is a very user-friendly language. It provides the programming concept
for the beginners. The full form of QBASIC is Quick Beginner’s All-Purpose
Symbolic Instruction Code. In 1964, John G. Kemeny and Thomas E. Kurtz
designed the original BASIC language at Dartmouth College.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 181
Vedanta Let’s Log in Computer Science _ Book 7
Starting QBASIC
QBASIC may not be on your computer. At first, you need to have QBASIC
your computer. It is freely available. You can download it from Internet as
well.
QBASIC
In Windows XP,
Download QBASIC from
internet if you do not have on
your computer and save it in any
location inside your computer.
For instance, we have saved it
in D: drive with folder name
QBASIC.
Go inside the folder D:\
QBASIC and double click on
the file QB.EXE.
Now, you see the QBASIC window where you write QBASIC statements
to make your program.
In Windows 7, 8 or 10
Since the QBASIC is an old programming language, you cannot
directly open this version of QBASIC like in Windows XP. You
need to install an emulator program like DOSBox.
Use the following steps to run QBASIC using DOSBox:
1. Download DOSBox from
https://www.dosbox.
com
2. Install DOSBox by
simply double clicking on
the installation file.
3. After the installation of
DOSBox, its shortcut
icon appears on desktop.
182 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
4. Open the QBASIC folder and select the file QB.EXE.
5. Drag and drop on the icon of DOSBox on your desktop.
6. QBASIC opens inside DOSBox.
Features of QBASIC
It is a user-friendly language.
It is simple and easy to learn.
It capitalizes the reserved words automatically.
The syntaxes of the statements are checked automatically.
Your First Program
Run QBASIC and type the statements below:
PRINT “hello world”
END
Running (executing) your program.
Press on F5 button of your keyboard. Now, you see the output screen as
shown below:
64
This is a sample program to display the words “hello world” on the output
screen.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 183
Vedanta Let’s Log in Computer Science _ Book 7
Getting Out
If you need to leave QBASIC, you can click on "File" on QBASIC's menu and
then on "Exit".
Variable
A variable contains a peice of data kept on computer's memory (RAM). The
location of a variable in RAM is called the "address."
Constants
A constant is an entity that does not change, whereas a variable is an entity
that may change.
Example:
S = 64
64
S
Since the location whose name is S can hold different values at different
times. So, S is known as a variable. As against this, 64 does not change,
hence is known as constant.
184 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
Operators
Operators are the symbols or signs used to represent a particular
operation. An operation is a particular tasks such as addition, subtraction,
multiplication, division, etc.
Arithmetic Operators:
QBASIC has the provision to handle any complex arithmetic expression.
Certain arithmetic operators (or symbols) which are meaningful to the
computer are used to evaluate such arithmetic expressions. QBASIC uses
the following arithmetic operators:
Illustration of the Operators:
Operators Operation Example Result
Let A=10 and B=3
+ (Plus) Addition A+B 13
(Minus) Subtraction A–B 7
* (Asterisk) Multiplication A*B 30
/ (Slash) Floating Division A/B 3.333333
\ (Backslash) Integer Division A\B 3
Mod Modulus A mod B 1
^ (Caret) Exponential A^B 1000
QBASIC Statement
PRINT Statement
The PRINT statement is used to display message, number, or values stored
in the variable. on the monitor.
Syntax:
PRINT <Numeric Constant> or <"String Constant"> or <variable> or
<expression>
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 185
Vedanta Let’s Log in Computer Science _ Book 7
Example:
PRINT 12
Displays 12 on the monitor
PRINT "Nepal"
Displays Nepal on the monitor
PRINT "The value of N is ";N
Display the message "the value of N is " followed by the value of variable
N.
Some Other Ways of Using PRINT Statement
a) PRINT with comma (,)
This allows the printing of values one after another with plenty of
spaces in between.
Example: 1
PRINT "Ram","Naresh","Ranjita"
Output:
Example: 2
A=4
B=7
D=B-A
PRINT A, B, D
Output:
186 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
b) PRINT with semi-colon (;)
Semi-colon (;) is used to print the values one after another, without
any space in between for string value. It provides a space in between while
printing numeric values.
Example: 1
PRINT "Ram";"Naresh";"Ranjita"
Output:
Example: 2
A=5
B = 25
C = 10
PRINT A; B; C
Output:
c) PRINT with an expression
An expression is something the interpreter (QBASIC) calcualtes or
evaluates. You can display the result given by an expression using the
PRINT statement.
Example: 1
PRINT 2+4 – Displays 6
PRINT 10/5 – Displays 2
PRINT 5*8+8-7 – Displays 41
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 187
Vedanta Let’s Log in Computer Science _ Book 7
CLS Statement
This command is used to clear the screen. It makes the output screen
completely blank. This command is generally used before the start of any
program to get a fresh screen and any data left over from the previous
program is cleared completely.
Syntax and Example:
CLS
INPUT statement
The INPUT statement is used to ask a value from a user.
Syntax:
INPUT "Message", <variable>
Example:
INPUT "Type a number ",A
It asks a number from the user with a message "Type a number"
END statement
The END statement is generally used at the end of program. It tells the
interpreter(QBASIC) to terminate program.
Syntax and Example:
END
Let's see a complete program:
REM To find sum and difference
CLS
INPUT "Type first number "; A
INPUT "Type second number ";B
S=A+B
D=A-B
PRINT "Sum = ";S
PRINT "Difference = ";D
END
188 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
Output:
Sample Program in QBASIC
Write a program that asks your marks in English, Nepali and Computer
Science, and calculates your total marks and average marks.
Flowchart Program
Start
CLS
Input e, m, c
Total = e + m + c INPUT "Marks in 3 subjects";e,m,c
Average = Total/3 s=e+m+c
a=s/3
PRINT "Total Marks = ";s
PRINT "Average Marks = ";a
END
Print Average
Print Average
Stop
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 189
Vedanta Let’s Log in Computer Science _ Book 7
POINTS TO REMEMBER
QBASIC is a high-level programming language.
QBASIC stands for Quick Beginner’s All-Purpose Symbolic Instruction Code.
F5 key is used to run program in QBASIC.
A variable contains a piece of data kept in the computer's memory.
A constant is an entity that does not change.
Operators are the symbols or signs used to represent a particular operation.
An operation is a particular task such as addition, subtraction, multiplication,
division, etc.
QBASIC supports seven types of arithmetic operators: + (plus), - (minus), *
(asterisk), / (slash), \ (backslash), ^ (caret), and mod.
The PRINT statement is used to display output on the screen.
The INPUT statement is used to ask data from keyboard.
The CLS statement is used to clear the screen.
The END statement is used to terminate the program.
Exercise
1. Answer the following questions.
a) Define QBASIC.
b) Write down characteristic features of QBASIC.
c) Differentiate between variable and constant.
190 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
2. Tick (√) and write the correct answer:
a) QBASIC was developed in the year ............... .
i) 1965 ii) 1968
iii) 1970 iv) 1964
b) ............... is not a programming language.
i) QBASIC ii) Python
iii) MS-Word iv) C
c) A ............... is an entity that does not change during program execution.
i) Variables ii) Constant
iii) Operators iv) Statements
d) The ............... statement is used to terminate the program.
i) END ii) PRINT
iii) CLS iv) INPUT
e) The * (asterisk) operator is used for ....................
i) Addition ii) Multiplication
iii) Division iv) Subtraction
4. Write down the QBASIC code for the following problems:
a) A rectangular field is 15m long, 12m wide. Write a program to calculate its area.
b) Rina bought a bicycle at Rs. 4,350 and sold it at Rs. 5,200. Write a program to
calculate her profit percent.
c) Write a program that asks length, breadth and height of a room and calculates
its volume.
d) Write a program that asks the length of a table in feet and calculates its equivalent
length in inches [Hint: 1 feet = 12 inches].
e) Write a program that asks any two numbers and displays their sum, difference
and product.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 191
Vedanta Let’s Log in Computer Science _ Book 7
3. Complete the crossword given below:
ACROSS Statement used to read data from keyboard
1 An entity that does not change
4 Location of a variable
7 An emulator program
8
A programming language
DOWN Statement used to terminate a program
2 A symbol that represents an operation
3 Used to get remainder
5
6
12
45 6 3
7 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
8
192
Vedanta Let’s Log in Computer Science _ Book 7
Abbreviations
i. IBM : International Business Machine
ii. ASCC : Automatic Sequence Controlled Calculator
iii. ABC : Atanasoff Berry Computer
iv. ENIAC : Electronic Numerical Integrator and Calculator
vi. EDVAC : Electronic Discrete Variable Automatic Computer
vii. EDSAC : Electronic Delay Storage Automatic Computer
viii. UNIVAC : Universal Automatic Computer
ix. CPU : Central Processing Unit
x. IC : Integrated Circuits
xi. VLSI : Very Large Scale Integrated
xii. ULSI : Ultra Large Scale Integration
xiii. AI : Artificial Intelligence
xiv. Wi-Fi : Wireless Fidelity
xv. ECG : Electrocardiogram
xvi. HP : Hewlett Packard
xvii. www : World Wide Web
xviii. PC : Personal Computer
xix. OS : Operating System
xx. MS-DOS : Micro Soft Disk Operating System
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 193
Vedanta Let’s Log in Computer Science _ Book 7
xxi. NOS : Network Operating System
xxii. CUI : Character User Interface
xxiii. GUI : Graphical User Interface
xxiv. QBASIC : Quick Beginners All purpose Symbolic Instruction Code
xxv. ICT : Information Communication Technology
xxvi. SMS : Short Message Service
xxvii. MMS : Multimedia Message Service
xxviii. CD : Compact Disc
xxix. DVD : Digital Video Disc
xxx. UPS : Uninterruptible Power Supply
xxxi. NIC : Network Interface Card
xxxii. LAN : Local Area Network
xxxiii. MAN : Metropolitan Area Network
xxxiv. WAN : Wide Area Network
xxxv. ISP : Internet Service Provider
xxxvi. IP : Internet Protocol
xxxvii. FLAC : Free Lossless Audio Codec
xxxviii. JPEG : Joint Photographic Experts Group
194 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7 F.M.: 50
Model Question 1
COMPUTER SCIENCE
Class: VII
Time: 1.5 hrs.
Group ‘A’ – [25 marks]
‘READING & WRITING’
1) Answer the following questions. [5x2=10]
a) Write any four features of computer.
b) What is computer generation?
c) What is analog computer?
d) List the types of system software.
e) Define application software with its types.
2) Fill in the blanks. [6×0.5=3]
a) The fifth generation computer will be based on ................................ .
b) Pascaline was invented by................................ .
c) Software is a collection of ................................ .
d) ......................... is the topmost bar in MS-Word.
e) ......................... is a Volatile Memory.
f) Digital computer works on ......................... digits.
3) Select the best answer from the list of choices. [4×0.5=2]
a. Which one is the function of an operating system?
i) Memory management ii) Entertainment
iii) Word processing
b. The most powerful supercomputer is Sunway Taihulight from .........................
i) India ii) Germany iii) China iv) America
c. Computer which uses microprocessor is .........................................
i) Microcomputer ii) Supercomputer
iii) Mainframe computer iv) Mini computer
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 195
Vedanta Let’s Log in Computer Science _ Book 7
d. ......................... was the main component of the first generation computer.
i) Vacuum Tube ii) Microprocessor
iii) Biochip iv) Transistor
4) Write the technical term for the following: [2×0.5=1]
a) The number system having a base of 10.
b) Computer having features of Analog and Digital computer.
5) Match the following. [6×0.5=3]
Column ‘A’ Column ‘B’
a) Monitor i. Service of Internet
b) Printer ii. Temporary Memory
c) Transistor iii. Stores huge amount of data
d) E-Mail iv. Soft Copy Output
e) RAM v. Hard Copy Output
f) Hard Disk vi. Input Device
vii. Second Generation Computers
6) Write full forms of: [6×1=6]
a) CRT b) IBM c) ABC
f) IC
d) FTP e) ISP
Group ‘B’ – [12.5 marks]
‘ANALYTICAL’
7) What is a Word Processing application? Give an example. [1.5]
8) Write down any four parts of MS-Word window. [2]
9) Write down the technical term for the following. [5x1=6]
a) Hypertext documents on the Internet.
b) The ability of computers to think and learn.
196 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
c) Blinking line in the MS-Word screen that signifies the current position in the
document.
d) A tool or engine that lets us search for information by typing one or more
keywords.
e) A service of Internet that allows the exchange of messages and files between
computers digitally.
f) The first mechanical calculating device developed by the Chinese.
10) Choose the correct answer. [6×0.5=3]
a) Device used in First Generation Computers is ..................................................
i) Vacuum Tubes iii) Transistors
iv) IC Chip v) Bio Chips
b) Who is known as the First programmer?
i) Charles Babbage ii) Augusta Ada Lovelace
iii) Howard Aiken iv) Herman Hollerith
c) Google Chrome is an example of
i) Search Engine ii) Operating System
iii) Web Browser iv) Word Processor
d) Which of the following gives information about the document and provides
shortcuts for changing the view and zoom?
i) Menu Bar ii) Title Bar
iii) Status Bar iv) None of them
e) Collection of webpages is called ................................................
i) Hyperlink ii) Website
iii) Presentation iv) None of them
f) Which of the following is needed to connect to the Internet?
i) Modem ii) Ethernet Cables
iii) Broadband Connection iv) All of them
[‘12.5 marks for Internal Assessment’]
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 197
Time: 1.5 hrs. Vedanta Let’s Log in Computer Science _ Book 7
Model Question 2
COMPUTER SCIENCE
Class: VII
F.M.: 50
Group ‘A’ – [25 marks]
‘FUNDAMENTALS’
1) Answer the following questions: [5×2=10]
a. Define Files and Folders.
b. Define Multimedia. What are its components?
c. What is search engine? Name two popular search engines.
d. What is Computer ethics?
e. Define an operating system. Mention its two jobs.
2) Fill in the blanks: [6×0.5=3]
a. ................... refers to the development of the technology.
b. A computer system only understands ................... language.
c. Do not use computer to ................... other people.
d. ................... is predefined layout of Power point slide.
e. A ................... page is the main page of a website.
f. ................... is harmful computer program.
3) Write ‘True’ or ‘False’ for the following statements: [6×0.5=3]
a. The fifth-generation computer will be based on artificial intelligence.
b. Every computer needs to have own operating system.
c. Formula must start with “=” symbol in MS-Excel.
d. We should spread wrong and illegal information through computer.
e. Web documents contain graphics, sounds, text, and video.
f. The term "computer graphics" deals with images.
4) Give full forms of: [4×0.5=2]
a) HTML b) ICT c) GUI d) WWW
198 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science _ Book 7
5) Choose the correct answer: [4×0.5=2]
a. People visit website for .................... ii) Completing their task
i) Finding information iv) All of them
iii) Making communication
b. Charles Babbage developed ....................
i) Pascline ii) Analytical Engine
iii) Tabulating Machine iv) EDVAC
c. Which is the latest operating system of Microsoft?
i) Windows XP ii) Windows 7
iii) Windows 8 iv) Windows 10
e. ................... tool is used to crop an image.
i) Selection tool ii) Clone stamp tool
iii) Crop tool iv) Move tool
6) Convert as indicated: [3×1=3]
a) (31) into Binary b) (1101) into Decimal
10 2
c) (59) into Binary
10
8) Write down two major ways to prevent computer from viruses. [2]
Group ‘B’ – [12.5 marks]
‘ANALYTICAL’
9) Answer the following questions: [3×2=6]
a. What is Photoshop? Why iscomputer graphics an important area of study?
b. What is programming? List out two name of programming language.
c. Define an algorithm and flowchart.
10) Write an algorithm for saving MS-word document. [2]
11) List out the different symbols of a flowchart with their uses. [1.5]
12) How many types of operator does QBASIC provide? [3]
Give two/two examples for each.
[‘12.5 marks for Internal Assessment’]
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 199
Time: 1hr. 30min. Vedanta Let’s Log in Computer Science _ Book 7
Model Question 3
COMPUTER SCIENCE
Class: VII
F.M.: 50
Group ‘A’ – [25 marks]
‘READING & WRITING’
1) Answer the following questions: [5×2=10]
a) List out four features of the fifth generation computer.
b) What is a language translator? Write its types.
c) Define the operating system.
d) What is a web browser? Name any two popular web browsers.
e) Define the number system with its types.
2) Fill in the blanks: [6×0.5=3]
a) The monitor is .................... output device.
b) An operating system coordinates between hardware and ....................
c) A computer system only understands .................... language.
d) Binary number system has base ....................
e) MS-Word is .................... software.
f) .................... is a predefined layout.
3) Write ‘True’ or ‘False’ for the following statements. [6×0.5=3]
a) Tailored software is designed to perform maintenance work on computer.
b) Mainframe computer are more expensive than supercomputer.
c) Formula must start with ‘=’ sign in MS Excel
d) ARPANET was the first computer network.
e) Local Area Network is managed by a single organization.
f) We can save our file by using shortcut keys also.
4) Give the full form of the following abbreviation. [5×1=5]
a) IC b) HTTP c) AI d) IBM e) MS-DOS
200 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur