The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.
Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by Allstar Technology, 2020-07-31 07:43:04

Computer 6 correction file--2076 press

Computer 6 correction file--2076 press

Quick Learn

 These days, the use of multimedia is rapidly increasing.

 The use of multimedia in education can make the teaching and learning
activities interesting.

 In health sector multimedia technology and devices are used to diagnose
about the diseases.

 With the help of multimedia, we can record the music; create a video,
movies and animated documents.

 Virtual Reality (VR) is the use of computer technology to create a
simulated environment.

 To work with multimedia technology, we must have different types
of multimedia hardware and software.

 Windows Media Player, VLC Media Player, Real Time Player, etc. are the
popular media player software programmes.

Windows Media Player

It is a popular media player which is integrated
with all types of Windows Operating System.

Starting media player in Window 7
Click on the start button.
Choose all programs.
Select the windows media player option.
Now, you will get the windows media

player dialog box.

New Gateway to Computer Science Book-6 201

How to play music?
Click on the file menu and select open.

(Press ALT+F key to display the file menu.)
Select the location where your music and

video files are stored on the dialog box.
Double click on the required music

file or click on open button.

Now your music player will start to play the audio or video music that you
have selected.
Windows Volume controller
You can adjust the volume of the media player by
using the volume controller.

Right click on the volume or speaker (sound)
icon from the task bar, notification area.

Select the open volume mixer option from the
list.

Then you will get a dialog box with its
options.

Change the setting as per your requirement by
using the mouse pointer.

Close the volume controller dialog box after
you complete your task.

202 New Gateway to Computer Science Book-6

Evaluation Activities

1. Choose the best answer from the given alternatives.

a. Which of the following is related to multimedia?

i. Animation ii. Only text iii. Only audio

b. Which of the following is the component of multimedia?

i. Animation ii. Graphics iii. Both

c. Which of the following is a media player programme?

i. VLC media ii. PowerPoint iii. Photoshop

d. Which of the following is multimedia hardware?

i. Keyboard ii. Mouse iii. Audio

e. Which of the following component is required to insert text in multimedia
programme?

i. Animation ii. Text iii. Graphics

2. Fill in the blanks with suitable words/phrases.

a. ……………….. is interaction with multiple forms of media supported
by the computer.

b. The word ‘Multimedia’ is made up of two word ‘………………’ and
‘media’.

c. The use of multimedia in ……………….. can make the teaching and
learning activities interesting.

d. ………………. is the use of computer technology to create a simulated
environment.

e. Windows Media Player, VLC Media Player, Real Time Player, etc. are the
popular ………………. software programmes.

f. In ……………… sector multimedia technology and devices are used to
diagnose about the diseases.

3. State whether the following statements are true or false.

a. The most common multimedia machine consists of a PC with a digital
speaker unit and a CD-ROM.

b. Text, image, audio, video and animation are the most important components
of the multimedia.

New Gateway to Computer Science Book-6 203

c. Without the help of multimedia, we can record the music; create a video,
movies and animated documents.
d. To work with multimedia technology, we must have different types of
multimedia hardware and software.
e. These days, the use of multimedia is rapidly decreasing.
4. Write down a single technical term for the followings.
a. An integration of animation, audio, graphics, text, and full-motion
video through computer hardware and software used for various purposes.
b. It can be used in multimedia systems to express specific information,
or it can act as support for information contained in other media items.
c. It is a visual multimedia element which represent, such as a photo,
illustration, 3D or diagram.
d. It is the technology of electronically capturing, recording, processing,
storing and transmitting of images that show scenes in motion.
e. The movement of images.
5. Answer the following questions.
a. Define the term ‘multimedia’.
b. Mention any two advantages and disadvantages of the multimedia.
c. List out the components of the multimedia.
d. What are the application areas of the multimedia? List them out.
e. What is the role of the multimedia in education sector?
f. Write few lines about the ‘uses of the multimedia in entertainment’.
g. Define the multimedia hardware and software.
h. Name various types of multimedia player programmes that you know.
i. What is windows media player?

Project Work & Activity

a. Conduct a speech competition on the topic “Role of multimedia in health
sector”.

b. Make a project report about the situation of multimedia teaching approach
in your school.

c. Visit computer lab and play some songs and watch some movies with the
help of any media player programme.

204 New Gateway to Computer Science Book-6

Computer Programming

Unit

4

This unit covers the following Lessons.

Lesson 15 Basic concept of Programming language
Lesson 16 QBASIC statements.

15Lesson Basic Concept of
Programming Language

Learning Objectives

At the end of this lesson, the students will be able to:
• define the Programmeming language.
• introduce Qbasic Programmeming.
• tell the features of Qbasic Programmeming.
• describe about the Qbasic editor screen.
• explain about the Qbasic elements.
• write about the operators used by Qbasic.

Lets Update

• The first high-level Programmeming language was Plankalkül, created
by Konrad Zuse between 1942 and 1945.
• The first commercially available language was FORTRAN
(Formula Translation); developed in 1956 AD.

Introduction

A programming language is a notation for writing programmes. A computer
programme is a collection of instructions that performs a specific task when executed
by a computer. A computer requires programmes to function, and typically executes
the programmes instructions in a central processing unit. A computer programme
is usually written by a computer programmer in programming language.

A computer does not understand any language accept machine language. The
data and instruction given to the computer in the user language must be translated
into machine language to understand by the computer. Translation of computer
language is possible with the help translator programmes only. There are three
types of language translators and they are compiler, interpreter and assembler.

206 New Gateway to Computer Science Book-6

QBAISC Programmeing

QBasic is a high level Programming language developed by Microsoft
Corporation in 1985. It is modular Programming language where programme is
divided in different modules or procedures. Qbasic is easy to learn. It uses English
like keywords and mathematical symbols to write a programme. QBasic has two
types of window on a same screen. They are programme window and immediate
window.

Program Window: The upper window which is titled as ‘Untitled’ is the
window where you write programmes. This window is called program window.
To see the output of the statements written in this window, you can press Shift
+ F5 key.

Immediate Window: The lower window which is titled as ‘Immediate’ is
known as Immediate Window. It is the window to test commands, expressions,
etc. As soon as the Enter key is pressed, it displays the output on the screen.

Features of QBasic

It is simple and easy to learn.
It checks syntax automatically.
It capitalizes the reserved words (keywords) automatically.
It allows you to break lengthy programmes into modules.
It interprets a statement of a programme at a time to CPU.
It has dynamic programme debugging feature.
It supports local and global variables.

Loading QBASIC

QBASIC Programming language consists of two files: QBASIC.EXE and QBASIC.
HLP. Normally these files are found in a folder named ‘QBASIC’ which is in drive
C: or may in other drive where you have saved.

New Gateway to Computer Science Book-6 207

To start QBASIC, follow these steps.
Click on the Start button.
Point to All programs and then Accessories.
Select Command Prompt. It displays Command Prompt Window.
To move to the root directory, at DOS prompt, type CD\ and press the Enter

key.
At C:\> prompt, type CD QBASIC and press the Enter key.
At C:\ QBASIC> prompt, type qbasic and press the Enter key. It will display

QBASIC welcome screen as below.
Press the Esc key to get the QBASIC editor screen.

208 New Gateway to Computer Science Book-6

Quick Learn

 A programming language is a notation for writing programmes.

 A computer pogram is a collection of instructions that performs specific
task when executed by a computer.

 A computer programme is usually written by a computer programmer in
programming language.

 A computer does not understand any language accept machine language.

 Translation of computer language is possible with the help translator
programmes only.

 There are three types of language translators and they are compiler,
interpreter and assembler.

 QBasic is a high level programming language developed by Microsoft
Corporation in 1985 AD.

 QBASIC is a modular programming language where programme is
divided in different modules or procedures.

 QBasic has two types of window on a same screen they are programme
window and immediate window.

Qbasic Editor screen

QBASIC editor is the working window where you write Programmes. The editor
provides all the facilities to write programmes and editing them. QBASIC Editor
Screen has the four parts. They are:

a. Menu Bar b. Programme Window

c. Immediate Window d. Status Bar

Menu Bar

Menu Bar has various lists of commands like File, View, Search, Run, Debug,
Options and Help. These menus also have some subcommands such as New, Open,
Save, Save as, print, Exit. The functions of file menu and view menu options are
presented in the given table.

New Gateway to Computer Science Book-6 209

Menu option Function
New To start a new Qbasic editor screen.
Open To load a programme from the memory location.
Save To save the current programme to the storage media.
Save as To save the file under new name.
Print To print the selected text.
Exit To close the Qbasic programme.

Edit menu options

Menu option Function
Cut To remove the selected text from the one location and
move it to the another location.
Copy To make the duplicate copy of the text.
Paste To place the text after using cut and copy options.
Clear To remove the text without storing it to the clipboard.

Program Window

The upper window which is name as ‘Untitled’ is the window where you write
programmes is called program window. To see the output of the statements written
in this window, you need to press Shift + F5 key together.

Immediate Window

The lower window which is named as ‘Immediate’ is known as Immediate Window
where you can test commands, expressions, etc. This windows displays the output
on the screen when your press the enter key.

Status Bar

The status bar shows short cut keys and the location of the cursor on the screen.

Running Programme

To see the output of the programme you need to run a programme. When you run a
programme QBASIC converts and directs each statement of a programme at a time
to the CPU. You can press Shift + F5 key together to run a programme.

210 New Gateway to Computer Science Book-6

Saving Qbasic Programme

You need to save a programme for the future use. To save a programme, follow
these steps:

Click on the File menu.
Move the mouse on the Save As Option.
Press the Enter key. It displays the Save dialog Box.
Type the required file name on the filename text box.
Press the Enter key to save the file.

Clearing the Programme windows

If you want to write a new programme, you need to remove the previous programme
from the program window. To clear or remove the previous Programme, you can
use the given steps.

Press the ALT key.
Highlight the New option and press the Enter key. OR. Press F, N keys.

Opening a Programme

To open an existing programme in the program window, follow these steps.
Click on the file menu.
Click on the open option.
Select a programme file from the list of files displayed in the Open dialog

box.
Press the Enter key to open the file.

New Gateway to Computer Science Book-6 211

To exit from the Qbasic Programme

To exit from the QBASIC, you can use the following steps.
Click on the File menu.
Move the mouse pointer on the Exit option.
Click on the Exit to quit from the Qbasic programme.

Quick Learn

 QBASIC editor is the working window where you write programmes.
 Menu bar has various of list of commands like File, View, Search, Run,
Debug, Options and Help.
 The status bar shows short cut keys and the location of the cursor on the
screen.
 If you want to write a new programme, you need to remove the previous
programme from the program Window.
 The upper window which is titled as ‘Untitled’ is the window where you
write programme is called program window.
 The lower window which is titled as ‘Immediate’ is known as Immediate
Window.

Elements of QBASIC

Every programming language consists of some basic elements which are
required to make a programme. The element required to construct a QBASIC
programme consists of a set of characters, keywords, constants, variables, operators
and expressions.
Character set
A set of characters that are allowed to use in QBASIC is known as the QBASIC
Character set. The QBASIC Character set consists of alphabets (both small and
capital), numbers (0 to 9) and special characters. These special characters have
their own meaning and function. Some of the special character sets are = , + , - * ,
/ , * , ( ), % , #, !,&, <> , etc.

212 New Gateway to Computer Science Book-6

Keyword

Keywords are those words which have special meanings in QBASIC. Keywords are
formed by using characters of QBASIC characters set. Keywords are statements,
commands, functions and names of operators. The keywords are also called
reserved words. Some reserved words are CLS, REM, INPUT, LET, PRINT, FOR,
DO, SELECT, MID$, ASC, SQR, LEN, LEFT$, TIME$, INT, etc.

Constants

Constants are the data or the values in a programme that cannot be changed during
the programme execution. The data may be a letter, words, numbers, or special
characters. A constant can be stored in a variable when it is required to use in more
than one statement or expression. In QBASIC, these data /constants are grouped
into two main categories. They are:

a. String Constant

b. Numeric Constant

String Constant

String Constant is a letter, words, numbers, combination of letters with numbers or
special characters enclosed in double quotes. Mathematical operations cannot be
performed on String Constants.

“A”, “SHUBHARAMBHA”, “ROll NO:50105”, “Welcome to QBASIC!!!”, etc.
are some examples of sting constants.

Numeric Constant

Numeric Constant refers to a number. A number with or without decimal point is a
numeric constant. Thousand separators are not allowed to use in numeric constant.
Numeric data should not be enclosed in double quotes. Mathematical operations
and logical operations can be performed on the numeric constants. 5010, 205.50,
420, 423945, etc. are some examples of numeric constants. Numeric Constants
may be integer, long integer, single precision or double precision.

Integer: Integer is whole number between -32768 to 32767.

Long Integer: Long Integer is a large range of whole number.

Single Precision: Single Precision is seven digit or less than seven digit positive
or negative number that contains decimal point. Single Precision can be in the
exponential form using E or with a trailing exclamation point. (!). 564, 78.65,
1.2 E-06 and 12345.678! are some examples of single precision constants.

New Gateway to Computer Science Book-6 213

Double Precision: Double Precision is 17 digit or less than 17 digit positive
or negative numbers that contains decimal point. Double Precision can be in
the exponential form using D or with trailing hash sing (#). 9999.99D-12,
2345.786# and 3456.78 are some examples of double precision constants.

Variable

Variables are the named storage location whose contents can be changed. A value
of a variable can be changed during the execution of the programme. In a computer
memory, there may be many data. So, you need to tell the computer to use only
those data which you want to use in a programme. This is possible if you assign a
name to the place where you have stored a data. In QBASIC, you can perform this
task by using a variable. A variable is an entity that stores data needed to be used
in a programme. Each programme defines different number of variables. There are
mainly two types of variables. They are:

a. String Variable

b. Numeric Variable

A string variable stores string data. Its types declaration sign is dollar ($). A numeric
variable stores numeric data. A numeric variable can be Integer, Long Integer,
Single Precision or Double Precision variables.

Quick Learn

 An integer variable can store only an integer number. Its type
declaration sign is percentage (%).
 A long integer variable can store a large range of whole number. Its
type declaration sign is ampersand (&0).
 A single precision variable can store a whole number as well as
number with decimal. Its type declaration sign is exclamation sign
(!).
 You can use single precision variable without declaration sign. It is
the default numeric variable.
 A double precision variable also stores a whole number as well as
number with decimal point. Its type declaration sign is hash (#).

214 New Gateway to Computer Science Book-6

Rules for naming a variable

a. Variable names can have maximum of 40 characters.

b. Variable names can have alphabets, numbers and decimal point.

c. A variable name must begin with a letter.

d. Variable names cannot be reserved words.

e. Variable names may be ended with type declaration characters like $, %, &, !,
and #.

Note Naam$, Address$, Bookname$, etc., are examples of sting
varibales. Like this Salary!, Age%, Mark, Num1, Num2, FirstNum,
RollNumber, etc., are examples of numeric variables.

Qbasic Operators

An operator is a symbol which tells the computer to perform certain mathematical
and logical calculation. These are the special symbols or words used to describe an
operation or an action which is to be performed between two or among more than
two values.

Types of operator
Mathematical Operators / Arithmetic Operators

Relational Operators

Logical Operators

Mathematical Operators/ Arithmetic Operators
The following are the mathematical operators used in Qbasic.

Operators Meaning Example
+ Addition 2+2
- Subtraction 3+2
* Multiplication 3*2
/ Division 5/2
\ Integer division (It gives the integer value) 10\2
MOD Modulus (It gives remainder) 11 MOD 2
^ Exponent 5^2

New Gateway to Computer Science Book-6 215

Relational Operator

The following are the relational operators used in Qbasic.

Operators Meaning Example
< less than 2<3
> greater than 5>2
<= less than or equal to 2<=3
>= greater than or equal to 2>=2
= equal to 2=2
<> not equal to 3<>2

Logical Operator

The following are the logical operators used in Qbasic.

Operators Meaning Example
Logical AND A>B AND A> C
AND Logical OR A>B OR A> C
OR Logical NOT A NOT B
NOT

Expressions

An expression is the combination of operators, constants and variables that is
evaluated to get a result. The result of the expression is string data, numeric data
or logical value (true or false) and can be stored in a variable. For example, the
following are expressions in QBASIC.

(A + B) > C

A>=B+C

u* t + ½*a*t^2

An arithmetic expression may contain more than one operator. While evaluating
such expressions, a hierarchy is followed. The hierarchy in arithmetic operations
is listed as given below:
a. Exponentiation (^)
b. Negation (-)
c. Multiplication and division

216 New Gateway to Computer Science Book-6

d. Integer division
e. Modular division

f. Addition and Subtraction

Compare between algebraic expression and Qbasic expression

Algebraic Expression Qbasic Expression
A*B
A×B
2ab + 3ab - 4 2*a*b + 3*a*b – 4
(a+b+c) / (2*a*b)
a+b+c
2ab A^2 + 2*a*b + b^2
(3*b*c)^2
A2 + 2ab + b2
(3bc)2

Quick Learn

 A set of characters that are allowed to use in QBASIC is known as the
QBASIC character set.

 The QBASIC character set consists of alphabets (both small and capital),
numbers (0 to 9) and special characters.

 Keywords are those words which have special meanings in QBASIC.

 Keywords are formed by using characters of QBASIC characters set.

 Constants are the data or the values in a programme that cannot be changed
during the programme execution.

 Variables are the named storage location whose contents can be changed.

 A value of a variable can be changed during the execution of the
programme.

 An operator is a symbol which tells the computer to perform certain
mathematical and logical calculation.

 An expression is the combination of operators, constants and variables
that is evaluated to get a result.

New Gateway to Computer Science Book-6 217

Evaluation Activities

1. Fill in the blanks with suitable answer.

a. A …………………… language is a notation for writing programmes.

b. A computer programme is usually written by a computer ……………….. in
programming language.

c. ………………….. of computer language is possible with the help translator
programmes only.

d. QBasic is a high level programming language developed by Microsoft
Corporation in …………………….

e. QBasichastwotypesofwindowonasamescreentheyareprogrammewindow
and ……………………. window.

f. ……………. bar has various of list of commands like File, View, Search,
Run, Debug, Options and Help.

g. The lower window which is titled as ……………………… is known as
Immediate Window.

h. A set of characters that are allowed to use in QBASIC is known as the
QBASIC ……………………….. Set.

i. ………………….. are the data or the values in a programme that cannot be
changed during the programme execution.

j. An…………………….. is a symbol which tells the computer to perform
certain mathematical and logical calculation.

2. State whether the following statements are true or false.

a. A computer programme is a collection of instructions that performs a specific
task when executed by a computer.

b. A computer does not understand any language accept natural language.

c. There are only two types of language translators and they are compiler and
assembler.

218 New Gateway to Computer Science Book-6

d. QBASIC is a modular programming language where programme is
divided in different modules or procedures.

e. QBASIC editor is the working window where you write programmes.

f. The title bar shows shortcut keys and the location of the cursor on the
screen.

g. The upper window which is titled as ‘Untitled’ is the window where you
write programme is called programme window.

h. Constants are the named storage location whose contents can be changed.

i. A value of a variable can be changed during the execution of the
programme.

j. An operator is the combination of operators, constants and variables that is
evaluated to get a result.

3. Convert the following algebraic expression into QBASIC
expression.

a. (A+B)2 (A-B)3 (A× B)5

b. a2+2ab+b2

c. P×1T0×0 R
d. 5ab2+6bd2⎯10

4. Complete the following table.

Name of Operators Meaning
< ………………..
………………. greater than
<= ………………….
……………… greater than or equal to
= ………………
…………… not equal to

New Gateway to Computer Science Book-6 219

5. Write down the function of the following menu options.
New , Open , Save as , Print , Copy, Paste
6. Answer the following questions.
a. What is a programming language?
b. Which language can a computer understand?
c. What is QBASIC programming? Name any two programming
windows.
d. Write any six features of QBASIC language.
e. What is a QBASIC editor screen? Write its parts.
f. List out the elements of QBASIC programming.
g. Define variables and constants with its types.
h. What is an operator? Name some QBASIC operators.
i. Write down the various symbols used by arithmetic and relational operators
of QBASIC.
j. Define character set, keywords and expressions.

Project Work & Activity

a. Prepare a chart about the types of operators used in QBASIC Programme in
details.
b. Visit computer lab and observe the QBASIC editor screen with its two
windows.

220 New Gateway to Computer Science Book-6

16Lesson QBASIC Statement

Learning Objectives
At the end of this lesson, the students will be able to:

• explain the various the statements used by Qbasic Programmeming.
• practise on QBASIC programming.

Lets Update

• QBasic was intended as a replacement for GW-BASIC.
• QBasic 1.1 is included with MS-DOS 6.x, and, without EDIT, in
Windows 95, Windows 98 and Windows Me.
• QB64 was originally compiled with Quick BASIC 4.5

Introduction

A Qbasic statement is a set of instructions written by using keywords or
commands of QBASIC. Every programming language uses keywords as a
statement with certain syntax. The keywords have specific meaning in the
QBASIC programming. The statements are first stored in the memory and
executed only when the RUN command is given. Some of the Qbasic statements
are explained below.
Qbasic Statements

CLS Statement

The CLS statement clears the screen. If you write CLS statement in the middle of
the programme then you cannot see the outputs generated before execution of CLS
because it clears the screen.
Syntax: CLS

New Gateway to Computer Science Book-6 221

LET Statement

LET is an assignment statement. It is used to assign the value to a variable. LET is
an optional statement.

Syntax:|LET| variable = value or expression

Example:

CLS

INPUT “First Number”; A

INPUT “Second Number”; B

LET SUM = A+B

PRINT “The Sum is”; SUM

END
REM Statement

It is a basic declaration statement that allows to insert explanatory remarks in
a programme. Adding comments in the programme allows us to remind about
the programme and also helps other programmers to understand the logic of the
programme.

Syntax: REM < Remarks>

Example:

CLS

PRINT “Sample text.”

REM This text is ignored.

REM This Programme clears the output screen.
PRINT Statement

The PRINT statement provides output on the screen. It prints the values of the
expression on the screen. We can use semicolon (;) and comma (,) with a print
statement which results differently than a normal PRINT statement.

Syntax: PRINT [“Message”]; expression

222 New Gateway to Computer Science Book-6

Example:
CLS
PRINT "We are learning Qbasic."

PRINT "Learning Qbasic is fun." Output

PRINT "9851059651" We are learning Qbasic.
Learning Qbasic is fun.
PRINT "The number is: "; 60
9851059651
END The number is: 60
Input Statement

This statement takes the data from the user of the programme during the run time.
The user gives the data that is assigned to a variable.

Syntax: INPUT [“Message”]; variables

Example:
CLS
INPUT "Enter your name"; N$
INPUT "Enter your age"; A
INPUT "Enter your city"; C$
INPUT "Enter your phone number"; P
END
End Statement

This statement is used to terminate execution of a programme. When the computer
reads the end statement, it stops reading lines and print the message: press any key
to continue. End statement is always written at the last of the programme.

Syntax: END

New Gateway to Computer Science Book-6 223

Programming on QBASIC

Practice the given programme sample in your computer lab and observe the output
on the screen. Also write the output on the box provided.

Sample: 1

Write a programme to enter your name and print it. Output Box
CLS

Input “Enter you name” ;n$

Print “My name is” ;n$

End

Sample: 2

Write a programme to enter your name, address, country, age and print them.

CLS Output Box
Input "Enter your name" ; N$

Input "Enter your address" ; C$

Input "Enter your country" ; CO$

Input "Enter your age" ; A

Print "My name is" ; N$

Print "My city is " ; C$

Print "My country is" ; CO$

Print "My age is" ; A

END

224 New Gateway to Computer Science Book-6

Sample: 3

Write a programme to find the sum of any three numbers. Output Box
CLS

Input “Enter the first number” ; a

Input “Enter the second number” ;b

Input “Enter the third number” ;c

LET SUM = a+b+c

PRINT “The total sum is”; SUM

END

Sample: 4

Write a programme to find the sum and difference of any two numbers.

CLS Output Box
Input “Enter the first number” ; a

Input “Enter the second number” ; b

LET SUM = a+b+c

LET DIF = a-b

PRINT “The total sum is”; SUM

PRINT “The difference is”; DIF

END

Sample: 5

Write a programme to find the area of rectangle.

CLS

Input "enter the length" ;l

Input "enter the breadth" ;b

New Gateway to Computer Science Book-6 225

let A = l*b Output Box
Print "The area of rectangle=” ;A
End

Sample: 6 Output Box
Write a programme to find the area of the triangle. Output Box
CLS
Input “enter the base” ;b
Input “enter the height” ;h
let T = 1/2*b*h
Print "The area of triangle=” ;T
End
Sample: 7
Write a programme to find the area of the circle.
CLS
Input “Enter the radius” ;R
Let C=22/7*R^2
Print “The area of circle =” ;C
End

Sample: 8
Write a programme to find the circumference of the circle.
CLS
Input “Enter the radius” ;R

226 New Gateway to Computer Science Book-6

Let Circum=22/7*R*2 Output Box
Print “The area of circle =” ;Circum
End

Sample: 9

Write a programme to find the area of the square. Output Box
CLS

Input “Enter the number” ;n

Let square= n^2

Print “The area of square=” ;Square

End

Sample: 10

Write a programme to find the area of the square and cube.

CLS Output Box
Input “Enter the number” ;n
Let square= n^2
Let Cube = n^3
Print “The area of square=” ;Square
Print “The area of cube=” ; Cube
End

Sample: 11

Write a programme to find the volume of the box.

CLS

Input “enter the length”;l

New Gateway to Computer Science Book-6 227

Input “enter the breadth” ;b Output Box
Input “enter the height” ;h
Let Volume= l*b*h
Print “The volume of box =” ;Volume
End

Sample: 12 Output Box
Write a programme to find out the simple Interest.
CLS

Input “Enter the Principal”;P

Input “Enter the Rate”;R
Input “Enter the Time”;T
Let Interest = P*T*R/100
Print “The simple Interest = ”;Interest
End

Sample: 13
Write a programme to enter any three numbers and find out the sum and average.

CLS Output Box
Input “Enter any number” ;A
Input “Enter any number” ;B
Input “Enter any number” ;C
Let Sum = A+B+C
Let Average =Sum/3
Print “sum=” ;Sum
Print “Average is" ;Average
End

228 New Gateway to Computer Science Book-6

Sample: 14

Write a Programme to input student’s name, marks obtained in four different
subjects,find the total and average marks.

CLS Output Box
Input “Enter the name ” ;N$
Input “Enter the marks in English” ;E
Input “Enter the marks in Maths” ;M
Input “Enter the marks in Science” ;S
Input “Enter the marks in Computer” ;C
Let SUM = E+M+S+C
Let AVG =S/4
Print “The name of the student is” ;N$
Print “The total marks is” ;SUM
Print “The Average marks” ;AVG
End

Quick Learn

 A Qbasic statement is a set of instructions written by using keywords or
commands of QBASIC.
 Every programming language uses keywords as a statement with certain
syntax.
 The CLS statement clears the QBASIC editor screen.
 LET is an assignment statement which is used to assign the value to a
variable.
 REM statement allows to insert explanatory remarks to be inserted in a
programme.
 PRINT statement provides output on the screen.
 INPUT statement takes the data from the user of the programme during the
run time.

 END statement is used to terminate execution of a programme.

New Gateway to Computer Science Book-6 229

Evaluation Activities

1. Fill in the blanks with suitable words/phrases.
a. Every programming language uses ………… as a statement with certain
syntax.
b. …………… is an assignment statement which is used to assign the value to
a variable.
c. ……………… statement provides output on the screen
d. …………..statement is used to terminate execution of a programme.
2. State whether the given statements are true or false.
a. A Qbasic statement is a set of instructions written by using keywords or
commands of QBASIC.
b. The REM statement clears the QBASIC editor screen.
` c. CLS statement allows to insert explanatory remarks to be inserted in a
Programme.
d. PRINT statement takes the data from the user of the Programme during the run
time.
3. Answer the following questions.
a. What is QBASIC statement?
b. Name any four QBASIC statements.
c. What is the function of REM statement? Write with syntax.
d. What is the function of INPUT statement? Write with syntax.
e. Write down the syntax of PRINT statement.

230 New Gateway to Computer Science Book-6

4. Write a simple QBASIC programme to do the following task.

a. To find out the sum of any three numbers.

b. To find the sum, product and differences of any two numbers.

c. To calculate the simple interest where principle amount, time and rate
has been given.

d. To find out the sum and average of any five numbers.

e. To calculate total marks, percentage and average of any seven subjects
where the full marks is allocated 100 for each subjects.

New Gateway to Computer Science Book-6 231

Brainwave Quiz

1. The capacity of 3.5 inch floppy disk is ……………

a. 1.40 MB b. 1.44 GB

c. 1.40 GB d. 1.44 MB

2. The first computer introduced in Nepal was ……………

a. IBM 1400 b. IBM 1401

c. IBM 1402 d. IBM1402

3. WAN stands for ……………

a. Wap Area Network b. Wide Area Network

c. Wide Array Net d. Wireless Area Network

4. MICR stands for ……………

a. Magnetic Ink Character Reader b. Magnetic Ink Code Reader

c. Magnetic Ink Cases Reader d. None

5. FORTRAN is ……………

a. File Translation b. Format Translation

c. Formula Translation d. Floppy Translation

6. EEPROM stand for ……………

a. Electrically Erasable Programmable Read Only Memory

b. Easily Erasable Programmable Read Only Memory

232 New Gateway to Computer Science Book-6

c. Electronic Erasable Programmable Read Only Memory

d. None of the above

7. Second Generation computers were developed during ……………

a. 1949 to 1955 b. 1956 to 1965

c. 1965 to 1970 d. 1970 to 1990

8. The computer size was very large in ……………

a. First Generation b. Second Generation

c. Third Generation d. Fourth Generation

9. Microprocessors as switching devices are for which generation computers?

a. First Generation b. Second Generation

c. Third Generation d. Fourth Generation

10. Which of the following devices can be sued to directly image printed text?
a. OCR b. OMR c. MICR d. All of above

11. The output quality of a printer is measured by ……………

a. Dot per inch b. Dot per sq. inch

c. Dots printed per unit time d. All of above

12. In analog computer ……………
a. Input is first converted to digital form
b. Input is never converted to digital form
c. Output is displayed in digital form
d. All of above

New Gateway to Computer Science Book-6 233

13. In latest generation computers, the instructions are executed……………

a. Parallel only b. Sequentially only

c. Both sequentially and parallel d. All of above

14. Who designed the first electronics computer – ENIAC?

a. Van-Neumann b. Joseph M. Jacquard

c. J. Presper Eckert and John W Mauchly d. All of above

15. Who invented the high level language c?

a. Dennis M. Ritchie b. Niklaus Writh

c. Seymour Papert d. Donald Kunth

16. A computer Programme that converts an entire Programme into machine
language is called a/an

a. Interpreter b. Simulator c. Compiler d. Commander

17. Acomputer programme that translates one programme instructions at a time into
machine language is called a/an ……………

a. Interpreter b. CPU c. Compiler d. Simulator

18. As compared to diskettes, the hard disks are ……………

a. More expensive b. More portable

c. Less rigid d. Slowly accessed

19. Floppy disks which are made from flexible plastic material are also called.....?

a. Hard disks b. High-density disks

c. Diskettes d. Templates

234 New Gateway to Computer Science Book-6

20. Regarding a VDU, Which statement is more correct?
a. It is a processing device b. It is an input device
c. It is a peripheral device d. It is software item
21. What is the name of the computer terminal which gives paper printout?
a. Display screen b. Soft copy terminal
c. Hard copy terminal d. Plotter
22. Dot-matrix is a type of ……………
a. Tape b. Printer c. Disk d. Bus
23. The two kinds of main memory are:
a. Primary and secondary b. Random and sequential
c. ROM and RAM d. All of above
24. What is the shortcut key to “undo” the last action in a document?
a. CTRL + X b. CTRL + Y c. CTRL + Z d. CTRL+C
25. Which of the following memories needs refresh?
a. SRAM b. DRAM c. ROM d. All of above
26. Which of the following devices can be used to directly input printed text?
a. OCR b. OMR c. MICR d. All of above
27. The personnel who deals with the computer and its management put together
are called ……………
a. Software b. Human ware c. Firmware d. Hardware

New Gateway to Computer Science Book-6 235

28. The brain of any computer system is ……………

a. ALU b. Memory c. CPU d. Control unit

29. Each model of a computer has a unique ……………

a. Assembly of a computer b. Machine language

c. High level language d. All of the above

30. Computer professionals working in a computer centre are ……………

a. Software b. Firmware c. Hardware d. Humanware

31. Which of the items below are considered removable storage media?

a. Removable hard disk cartridges b. (Magneto-optical) disk

c. Flexible disks cartridges d. All of the above

32. Which term is used to describe RAM?

a. Dynamic RAM (DRAM) b. Static RAM (SRAM)

c. Video RAM (VRAM) d. All of the above

33. Which file in MSDOS contain internal command that are loaded during
booting process?

a. Io.sys b. Msdos.sys c. Command.com d. Config.sys

34. Which is the valid filename assign in MS-DOS?

a. Ram*.txt b. Ram?.doc c. Ram_$.txt d. None of above

35. Which is valid extension that user creates on operating system?

a. Exe b. Com c. Sys d. Bat

236 New Gateway to Computer Science Book-6

36. Which switch should be used in the DIR command to view files in all
directories?

a. /p b. /w c. /s d. /l

37. Which type of command in DOS needs additional files for their execution?

a. Internal commands b. External commands

c. Batch commands d. Redirectors

38. Which was the last version of MSDOS that was released separately?

a. 5.0 b. 6.0 c. 6.11 d. 6.22

39. Which of the following operating does not implement multitasking truly?

a. Windows 98 b. Windows NT c. Windows XP d. MS DOS
40. What is the name of the latest server operating system developed by
Microsoft?
a. Windows NT b. Windows 2000
41. How many steps are there between Start and Finish in AutoContent Wizard?
a) 3 b) 4 c) 5 d) 6
42. Which short cut key inserts a new slide in the current presentation?
a) Ctrl+N b) Ctrl+M c) Ctrl+S d) All of above
43. What happens if you select first and second slide and then click on New Slide
button on the toolbar?
a. A new slide is inserted as first slide in presentation
b. A new slide is inserted as second slide in presentation
c. A new slide is inserted as third slide in presentation
d. None of above

New Gateway to Computer Science Book-6 237

44. Which of the following method can insert a new slide in the current
presentation?

a. Right click on the Slide panel and choose New Slide

b. From Insert menu choose New Slide

c. Click on New Slide button on toolbar

d. All of above

45. Which of the following is not a part of Slide Design?

a. Design Template b. Color Scheme c. Animation Scheme d. Slide Layout

46. What is the best way to create another copy of a slide?

a. Click the slide then press Ctrl+A and paste in new slide

b. From Insert Menu choose Duplicate Slide

c. Redo everything on a new slide that you had done on previous slide

d. None of above

47. From which menu you can access Picture, Test Box, Chart etc?

a. File b. Edit c. Insert d. View

48. If you want to insert some slides from other presentation into current one
choose ……………

a. From Insert menu choose Slides from Files

b. From Insert menu choose Slides from Presentation

c. From Insert menu choose Slides

d. None of above

49. What are the three options available in the Insert >> Picture menu?

a. Clipart, Pictures, Shapes c. Clipart, From File, Shapes

b. Clipart, From Files, AutoShapes d. Clipart, Pictures, AutoShapes

238 New Gateway to Computer Science Book-6

50. To insert slide numbers ……………
a. Insert a text box and select Insert >> Page Number
b. Insert a textbox and select Insert >> Number >> PageNumber
c. Choose Insert >> Slide Number
d. Insert a new text box and select Insert >> slide Number
51. In a PowerPoint presentation ……………
a. Sound clips can be inserted but not movie clips
b. Movie clips can be inserted but not sound clips
c. Both cannot be inserted

d. Both can be inserted

52. To insert a hyperlink in a slide ……………

a. Choose Insert >> Hyperlink b. Press Ctrl + K

c. Hyperlinks can’t be inserted in slides d. Both a & b

Answer Key

1. d. 2. b 3. b 4. a 5. c 6. a

7. b 8. a 9. d 10. a 11. b 12. b
13. c 14. c 15. a 16. c 17. a 18. a
19. c 20. c 21. c 22. b 23. c 24. c
25. b 26. a 27. b 28. c 29. b 30. d
31. d 32. d 33. c 34. c 35. d 36. c
37. b 38. d 39. d 40. a 41. a 42. b
43. c 44. d 45. d 46. b 47. c 48. a
49. c 50. d 51. d 52. d

New Gateway to Computer Science Book-6 239

Note

...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................

240 New Gateway to Computer Science Book-6


Click to View FlipBook Version