Saturday, 4 June 2011

10th class Computer Science Notes in (english)

CHAPTER NO- 1 "Problem Solving"

What is meant by problem solving? What steps are involved in problem solving? Describe briefly.
Problem solving: - whenever we are writing a computer program, our purpose is to solve a problem computationally. So the basic purpose of compute programming is solution of our daily life problems of different areas. This process of programming is called problem solving. Problem solving is not just type a program and then checking its output but it is a process in which multiple steps are involved. These steps are following:-
1. Define the problem:- First of all, problem is defined. What is purpose of program? What are inputs and outputs?
2. Solve the problem: - In second step, problem is solved theoretical on paper. Then program is written in general English that is called Algorithm.
3. Drawing flowchart: - The flowchart is practical form of Algorithm, which is made with geometrical symbols.
4. Program coding: - In this step program is written on computer in appropriate computer language. After writing the program. It is saved in computer.
5. Testing and debugging: - As program coding is completed then it is run, tested and corrected. This process called testing and debugging.
6. Documentation: - In this process, comments and notes about working of program are written. They will help in future to editing the program.

Define algorithm. Write down an algorithm to find the largest amongst three number a, b, c.
Algorithm:- The step by step procedure for solving a special problem is called algorithm.
An algorithm to find out greater number:-
1. Read any three numbers A, B, C.
2. If A is greater then B and A is greater then C, then print greater number A as a
3. If B is greater then A and B is greater then C, then print greater number B as a
4. If C is greater then A and C is greater then B, then print greater number C as a

What for we use flowcharts? Write down the standard flowchart symbols.
FLOWCHART:- A geometrical representation of the solution of a problem or algorithm of a program is called flowchart.
It helps the programmers to understand the program algorithm.
It is very easy to translate a flow chart into program.
With a flow chart the document process can be done easily.
Symbols of flow chart:- These are different geometrical symbols that are used in drawing flowcharts. There are many symbols used in flow chart but most easy and commonly used are:
1. Terminal symbol: - The terminal symbol is used to show the starting and finishing of a process.
Start/Stop.
2. Input output symbol: - The input output symbol use to input the data as well as the output of the result.
Read As, B
3. Processing symbol: - This symbol is used to show the processing.
Sum = A+B
4. Decision symbol: - This symbol is used to make decision.
Yes/No True/False
5. Arrows keys: - These are used to show the order is to be carried out arrows connect with complete diagram.
6. ON-Page connector: - If a flowchart is divided into many parts on the same page, the On-page connector symbol is used to connect one part of the flowchart with another one.
7. OFF-Page connector:- Some time when an algorithm is large and complicated, the flowchart is drawn on more than one page. In order to connect one part of the flowchart on one page with another part on another page, an off-page connector symbol is used.

What is programming debugging? Write the types of errors which can occur in programs.
The process of removing errors in computer programs is called debugging. There are three types of errors in a computer program.
(1) Syntax or Grammatical Error.
(2) Logical Error.
(3) Execution Error.
(A) Syntax Error: - By syntax errors, we mean those errors which are generated as a result of ignoring the grammer or syntax of the programming language. For example, in BASIC, if you type PRINTE instead of PRINT or type ENPUT instead of INPUT or type a statement like INPUT D, P1 without a statement number, clearly you are making errors. Such errors are called syntax errors.
(B) Logical Error: - Whenever there are no syntax errors in the program at the execution time, but still the program generates a non-valid result then it means that there is some logical error. It is important to note that logical errors, as the computer cannot detect them, are considered difficult to remove. For example, when we want to obtained the AVERAGE of THREE numbers, then we divided the SUM in THREE numbers. If we divided SUM in FOUR numbers instead of THREE that is a Logical Errors.
(C) Execution Error: - When the computer displays error massage at run time or execution time, even though the program neither contains syntax nor logical error, then such type of errors is called execution errors.
Example: - Get three numbers, add Its and 2nd values and divided their sum by the 3rd value. The result is then display on the serene.
10 Input A, B, C
20 D= (A+B)/C
30 PRINT D
40 END
When this program is run, it asks for values and then displays the output as:
? 10, 20, 30
1-
OK.
This works quite fine. However, if we enter 0 values for C means want to divide the sum of A and B by 0 then the computer displays the following errors message:
? 10,20,0
Division by zero
OK.

CHAPTER-2 "Data Type Assinment & input/output Statement"

Q NO: - What do you know about basic language? Write down its history and advantages.
Introduction to BASIC: - The word BASIC stands for Beginners All purpose Symbolic Instruction. BASIC language is one of the simplest high- level languages in use today. It is a general- purpose programming language. It is effective for many applications such as, business, science, games and education. Actually BASIC was designed for use in teaching the elementary principles of computer programming in a straightforward manner. That is why, it is particularly well suited for person learning to program for the first time. Because of its simplicity, it is now used almost universally. In Pakistan, many high and junior schools now offer courses in this programming language.
HISTORY OF BASIC: - BASIC was developed by Dr.John G.Kemeny and Dr.Thomas E.Kurtz at Dartmouth Collage in the mid 1960s in an effort to provide a simple teaching language for beginners of computer programming. As BASIC was a simple and user-friendly language, so very quickly it became one of the most widely used languages in schools, and universities. It was also adopted as a principal language by several commercial timesharing services. All this made it a very popular language among thousands of computer users.
ADVANTAGE OF BASIC LANGUAGE: -
There are the following advantages of the basic language.
1. It has very simple and easy grammatical rules and therefore, easy for beginners to learn, and as such, can be learned in a very short period of time.
2. BASIC is an All-purpose programming language. It is equally suitable for solving scientific and engineering problems as well as for business applications
3. BASIC has conversational nature, which makes communication with a computer simple, easy and almost natural.
4. BASIC is a user-friendly language. It is not a purely teaching language likes others and therefore, user fined it friendly.
5. Computer games can be developed in BASIC language requiring the use of graphics as well as sound generations.
6. One of the advantages of BASIC is its much built- in functions.
7. BASIC has the staying power to keep you hooked and busy until you have become an expert.

Q NO: - What do you meant by a program? Write down the structure of a BASIC program.
PROGRAM: - BASIC, lick other languages, has its own syntax or structure. Each instruction in a BASIC program is written as a separate statement that is called program.
Structure of a BASIC program: - A complete BASIC program consists of a sequence of statements, which are executed in ascending order. General rules for writing a BASIC program are as follows.
? Each statement must begin with an unsigned positive integer quantity known as a statement number (Line number).
? Two statements cannot have the same statement or line number.
? Successive statements must have increasing statement numbers.
? Each statement number must be followed by a BASIC key word (like PRINT, READ, INPUT etc) indicating the type of instruction that is to be carried out.
? Each statement begins with a statement number and ends with a Carriage Return (ENTER/RETURN/CR/).
? Each statement with an END statement, physically, it can by written any where in the program, but logically it must be the very last statement to be executed.

Q NO: - What for we use operator? What are its types? Explain each with suitable examples. Also explain priority of operators.
Operators are special characters used to perform specific operation on their operands (data type). In BASIC language we use three types of operators, which are listed below.
ARITHMETIC OPERATORS: -
1. Following are the arithmetic operations.
+ Use for addition
- Use for subtraction
* Use for multiplication
/ Use for division
\ Use for integer division
MOD MOD used for remainder in division e.g 5 MOD 2 = 1
^ Used for power or exponentiation
() Used to change the default priorities of operators.
REALTIONAL OPERATORS:-
2. Following are the relational operators.
< Used for less than > Used for greater than
= Used for equal to
<> Used for not equal to
<= Used for less than or equal to >= Used for greater than or equal to
3. LOGICAL OPERATORS:-
In BASIC we have three logical operators, which are AND, OR and NOT. AND and OR operators are used to form compound conditional expressions, in which more than one logical conditions are tested in the same statement.
The NOT operator is used to negate an operand (i.e. change true to false and false to true)
CONSTANTS: - A constant in BASIC is something that does not change its value during execution of the program. There are two types of constants; Numeric constant and string constant.
Numeric Constants: - Numeric constants are positive or negative number. A plus sign is optional for a positive number. A numeric constant in BASIC cannot contain commas. For example: 23, -4.756, + 38.15
String Constants:- A string constant is any set of characters enclosed in quotation marks. Blank spaces may be included in a string but not quotation marks. A string constant is a sepuence of 255 alphanumeric characters enclosed in double quotation marks. For example:-
“AREA OF TRIANGLE”
“** I LOVE PAKISTAN**”
“23 RD MARCH”
Variables: - Variables are the names or labels used to represent values that are used characters, the first character must be a letter like A, B, A1, A2 etc. However longer names may also be used. The number of character that can be used varies in different versions of BASIC. There are two types of variables.
Numeric Variable: - A numeric variable always has a value that is a number. This value is assigned to the variable during the execution of a program.
For example:-
10 Let A = 5
20 Prints A
30 End
String Variable: - A string is a sequence of characters that is letters, number, and certain special characters such as +, -, *, =, $, ?, etc. Blank spaces are also variables but the computer does not use them in calculations.
A string variable must be written as a letter followed by a dollar sign for example A$, B$, NAME$ etc. as used in the following programmed.
1 Let A$ = “I”
20 Let B$ = “LOVE”
30 Let C$ = “PAKISTAN”
40 Print A$, B$, C$
50 End

Write short notes on the following?
1:- BASIC character set: - The BASIC character set consists of numeric character, alphabetic characters and special characters.
The numeric characters are 0.1,2,3,4,5,6,7,8, and 9.
The alphabetic characters are upper and lower- case letters of the English language.
(A, B, C, D …Z ANSD a, b, c, d…z).
The special character are the Period (.), Comma (,), Semicolon (;) etc.
2:- Reserved Words: - Reserved words are those words which are reserved in the language for the specific purpose and can not be used for any other purpose. These have special meaning and computer knows their meanings.
Some of the most frequently used BASIC Reserved words are given below.
ABC AND ASC ATN AUTO BEEP
CHRS CINT CIRLCE CLOSE COS DATA
DATES DEF DELETE END DIM ELSE
FILES FIX FN FOR GOSUB GOTO
IF INKEY$ INPUT KILL LIST LOAD
NEW MOD NEXT PRINT READ REM
RETURN RUN SAVE SQR STEP STOP
SWAP SYSTEM THEN TO WRITE etc.
Modes of Operations:- In BAISC there are two types of Modes are used:-
Direct Mode:- The direct Mode instruction are executed directly, to perform the desired task, as and when entered without the need for using RUN command. After each direct command the screen display “OK” prompt.
Indirect Mode: - Each statement begins with a statement number; we call it Indirect Mode of operation. In this case all the statement is stored in the memory and is executed only when RUN command is display.

Difference between:-
? Constant and Variable: - Constant is a value that can not be changed, while variable, unlike constant, change their value during the execution of program.
? Numeric variable and String variable: - A numeric variable is used to hold only numeric constants. For example: - A, XYZ, Ali etc. A string variable is used to hold characters. These characters may be alphabets, number, or special symbols. For example NAME$, ADDRESS$, A1$.
? Commands and statements:- Commands is the name of action while a statement ask computer to do some work. Each statement can be consists of one or more lines.
? Input statement and Red and Data statement:- Input statement is used to accept input data from keyboard and assigns this to a variable. This input data may be a numeric value or character string.
Syntax: - [line no] Input {“prompt”} [variable] {‘variable’}….
Example: - 15 INPUT A$, PH_NO
Read and data statement: - READ statement is used to assign numeric values
or character strings to variables. These numeric values or character strings are provided by DATA statement. For each variable of READ statement there should be one value of same type in DATA statement.
Syntax: - [line no] READ [variable] {‘arable’}…
. [Line no] READ [variable] {‘arable’}…
Example:- 30 READ CITY$
40 DATA “KAMOKE”

CHAPTER NO-3 "Transfer of Control"

Q NO 1:-What is transfer of control? What type of jumps can be made in BASIC? Explain with example.
Introduction: - In a basic program statements are executed one after other in a sequence of increasing line numbers. Sometimes, however, it is necessary to jump from one part of the program to another, thus changing the default sequence of execution. The statements used for such jumps are known as transfer of control statements. There are two types of such statements:
1. Unconditional transfer of control statements
2. Conditional transfer of control statements
Unconditional transfer of control statements: - Those statements which do not need any condition to jumps form one part of the program to another e.g., GOTO, ON, GOTO.
Example:-
10 a = 0
20 a = a+1
30 print a
40 goto 20
50 end
Conditional transfer of control statements: - Those statements which transfer control to other part of the program based on same condition are known as conditional transfer of control statements e.g. IF/THEN/ELS.
Example:-
10 cls
20 input marks
30 if marks>33then 50
40 if marks<33then 70 50 print” you are pass” 60 goto 80 70 print” you are fail” 80 end Q NO 2:-What is nested loop? What rules must be followed when using nested loops? Nested Loops:- By nested loops we means one loop within another loop. Actually, sometimes we need to perform repetitive tasks within a loop. In such a situation we use Nested loops. Its structure looks like. 10 FORK =1 TO 10 20 30 40 FORX = 1 TO 20 50 60 70 NEXTX 80 90 100 NEXTK 110 END The rules for written single loops apply to nested loops. Other rules are; 1. Each nested loop must begin with its own FOR-TO statement and end with its own NEXT statement. 2. An outer loop and an inner lop cannot have the same index variable. 3. Each inner (nested) loop must be completely embedded with in the outer loop i.e; the loops cannot overlap. 4. Control can be transferred from an inner loop to a statement in an outer loop or to a statement out side of the entire nest. However, control cannot be transferred to a statement with in a nest from a point out side the nest. Q NO 3:-What is the difference between? Loop: - a loop is a set of statement which is executed repeatedly. Nested loop: - By nested loops we mean one loop within another loop. Conditional transfer of control statements: - Those statements which transfer control to other part of the program based on same condition are known as conditional transfer of control statements e.g. IF/THEN/ELS. Unconditional transfer of control statements: - Those statements which do not need any condition to jumps form one part of the program to another e.g., GOTO, ON, GOTO. IF/THEN/ELSE and ON/GOTO statements: - It is similar to the IF-THEN statement, with an added power to transfer control to another part of the program whether the condition is true or false. e.g., 10 IF marks>33 THEN PRINT “PASS”ELSE PRINT”FAIL”
THE ON/GO TO statement: - It is multiple branching unconditional transfer of control statement which is used to transfer control to any one of the indicated line numbers.
e.g., 40 on choice GO TO 15,35,60,100,60.
FOR/NEXT LOOP statement: - This is a loop which is used to perform repetitive tasks and is used when we know in advance the number of times the loop will be executed.
WHILE/WEND LOOP statement: - It is used when the numbers of repetitions are not known in advance. It has the capability to be terminated any time depending on the condition.

Chapter No-4 "ARRAYS"

Q:-WHAT IS AN ARRAY? WRITE DOWN A DETAILED NOTE ON ONE DIMENSIONAL AND TWO DIMENSIONAL ARRAYS?
ANS:-ARRAYS:-An array can be defined as “a subscripted variable that has upper and lower bounds as its ending and starting positions and that subscripted value may range between these two bounds, is called an array”.
Types of arrays:-
An array can be categorized into two types on the basis of these rows and columns. These types are given one by one below:
One dimensional array:
A subscripted variable in which a single variable is used to represent the subscripts of the array and ranges between the lower and upper bounds of the array is called one-dimensional array. An example of such arrays in the real life may be a matrix consisting of rows or columns only.
Two dimensional arrays:-
A Two dimensional array consist of two subscripts in which ,the first represents the number of rows between the lower and upper bounds of row values and the second represents the number of columns between the lower and upper bounds of columns values. An example of such array is the two dimensional matrix which has two or more than two rows and two or more than two columns. Such an arrays can be diagrammatically shown as

Q:-Why do we use (DIM) statement? If omitted? What will happen? Write down the detailed note on its use?
Ans:-if we want to declare an array then it is called DIM statement. With DIM statement we can also declare two dimensional arrays. Two dimensional arrays, which has two subscripts to identify each element of the array.eg A(3,2)
SYNTAX:-
For single dimensional arraty
[Line no]DIM [variable (subscripts)], {variable (subscripts)}
For double dimensional array
[Line no]DIM [variable (subscripts, subscript)]
EXAMPLE:-
10DIM AR (90)
These statements will create a single dimension array in memory with 90 subscripts.
20 DIM NAME$ (26), RNO (26), CLASS (26)
These statements will create three single dimension arrays in memory each with 26 subscripts.
30 DIM TBL (10, 10)
These statements will crate a double dimension array in memory each with 100 subscripts. These array elements are denoted like.
TBL (2, 5), TAB (5, 3).

PROGRAM: - Now we make a program to learn the use of arrays.
This program will count down the values from 25 to 5 with interval of 5 and then count up from 5 to 25 with same interval.

10 DIM A (5)
20 FOR 1= 1 TO 5
30 READ A (1)
40 NEXT 1
50 DATA 5,10,15,20,25
60 FOR 1= 5 TO 1 STEP -1
70 PRINT A (1)
80 NEXT
90 FOR F= 1 TO 5
100 PRINT A (F)
110 NEXT 1

PROGRAM: - This program is used to find the smallest number.
10 DIM K (100)
20 INPUT”HOW MANY NUMBER YOU WANT TO ENTER”;N
30 FOR 1= 1 TO N
40 INPUT K (1)
50 NEXT 1
60 KK= K (1)
70 FOR J= 2 TO N
80 IF KK>K (J) THEN KK= K (J)
90 NEXT J
100 PRINT KK
110 END

Chapter- 5 "Subprograms"

Subprograms:- A subprogram is a set of statements which are written once in the program and used or called many times in different places of program.
Basic language offers two types of sub programs.
1:-subroutnes subprograms
2:-functions Subprograms
Functions Subprograms: - Functions are those sub programs which are used to replace simple process such as calculating the square of a number, finding out the natural logarithm of a number and so on.
Subroutines subprograms: - Subprogram which are used to do complex programming operations like calculating the roots of a quadratic equation, solving a matrix and soon.

What is the purpose of intrinsic functions? Why do we use them? Explain with suitable examples the different types of intrinsic functions.
Purpose of intrinsic: - They perform the most basic operations like calculating the square root, sine, cosine, tanguage of angles and so on.
Why do we use them: - When we want to solve the most basic operations like calculating the square root, sine, cosine, tanguage of angles and so on then we use intrinsic functions.
Types of intrinsic functions: - Then are categorized follows:-
1. Numeric function: - The number of built-in functions which can be used for mathematical calculations. These functions return a number as their results.
They are:-
• Trigonometric functions:-
Functions purpose
Sin(X) Calculates the sine of X.
Cos(X) Calculates the cosine of X.
Tan(X) Calculates the tangent of X.
Atn(X) Calculates the tangent inverse (arctangent) of X.
• Arithmetic functions:-
Functions purpose
SQR(X) Calculates the square root of a given number.
LOG(X) Calculates the natural logarithm of X.
EXP(X) Calculates the exponential value of X.
2. String Functions:- The number of built-in functions which can be used for manipulations of string data. These functions return string and numeric values as their result. They are:-
Functions purpose
LEFT$(Sring,n) Selects the left most n characters of the given string.
If n is greater then the number of characters
Contained in the string, the entire string will be printed.
RIGHT$(String,n) Selects the right most n character of the given string.
3. String$ functions:- This string functions is used to repeatedly print out a character specified by the given ASCII number to the function STRING$. This functions has the following general form:
STRING$(N,M).
Exp:- 60 PRINT STRING$(3,67)
4. Time$ functions:- The TIME$ is a built-in functions in BASIC which is related with system time. It is used to show the current time or used to set the new time of the system.
Exp:- 10 PRINTTIME$ and
20 TIME$ =”16:00:00”
5. Date$ functions:- Like time$ functions Date$ functions is used to display the current date, or set the new date of the system. The general syntax as:-
Line DATE$.
Exp:- 10 DATE$ =”03-07-2001”
6. ASC functions:- It is the inverse of CHR$ function, which returns corresponding character for a given ASCII value, because it returns the ASCII code for a given character. Its general form is : ASC(X$)
10 PRINT ASC (“ABC”).
7. LEN Function:- This function is used to print the total number of characters contained in the string. It has the general from like.
LEN(X$)LEN (“”) Will print 0 where
LEN (“Nafid ullah khan”).
8. VAL function:-This function is used to return to return the numeric value of the given string argument in a string of numbers enclosed in the double quotation. It must be noted that the string must be the combination of number. Its general form.
VAL(X$)
Exp:- A$= “852772”
9. OCT$ function:- This functions is used to calculate the equivalent of a decimal number in the octal number system. The general form:
OCT$(Decimal Number).
10. HEX$ function:- That is used to calculate the Hexadecimal equivalent of a number which is in the decimal number system. The general form:
HEX$(Decimal Number).

CHAPTER 6 Graphics

What is meant by computer graphics? What do you know about different modes of graphics in BASIC? Explain.
Computer graphics: - Graphics is that area of computer programming which is highly in use these days. It is that type of programming in which we draw text or pictures i.e., shape and images on the screen of the computer.
Types of Graphics: - There are three modes of drawing Graphics.

1. Text Mode: - It is the first mode of drawing graphics and it refers to drawing number, letter and special characters (like $, % and so on) in the graphics form like high lighting, make them blinking or to convert them into invisible form.
In text mode these characters are displayed in terms of 25 rows x 40 columns or 25 rows x 80 columns on the screen of the computer monitor.
2. Medium-Resolution Graphics Mode:- In this mode of Graphics, the display is divide into a matrix consisting of 320 columns and 200 rows of pixels. This graphical mode works with 4 columns. The columns are numbered from 0 to 319 and the rows from 0 to 199.
3. High-resolution graphics Mode: - High-Resolution graphics Mode contains more pixels than the medium resolution mode. In this mode the screen is divided into 640 columns and 200 rows which make a matrix of 640 x 200 pixels. This high resolution is used to facilitate more precise and clear drawing of graphics.

Why do we use CIRCLE statement? Explain with suitable example.
Some time we need to make a circle. In order to draw a circle, we use the CRICLE statements. This statement has the following general form:
Line# CRICLE(X, Y), radius [colour].
Where (x,y) is the position of the point that is located at the center of the circle and radius is the radius of the circle. The colour value is optional and is used to colour the circle with specific colour selected according to the graphic mode and the available colour palette. An example may be:
20 CIRCLES (110,150), 70
Which is used to draw a circle of radius equal to 10 and having the pixel located at?
(110,150) as its center.
Example: - This program is used to draw a circle one with in another by using CRICLE statements, as following:
10 CLS
20 SCREEN 1
30 FOR = 60 TO 10 STEP 10
40 CRICLE (100,50);I
50 NEXT I
60 END

Write the purpose and complete syntax of DRAW statements. What types of shapes you can draw with this statement? Give two examples.
This statement is used to draw lines and other shapes on the screen of the monitor. This statement is used in both the resolution graphics modes, which are the medium resolution and high resolution graphics mode.
The general form of DRAW statements is:
Line # DRAW string
Where string may be enclosed in quotes and it’s contain commands to create a shape on the screen. This string may be using one of the following commands:
“Un” is used to move up n points or pixels.
“Dn” for moving down by n points or pixels.
“Fn” for moving left n points or pixels.
“R” for moving right n points or pixels.
“En” for moving diagonally down and right by n points i.e., pixels.
“Gn” for moving diagonally down and left by n points i.e., pixels.
“Hn” for moving diagonally up and left by n points or pixels.
When one of these commands is executed, a line is drawing n from the starting position which has been specified. Thus this drawing utility of BASIC language is used to specify the number of points or pixels and the specific direction in which the line is to be drawn.
By DRAW statements we draw the following shapes:-
This program is used to draw a square.
10 CLS
20 SCREEN 1
30 DRAW”U40L50D40R50”

Program 2:- This program is written to draw a rectangle.
10 CLS
20 SCREEN 1
30 DRAW “U40R70D40L70”
What is the role of SCREEN statements? Write down its different modes and their effect on the graphic quality.
SCREEN statement:- SCREEN statement insert effect on the graphic quality.
It must be notified that the statement SCRREN 1 is used to select an appropriate screen mode i.e., Medium Resolution graphics mode. The general form of the SCREEN statement is:
Line # SCREEN Mode.
There are three modes of SCREEN statement:-
1. Mode = 0:- If mode = 0 that is, SCREEN 0, then text is selected.
2. Mode = 1:- If mode = 1 that is, SCREEN 1, then Medium Resolution mode of graphic will be set.
3. Mode = 2:- If mode = 2 that is, SCREEN 2, then High Resolution mode of graphic will be set.

CHAPER NO-7 "Word Processing"

Q NO 1:- What do we mean by Word Processing? Which word processors are available in the market? What is the advantage of MS.WORD over other word processors?
WORD PROCESSOR: - Word processor can be defined as processing the words electronically. Word processor is a computer program, which gives set of commands and tools to process the words electronically using a computer. In Word we write the simplest documents like application, letters, memos, and most complex documents like reports and books.
Word processing are available in the market:- In market different word processor are available. Most commonly used are MS-Word and Word perfect. In 80% of the offices and homes MS-Word in used.
Q NO 2:- Write detailed not on the environment of MS- Word?
The MS- Word environment has the following common components.
TITLEBAR: - The top line of the MS-Word program is called title bar. It shows the name of the program.
MENUBAR: - It gives the list of commands or options that a user can apply on his documents.
TOOLBAR: - These are the set of commands shown in the form of pictures below the menu bar. They are executed by the click of the mouse.
RULER: - It is located below the toolbar and used to show the position of the text on the page both horizontally and vertically.
Document area: - This is the area usually white in color provided to the user to write his document.
SCROLL BAR: - They are used to control the movement of the document if it can’t fit in the space provided by the Word processor. They are two types.
HORIZONTAL: - It controls the horizontal scrolling of the text.
VERTICAL: - It controls the vertical scrolling of the text.
STATUS BAR: - It is bar located at the bottom of the window.

Q NO 3:- Write the complete steps to perform the following:
1. Loading MS-Word.
M: - Start? program? accessories? MS-Word.
2. Create a new folder in MS-Word.
M: - File?open?click create new folder? type name.
3. Create a table to contain 20 rows and 10 columns.
M: - Table?insert?table?select rows? select columns?ok.
4. To include header and footer.
M: - View heater and footer type header and footer?ok.
5. Insert picture in a chart in a Word processor.
M: - In chart dialog box? edit? import file? select picture? open.
Q NO 4:- What is the difference between?
Save: - This option is used to save the current file in your computer.
Save as: - This option is used to make another copy of the save file.
Paste:- This option is used to past your selected data.
Past special:- This option is used to past the formatted data, unformatted data, and other options.
Print: - This option is used to print the current file according your instructions.
Print preview: - This option is used to display the full page of the current printed file.
Undo: - This option is used to restore deleted data.
Redo: - This option is used to repeat the last commands.
Full screen: - This option is used to display full screen of the current file.
Zoom: - This option is used to display current file according your own percent.
Q NO 5:- Write the purpose of the following?
(1) Replace: - In the help of this option we replace one text to another.
(2) Footnotes: - In the help of this option we write comments in the end of the documents.
(3) Style: - In the help of this option we change the font in different style.
(4) Filed: - In the help of this option we select any filed for us.

BASIC STATEMENT

LET STATEMENT: - It is one of the most fundamental and most important statements of BASIC language. This statement is also called as assignment statement, because it is used to assign a numeric or string value to a variable. LET statement has the following general form:
Line# LET Variable = [constant]
[Variable]
[Expression]
Exp:-
Let A$=”NAFID” Let X = 8
Let B$=”YULIA” Let Y = X+2
Let B$ = A$ Let X = X+Y
Let A$ = B$ Print”Result = “;Z
PRINT A$,B$ End
END

PRINT STATEMENT:- Print statement is used to display the data on the screen. It can be used to display message, value of variables and to print the answers of arithmetic expression. The PRINT statement has the following form:

Line # PRINT [OR?] [Constant]
[Variable]
[Expression]
Exp:-
To Print Blank lines:-
10 Print”NAFID ULAH”
20 Print
30 Print”YULIA”
40 Run
To Print Constants: Print”soma”
10 Print 9 Print’Hell! How are you?”
20 Print -100 Print”Wellcome to show”
30 Print 3.14159 Print “**************”
40 Print 1.23E+2 Run
50 Run

LPRINT STATEMENT: - It is used for printer output. It is used to print output data on the printer rather than on the screen. It has the following general form:
Line# LPRINT {Constant, Variable, and/ Expression}
Exp:
20 LPRINT X; Y; Z
PRINT USING STATEMENT:- It is used for formatted that is allows printed output to be formatted. Both numeric and string data can be rounded as well as +,-,$ Signs can easily be inserted in the output result. Syntax:
Line# PRINT USING “Format string”; List-of-expressions
10 Print using”####”; 44

REM STATEMENT: - REM Statement is used to include comments/remarks in BASIC program. This statement consists of statement number followed by the keyword REM, followed by any remarks. It has the following general form:
1. Line # REM [OR,] Any Comments.
Exp:
10 ‘This is a comment line.

END STATEMENT:- END statement is used to terminate the execution of the program. It can be given anywhere in the BASIC program physically but logically it must be the very last statement of the program. Though the END statement is optional to use, but it is a good programming practice to include the END statement in all BASIC programs. The END statement has the following format:
LINE# END

LOOP: A loop is an instruction or group of instruction that the computer executes repeatedly to a specified number of time or until some terminating satisfied
Or
Repetition of statement
1:
10 For I=2 to 20
20 Print I
30 next
2:
10 For I = 2 to 20 step 2
20 print I
30 next

BASIC COMMANDS OF BASIC LANGUAGE
Auto Commands (Alt+A):-
Auto Commands are used to generate the line number automatically.
Syntax: - Auto (Enter).
Syntax: - Auto 2 (Enter).
Syntax: - Auto 100 (Enter).
Syntax: - Auto 10, 50 (Enter).
Syntax: - Auto 100,100 (Enter).
To End Page Break: - Clt+Break.
List Commands (List). (F1)
Its produce the entire list of the program on the screen.
Syntax: - List (Enter).
Syntax: - List 40 (Enter).
Syntax: - List 100-200 (Enter).
Syntax: - List -80 (Enter).
Syntax: - List 80 (Enter).
Run Commands (F2).
To execute the Basic program.
Syntax: - Run (Enter).
Load Commands (F3).
To load a program to disk into memory.
Syntax: - Load “Basic. Bas” (Enter).
Save Commands (F4).
To save the Basic program on disk.
Syntax:-Save “File name” (Enter).
Delete Commands (Alt+D)
The delete commands are used to delete a program statements or a group of statements.
Syntax: - Delete (Enter).
Syntax: - Delete 70 (Enter).
Syntax: - Delete 80-150
Syntax: - Delete -100
Syntax: - Delete 100-
Renum Commands:-
The Renum commands are used to renumber the program statements numbers.
Syntax: - Renum (Enter).
Files Commands:-
To display all Basic Files.
Syntax: - Files (Enter).
Kill Commands:-
It is used to delete Basic files permanents.
Syntax: - Kill “File name.bac” (Enter)
Key Commands:-
It is used to change the name of the file.
Syntax:- Name”old file name”AS “new file name” (Enter)

FILL IN THE BLANKS

CHAPTER NO 1
1. In flowchart the symbol used for data input is Process Box.
2. Flow line symbols are used to Direction.
3. There are Three types of errors in computer.
4. Syntax errors are difficult to remove_____.
5. Division of any number by zero results in Execution error.
6. Execution error is also called Logical errors.
7. A computer program is a set of Instructions.
8. When a program is executed it is converted into High-Level Language.
9. Program implementation follows Testing and Debugging.
10. In the events of damage to the program, a programmer refers to get help from___.

CHAPTER NO 2
1. Basic stands for Beginners All Purpose Symbolic Instruction Code.
2. Basic was developed by Dr.John G.Kemeny and Dr.Thomas E.Kurtz.
3. Basic is an All purpose and High-Level Language.
4. Each statement in Basic begins Statement Number and end with Carriage Return.
5. There are two types of Numeric Constants namely Integer Constant and Real Constant
6. NAME is Key words.
7. INPUT is a Reserved Word.
8. CLS is used to Clear the screen.
9. An expression is the combination of operands and Constant.
10. Variable always Changes values.

CHAPTER NO 3
1. There are two types of transfer of control statements namely Conditional and Unconditional
2. If the value of the expression in the ON/GOTO statements is less than 0 or greater then 255, then computer generates “Illegal function call” message.
3. We can use GOTO in place of THEN in IF/THEN statements.
4. The process of error detection and correction is called Error Trapping.
5. RESUME statements is used to Transfer Control.
6. If we use FOR loop and do not use NEXT then computer will generate” FOR without NEXT” error message.
7. Initial value of the index variable must be equal to One to execute the loop at least once
8. WHILE-WEND loop is executed until the condition becomes False.
9. WEND statements is used to
10. By nested loop we mean One Loop within another Loop.

CHAPTER NO 4
1. An array element is referenced by using array name and Positions.
2. A (2) and B (3, 4) are called Subscripted variables.
3. Array element A (4) represents Individual elements the element of the array A.
4. There are two types of arrays in BASIC One Dimensional array and Two- Dimensional array.
5. The first subscript of a two-dimensional array represents Number of Rows and the second one represents Number of Columns.
6. In BASIC arrays are declared using DIM Statements.
7. The statement, 10 DIM MARKS (20) declares an array MARKS having____elements.
8. The statement, 10 DIM PRICES (4, 5) declares a two dimensional, array having 5 rows and 6 columns.
9. If a subscript is larger then the one specified in the DIM statements, than an error message “Subscript out of range” is displayed on the screen.
10. DIM statement is optional for 11 elements for in case of one dimension and 121 elements for Two-dimension array.

CHAPTER NO 5
1. There are two types of subprograms Function Subprogram and Subroutine Subprogram.
2. Numeric functions return Number values.
3. Trigonometric functions are Numeric Function.
4. STR$ is used to Convert a numeric value to its string.
5. INKEY$ is used to To read the character from the keyboard.
6. ASC function is the reverse of CHR$ function.
7. LEN is used to Print the total number of character contained in the string.
8. VAL function is the reverse of ___function.
9. User-defined functions are defined with DEFFN statement.
10. Control is transferred to a subroutine through GOSUB statements.

CHAPTER NO 6
1. There are three modes of drawing graphics namely Text mode, Medium –Resolution Graphic Mode and High-Resolution Graphic Mode.
2. SCREEN 0 represents Text Mode.
3. In text mode characters are displayed in term of 25 rows x40 columns or 25 rows x80 columns.
4. The width statement is used to ____
5. In medium resolution graph mode screen is divided in to 320 columns and 200 rows of pixels.
6. In medium resolution mode right lower corner is represented by (319,199).
7. In high resolution graphic mode screen is divided in to 640columns and 200 rows of pixels.
8. The syntax of draw statement is Line# DRAW String.
9. In draw statement we use “Dn” for moving down n point.
10. The color statement is used to select a specific color for our graphical object.

CHAPTER NO 7
1. MS-Word stands for Microsoft Word.
2. Word Star is a Word Processing program.
3. Bold is used to
4. In order to underline a text we use Underline button on formatting bar.
5. To set the margins of a document we use page setup option in the file menu.
6. Footnote option is located in the Insert menu.
7. To set spacing of line in a paragraph we use Line spacing option.
8. To check spelling we use Spelling and Grammar option.
9. To delete a column from a table we use Delete then column option in the table menu.
10. To select a printer we use Print option.


About shehreyar10

CHAPTER NO 2
Q.# 1. What are the main components of a digital computer?
There are three main components of a digital computer.
(1) Input (2) Out put (3) C.P.U
INPUT: - The devices that are used to enter data and instruction into the computer system are called Input devices.
Example: - Key board, Mouse, Scanner, Camera, etc.
OUTPUT: - The devices that are used to receive processed data from the computer are called Output devices.
Example: - Monitor Printer, Speaker, Microphone, etc.
C.P.U:- It stands for Central Processing Unit. It is the “Brain” of the computer. It is the main part of the computer system. All data passes through it and is processed in it. C.P.U consists of two main parts:
1:- Control Unit.
2:- Arithmetic and Logic Unit.
Q.#.2 :- What is C.P.U? What tasks does the C.P.U perform? What are its components?
C.P.U:- It stands for Central Processing Unit. It is the “Brain” of the computer. It is the main part of the computer system. All data passes through it and is processed in it and the result is sent to the out put units.
Task of the C.P.U:- The C.P.U performs many tasks:-
(1) It can perform arithmetic calculations, such as (-, +, ×, %,÷) etc.
(2) It can perform logical decisions.
(3) It helps other devices in data transmission.
(4) It can perform manipulating tasks such as word processing.
Components of the C.P.U:- C.P.U consists of two main parts:
(1) C.U (2) A.L.U
C.U:- It stands for Control Unit. It controls all computer operation and the orders to all of its units.
A.L.U:- It stands for Arithmetic and Logic Unit. It performs all arithmetic and logical operations on the data. They consist of two parts.
Arithmetic section:- Arithmetic section of the ALU performs basic arithmetic operations such as (-, +, ×, %,÷).
Logic section:- Logic section of the ALU performs logical operations, such as greater than, less than, equal to, not equal, etc.
Q.#.3:- Write short not on the following:-
Cash Memory:- It is part of the C.P.U. It is in the path between the main memory and the processor. It is in the form of a memory, but is faster than the main memory.
Secondary memory:- The secondary memory is an external memory. It is also called the Auxiliary Storage Device. It can store system files, compilers, assemblers and other programs. It includes devices such as magnetic tape, floppy disk, CDs etc.
Q.#.4:- What are the Types of computer: -
Computer can be divided into three types.
1. Analogue computer: - These are special purpose computers and are mostly used in engineering and medical fields etc. Their input and output is in form of wave’s i.e. they accept data and provide results in form of waves.
2. Digital computer: - The computer, which accepts and provides data in digital form i.e. in the form of letters, numbers, and symbols, are called Digital Computers.
3. Hybrid computer: - These are also special purpose computers. But they have the capability for input in digital form and provide output in analogue form or input in analogue form while output in digital form.

CHAPTER NO 3
What do you mean by input? Name all the input devices.
INPUT: - The devices that are used to enter data and instruction into the computer system are called Input devices.
Example: - Key board, Mouse, Scanner, Camera or web cam, Track ball, Light pen.
1. Key board: - A key board is an input device. Type writer like in appearance, it has from 84 to 108 buttons/keys. These are in groups: Alphabetic and numerical keys, (arranged as on a type writer), Numpad keys, Function keys, etc.
2. Mouse: - A small round hand held input device which is moved about on a desk or table top. It looks like a mouse and so is called a mouse. It is used to select options, to draw and helps in many other functions.
3. Joy stick: - It is and input device. It consists of a head of buttons and is used for computer games. It controls the movement of a certain object on the screen.
4. Track ball: - A track ball operates like a mouse. In the case of the track ball,the ball on the device is rotated.
5. Light pen: - It is a hand held pen like input device used to make structures which could not be done with a mouse.
6. Scanner: - This device is used to transfer the image of a photo, drawing or written text off a flat page into the computer.
7. Web camera: - This input device can be used to input moving images and still picture images into a computer. It can store still picture images and send them to the computer.
Q. # :- What do you mean by out put? What devices are used for output? Briefly describe each.
OUTPUT: - The devices that are used to receive processed data from the computer are called Output devices or the results of processed data or called output.
TYPE OF OUTPUT: - There are two main types of output.
1. SOFTCOPY:- This refers to data that is shown as a display on the screen or audio/voice. Such copy can not be held in the hand.
2. HARD COPY: - This refers to printed output in the form of text or graphics.
OUTPUT DEVICES:-
MONITER: - This is a T.V like device that is used to display the result of a computer.
PRINTER:- This is used to print the soft copy on to paper. Some print out only text and others both text and graphics. The size of the print is generally that of standard paper sizes. There are two main types of printer.
1. Impact printer 2. Non-impact printer.
CD- WRITER: - This is used to read data from and write data on CDs.
Write a detailed note on printers.
A printer is an output device. A printer receives information and prints it on paper. Printers may be categorized in tow ways. Firstly into 1) Slow speed printers and 2 ) High speed printers:
1) Slow speed printers, e.g. Dot Matrix and Daisy wheel printers.
2) High speed printers, e.g. Laser printer and Drum printer with a speed up to 2000 lines per minute.
Secondly into 1) Non-impact printers and 2) Impact printers.
1) Non-impact printers:- These printers use magnetic, electrostatic, chemical, thermal, optical, inkjet or laser principles to write on paper.
Advantage: - They can not produce a fast single copy and make little noise.
Disadvantages: - They can not produce multiple copies without having to print the same data repeatedly, which is time consuming. They are costly.
Examples: - Thermal printer, Inkjet printer, Drop on demand printer.
2) Impact printers:- These printers print by striking a ribbon again the paper.
Disadvantages: - They are noisy. Have limited graphics. There are two types of impact printers. (1) Character printers (2) Line printers.
1) Character printer: - Which print one character at a time and so is slower, e.g Dot
Matrix printer and Daisy wheel printer.
2) Line printers: - Which print a line of characters essentially at the save time and so are faster, e.g. Drum printer and Chain printer.
Write a short note on the following:
Daisy wheel printer: - These printers are also called letter quality printers. It is called Daisy wheel printer, because of a wheel on which characters are embossed all around. An electronic motor spins the Daisy wheel. This printer does not printer pictures, drawings or graphics.
Plotter: - It is a printing device. It prints only drawings with the help of special pens fixed onto its arm. A plotter can make drawings on big sheets of paper. There are two types.
(1) Drum plotters (2) Flat bed plotters.

CHAPTER NO 4
Q. # :- What is meant by main memory? What are its types? Explain.
Main memory: - Main memory is a type of computer memory. It is located within the C.P.U. In size, it is much smaller than that of secondary storage devices. The main memory may or may not be permanent. There are two type of main memory.
RAM: - It stands for Random Access Memory. It can also called Temporary or Primary memory. In the RAM, stored data can be read, written, deleted and modified, so it is called Read/Write memory also. When the computer is shut down, all the data stored in the RAM is lost, so it is also called volatile memory. RAM is used to hold those programs and data that are being executed in the processor.
ROM: - It stands of Read Only Memory. It is a permanent storage of memory. It can not be deleted or modified as it only readable. The data still remains in the ROM even it we shut down the computer, so it is also called Non-volatile memory.
Q. # :- What is secondary memory? Which secondary storage devices are used in computers these days?
Secondary memory: - Secondary storage devices are useful and add to the functionality of a computer as they can be used for both input and output, so they are also called dual purpose devices. The data of this device is stored in a magnetic form. Such data can be stored for a long time, even if the computer is off.
Secondary memory devices: - Some of the most important devices which are commonly in use now-a –days are:
(1) Floppy Disk:- It is a disk coated with magnetic material. They are commonly available in two sizes (1) 3 ½ inches. (2) 5 ½ inches. The storage capacity such floppy disks is 1.44 MB and 1.2 MB respectively. With the help of a floppy disk, we can transfer up to 1.44 MB data from one computer to another.
(2) Hard disk:- This is another secondary storage device. It is a metallic disk fixed in the computer which can store a large amount of data that can be accessed by the computer. The storage range is from 5 MB up to some Terabytes.
(3) CD: - It stands for compact disk and is sometimes called optical disk. It is a plastic disk recorded on by means of lazer beam rays. We can not store data on CDs, they contain read only data with a capacity of up to 650 MB storage, hence the storage memory is called CD.ROM, (Compact Disk Read Only Memory).
(4) Magnetic Tape: - It is a reel of tape coated with a magnetic substance such as iron oxide. The reel of tape usually enclosed in a plastic box called a cassette, (similar to an audio cassette). As per an audio cassette, it is sequential with one thing recorded after another, hence to access data on it, other data must be passed over first. This takes time as compared to the direct retrieval possible from disks.
Write a short note on:-
SIMM: - It stands for Single Inline Memory. It is an arrangement of memory chips on the single side of a circuit board that forms a package of RAM. As SIMMs are removable, the RAM can be increased or decreased by adding or removing SIMMs. SIMM memory chip capacity is usually 32 bits.
DIMM: - Is stands for Dual Inline Memory Module. Dual means double and in DIMMs the memory chips are doubled up on both sides of the circuit board. The effect is to double the capacity of memory chips from 32 to 64 bits.
Q. # :- How is memory measured? What are its units? Explain in comparison with the help of a table.
We know that memory or storage occurs in the main memory and also in the secondary memory. In both cases the memory is stored in the form of the digits of either ‘0’ or ‘1’. Some units for the measurement of this type of memory are as follows:-
(1) BIT: - A bit is the smallest unit of memory. It is a binary digit with the values of ‘0’ representing ‘off ‘and ‘1’ representing ‘on’
(2) Nible: - A nible contains 4 bits.
(3) Byte: - A byte contains 8 bits or 2 nibles. It is a higher unit of memory than bit and nible and can represent one alphanumeric character.
(4) Kilobyte: - This unit of memory contains approximately 1000 bytes. Actually 210 bytes = 1024 bytes is one kilobytes, 1KB.
(5) Megabyte: - It contains around one million bytes. Actually 220 bytes = 1048576 bytes is one megabyte, 1MB.
(6) Gigabytes: - It is 240 bytes = 220 × 220 = 1048576 × 1048576 = 1.0995116 × 1012 = 1099511600000 bytes.
(7) Terabytes: - It is the largest unit of memory/ storage. It is equal to the square of the GB. 1TB = 280 bytes.
Memory Unit Square of :- No. of KBs
Kilobyte 25 bytes=32 byte 1KB
Megabyte Kilobyte (KB) 1024 KB
Gigabyte Megabyte 1073741824 KB
Terabytes Gigabyte 1.1805816×10
Q. # :- What is the difference between:-
RAM and ROM: - RAM stands for (Random Access Memory) and the ROM stands for (Read Only Memory).
We can directly access the RAM, but we can not access the ROM.
We can easily save, delete and modify the saved data in RAM, but in the ROM we can not.
RAM is washed when the computer is shut down, but ROM is a permanent memory.
SIMM and DIMM: - SIMM is a single sided memory chip, while the DIMM is a double sided memory chip. The capacity of SIMM is usually 32 bits, but the capacity of DIMM is double that of SIMM usually 64 bits.
GIGABYTES and TERABYTES: - Gigabytes, is a smaller unit of memory than Terabytes.1 GB = 240 bytes, while 1 TB = 280 bytes. The TB is the square of the GB.
Hard disk and floppy disk: - Both are secondary memory devices. The floppy disk is a removable unit. While the Hard disk is fixed inside the computer. The Floppy disk storage capacity is up to 1.44 MB. While Hard disk are available in various types with storage ranging form 5 MB. Up to some terra bytes. Data can be easily be transfer from one computer to another by means of a Floppy disk, But this can not be easily done using the Hard disk.

CHAPTER NO 5

Q. # :- What is data? What are its types? Explain.
Data: - Anything which can be fed to the computer is called data.
Types of data: -
There are three types of data.
1. Alphabetic data: - This type of data consists on only alphabet type characters.
2. Numeric data: - This type of data consists upon Number such as (0…9).
3. Alphanumeric data: - This type of data is combination of alphabets and numeric data.
Q. # :- What is numbering system? Discuss it different types.
Numbering system: - Generally a number system is a term used for a set of different symbols or digits, of something.
Digital computers are the machines which responds numbers (1, 2, 3, 4) rather than letters (A, B, C, D).
Types: - Following are the number systems which are used in computers and in our daily life for counting and arithmetic purposes.
1. Decimal Number System ( 10 digits; 0 to 9).
2. Binary Number System (2 digits; 0 to 1)
3. Octal Number System ( 8 digits; 0 to 7 )
4. Hexa Decimal System ( 16 digits; 0 to 9 and then A ,B , C, D, E, F) that is
5. (10, 11, 12, 13, 14, 15).
Convert the following decimal numbers to their equivalent binary numbers.
• 43
• 64
• 408
• 4096
1:- 43:-
Hence 43 = (101011)2
2 43
2 21-1
2 10-1
2 5-0
2 2-1
1-0
Sol: - (64)
Hence 64 = (1 000000)2
2 64
2 32-0
2 16-0
2 8-0
2 4-0
2 2-0
1-0
Convert the following binary number to their equivalent decimal numbers.
• 1101
• 11011
• 111001
1:- 1101:-
Sol: - (1101)2 = 1*23+1*22+0*21+1*20
= 1*8 + 1*4 + 0*2 +1*1
= 8 + 4 + 0 +1
= 13
Hence (1101)2 = 13
Note: - One power less then the whole digits that is 1101/4 = 23,22,21,20
Convert the following binary number to their equivalent octal numbers.
• 23
• 932
• 0.55
Sol: - (23)
Hence 23 = (207)8
8 23
8 16-7
2-0
Sol: - 1339
Hence 1339 = (24730)8
8 1339
8 167-3
8 20-7
2-4

CHAPTER 7
Q NO2:- What are executable files ? Explain all its types.
Executable files:- When over some task is done by the computer, it is written as a list of instructions in the form of a program file. In order to process the file by the computer, it must be given to the computer in machine language which is also called the language of 0 and 1. This machine language is the natural language of the computer hardware and a computer directely understand this language therfore a file written in machine language can be easily processed or executable by a computer. Thus a file which is written in machine language is called an executable file.
Types of executable files:- There are three main types of executable files.
1. File with .EXE Extension:- Thoses files which are having .EXE as their extention means that they are the executable version of a program. The file is executed whenever the name of such file is entered.
2. File with .COM Extension:- The file with extension .COM have contents which the computer runs when we enter the name of these files.An example of such files is the MS-DOS program which is called COMMAND.COM.This file is us to interpret the user commands internally i.e internal commads of DOS. In other words these external commands must ve separately stored in order to be executed by the COMMAND.CON interpreter.
3. File with .BATExtension:- The file with .BAT extensions are also containing programs. If the names of these files are typed at the command prompt, MS-DOS runs the program that is contained in the file. These file are called batch files. The word ‘batch’ means a collection.Thus in the AUTOEXE.BAT file, there is a batch or collection of commands which will be interpreted or executed by the “COMMAD.CON” before any other activity is started up.

Q NO 3:- What do you mean by command? Describe the types of commands in DOS. Write a detailed note on DIR command.
Command:- The instruction given to the computer to do the work is called command, or command is the name of action or instruction like DIR, COPY etc.
The general syntax of a command is Command Arguments Switches.
Command:- Are the name of action.
Arguments:- Are the requirements, which are required by that command.
Switches:- Are the special characters that amends the working of that command.
There are following two types of DOS command.
1. Internal command:- These commands are in a file COMMAND.COM. DOS loads this file in the RAM, when the computer starts. As these commands are internal part of the COMMAD.COM, so these are called internal commands. When we use these commands, computer reads the instructions for that command from RAM where COMMAND.COM is loaded. DIR, COPY, DEL, etc are few internal commands.
2. External commands:- Extenal commads are stored on separate files. When we use any external command, then the computer loads its file from the disk to the RAM for use. CHKDSK, FORMAT, DISKCOPY, etc are few external commands.
DIR Commands:- This command stands for directory. It is a DOS internal command which is used to view a directory list. A directory list is a file and sub directories which are contained in a directory. In order to show the list of the files we type the command DIR (enter).These can be discussed:-
A. DIR/P:- Here the common “DIR” is used with /p switch. With the help of this command we display all the directory of the disk page wise.
B. DIR/W:- Here the common “DIR” is used with /w swith. With the help of this command we display al the directory wide wise, and the file have no information such as size, date, and time.
C. DIR/W/P:- Here the common “DIR” is used with both switch /p, and /w. With the help of this command we display all files and all directory without information and page wise.
D. DIR/AD:- With the help of this command we display all the subdirectories of the main directory.
Q NO 4:- What is the concept of a subdirectory in DOS? How it is created, entered, and removed.
Directory:- It is used to protect the files.The directory is like idraw in which the files are kept. There are two types of directory. ? Root directory:- The starting directory of a drive is called iroot directory. It is normally shown by back slash (\). For example the root directory of drive A is A:\, similarly or C is C:\.
? Subdirectories:- Those directories, which are created under the root directoried, are called subdirectories. Each subdirectory can also have files as well as subdirectories.
How to create a subdirectory:- In DOS and other operating systemes, there are some situations which demand a separate directory or folder such situations may arise whenever we want to have our private files in a separate location. In order to create a new directory, we use MD command. The general syntax of MD command is MD____ directory name (enter).So with the help of this command we make a new subdirectory in DOS program.
? How to enter in the directory or change the directory:- The directories are changed in order to work in different directories.For example if we are in the directory in which only C programs are stored and we want to work in such a directory in which the FORTRAN programs are stored, we must change that directory by another directory in which our requirements can be fulfilled. The common use of this change is CD command and synatx of this command is
CD____directory name (enter).
? How to remove or delete a directory:- If we need to create a new directory,or sometimes we need to remove an existing directory.This may be caused due to low space available on the secondary storage device for example a floppy, hard disk. If you want to delete a empty directory we use RD command. The general syntax of the RD command is RD_____directory name (enter).
Q no 5:- Write down the purpose and the syntax of the following commands. Also give at least one example of each.
? Copy command:- This command is used to copy one or more files from one directory to another directory or from one drive to another drive. If yor want to copy one file from one directory to another then use this command.
Syntax:- copy___ \source directory name\file name__\terget directory name (enter).
Example:- To copy all files name 123 from the root directoty of the drive B: to subdirectory LOTUS of drive C: then the command will be.
C:\> copy___B:\123.*___C:\LOTUS (enter).
? Format command:- This command is used to make a new disk usable.
Syntax:- FORMAT____A: (enter).
FORMAT____B: (enter).
Example:- If we want to make a disk as a DOS or SYSTEM DISK, Then the /S is added at the end of the FORMAT command.
Syntax:- FORMAT_____A: or B: ADD /S (enter).
? Deltree command:- This command is used to delete all files and all subdirectories of the current directory.The general syntax of this command is
Deltree___directory name (enter).
? Diskcopy:- This command is used to make duplicate of a disk. The general syntax is Diskcopy____A:B: (enter).
Example:- Some times we need to make a duplicate of the A: drive then we use this command. Syntax:- Diskcopy____A: A: (enter) then insert source disk (enter) Then insert target disk (enter).
? Path command:- This command is used to set a search path for different directories.The general syntax of this command is
Path=[directory _name] ; [directory _name].......
Example:- When we type the name of any executable file press enter to run some
program. The DOS, first searches this file in the current directory and if it does not find it, then it searches in all sub-directories given in the PATH command. For example,
PATH=C:\;C:\DOS;C:\WINDOW;C:\DATA\PERSONAL (enter).
Q NO 4:- Differentiate the following as internal and external commands?
? INTERNAL COMMANDS:- The following are internal commands:
DIR CLS TYPE DATE RD VER.
? EXTERNAL COMMANDS:- The fllowing are external commands:
PRINT XCOPY CHKDSK EDIT.
Q NO 5:- Write the commands to do the following tasks;
1) Display all those files having extension exe in all the directories and subdirectories.
2) Copy all those files having the extension com from a subdirectory source to another subdirectory destination on the root directory.
3) Delete all those files, in a directory abc inside directory xyz, starting with ab.
4) Format a disk in drive a: such that all system files are also copaied.
5) To get help about a command xcopy only.
Q NO 8:- Fill in the blanks:-
1) There are two types of software, namely system software and ---------------------
Software.
2) The syntax of print command is -----------------------------------------------
3) Diskcopy A:B: comman is used to -------------------------------------------
4) Executable file have extension ----------------------------------------------.
5) The extension bat stand for ------------------------------------------------.
6) To check the version of the dos we use ---------------------------------.
7) Erease command performed similar function as ----------------command.
8) To display the contents of the text file we use -------------------command.
9) Subdirectories in dos are called ------------------------ windows.
10) Dos stands for -------------------------------------------.
Q NO 9:- Mark True or False for each of the following.
1) Device drivers are a kind of application software..................
2) Renaming a file named lodfile to newfile canbe done by the command COPYODFILE NEWFILE...................
3) Deleting a file named EXTRAFILE.EXE can be done by the command DELEXTRAFILE.EXE.....................
4) The scandisk command checks your computer for viruses..................
5) MSWORD is an application software ............................
6) A computer command is an instruction to the user to do spacific job------------
7) In dos ? and* are called wild card -------------.
8) Diskcopy command is an internal dos command----------------.
9) Msdos.sys is a dos kernel file--------------------.
10) Print command is used to take soft copy of a text file on a line printer---------.

CHAPTER 8
Q NO 1:- What is an operating system? What tasks are performed by the operating system?
Before starting windows it is better to define an operating system. An operating system is the software, wich makes your computer functional.Without an operating system it is not possible for a computer to work. It is the bridge between the computer and user. It makes the hardware of the computer and other’s software functional. In other words for the hardware and software of the computer to work, there must be an operating system for the computer.
What tasks are perfored by an operating system:-
? It makes the computer functional.
? It manages the hardware and software of the computer.
? It manages the hard disk, floppy drive, and other drives attached to the computer.
? It gives you a backup and restore facility.
Q NO 2:- Write the steps to perform the following?
Hide the file named hide.exe. Selects those files which have the extension EXE, then press file menu___properties___hide__apply__ok.
Create a folder on a desktop:- Press the right button of the mouse___selects new__folder___type folder name.
Restore files from the recyclebin:- Open recyclebin__selects files__selects restore or undo delete.
Explore the directories:- Open any drive___view__selects explore__selects any one option.
Rename a file; rename.exe stored in My Document folder:- Open my document__selects the file__click file menu___selects rename__type new file name and extension.
Q NO 3:- Explain the complete environment of Windows.
If window 9x is installed on your computer, and you turn on your computer, you will see the following start up screen on your computer.
START BUTTON:- At the bottom of the screen, there is a start button.It is called the start button, because it is the starting point of windows.When you click on it the following menu will appear, called the start menu.
START MENU:- It shows all the commands/tolls available inWindows 98.This is the only menu from where you can selects the command you want to run.
TASK BAR:- It is the bar usually at the bottom on the screen having the start button on it.
DESKTOP:- It is all the area, which you see on the screen. It is the area where you can move icons, open your programs, create icons for the programs, and delete icons.
ICON:- These are small figures having the name under them. These represent the programs, folders, and Windows icons.
WINDOWS:- This is frame used by Windows operating system to open a program. A typical Windows has the following parts:-
BORDER:- These are the borders, which shows the area taken by the program.
TITLE BAR:- This is the bar at the top of a Window, which shows the name of the program running in it.
STATUS BAR:- It shows items like data, number of objects in the windows, etc.
VERTICAL SCROLL BAR:- Appears when the program or text exceeds the vertical area provided by the window.
HORIZONTAL SCROLL BAR:- Appears where the program or text exceeds the horizoantal area provided by the window.
Clip control:- These maximize, restore and close buttons at the top of the window.
Maximize Button:- When you click on this button, the respective window will take its largest possible size and will take up the whole desktop area.
Minimize Button:- When you click on this button, the respective window will take its smallest possible size and appers on the taskbar.
Close button:- When you ckick on it, the respective window will be closed.
Restore button:- When you click on it, it brings the window to its previous position.
Control Menu:- It is used to manage the size and postion of a window. It appears when you click on the right icon at the title bar.It has the following options:-
? Restore
? Maximize
? Minimize
? Move
? Size
Move:- Used to move the windows from one position to another on the desktop.
Size:- Used to set the size of the window.
My computer:- This icon comes with window 9x operating system. It shows all the devices that a computer has, like floppy drive A, hard disk C, and D, CD- drive F or E, printers, Deal Up networking, Control panel, Scheduled tasks like anti virus program, and web folders.
Recyclebin:- When you delete some object from your computer, it comes in the recyclebin. It has two options:-
? Restore:- When you click on it, the selected item will be undeleted or restored back to its original location in the computer.
? Empty recyclebin:- It is used to delete all the items from the recyclebin.Once the items are deleted from the recyclebin, there is no way to restore them back.
Control panel:- As its name indicates, it is the panel consisting of a program used to control the computer and peripherals.
Display:- It is used to set the following properties:-
? Backgrouind:- It sets the background of the windows environment like a wallpaper, pattern that appears on the dektop.
? Appearance:- It is used to sets the colour and size of different parts of a windows.
? Screen saver:- It is used to sets the screen saver of the computer.
Mouse:- It is used to sets the different function of the pointer:-
? Double click speed:- It is used to increase or decrease the double click speed used to run the programs.
? Right handed and left handed mouse:- It is used toset the mouse for right hand or left hand use.
? Motions:- It is used to set the mouse movement
? speed.
Keyboard:- It is used to set the function of the keyboard eg. repeat rate, delay after first repeat, etc.
Modem:- It is used to set the modem used in the computer.
Network:- It is used to set the network option.
Printer:- It is used to add / install the printer.
Add /Remove programs:- It is used to add or remove the program from the hard disk of the computer.
Fonts:- It is used to add / remove fonts.
Shuting down windows 9x:- If you want to close or shut down the windows 9x.
M:- Start___shut down___selects shut down___ok.
Operating system:- Operating system is the first software that first loads into the system memory (RAM) when the computer starts. Operating system is an interface between the user and the computer hardware.
Concept of booting:- The system BIOS (Basic Input Output System) plays a key roll in searching the operating system. The Bios is a burnt in program stored on a chip during the manufacturing process of the computer motherboard.
Q NO 4:- Write the complete process of Windows installation.
A. Insert bootable disk in floppy disk.
B. Insert the Windows 98 cd into your CD- ROM drive.
C. Then selects start computer with CD-ROM
D. A: prompt appears on the screen.
E. Then enter this into the CD-ROM drive.
F. Then enter this into win98 directory.
G. Then type setup.
H. Window 98 setup start by performing scandisk of any possible errors on the hard disk, exit after completion of scan.
I. Setup screen appears, press continue to go ahead.
J. Selects the directory where you want an operating system to be installed and click next.
K. Setup makes the directory and determins available disk space required to install windows.
L. Selects the type of installation you want to perform.
M. Selects the Typical.
N. Type your computer name and workgroup name and click next.
O. Setup will ask if you want to create a startup disk. Click of for the startup disk (insert disk) or cancel if you do not want to create the disk.
P. Windows setup will copy files to the hard disk.This may take 30-60 minutes depending on your computer.
Q. Finally it will restart your computer.
R. Give the user information when setup allows.
S. Give the serial no(CD-KEY) given on the back of the CD cover you purchased.
T. Setup will again start and finalizes the settings.
U. Set the time zone when the time zone screen appears. Set it to Islamabad, Karachi, Tashkant.
V. Once you have done the settings the computer will restart.
W. Once restarted the computer will install the drivers, for example Sound, VGA, etc.
Q NO 5:- What is a computer virus? Describe in detail its different types.
VIRUS:- Virus is a parasitic program that is found in the programs or in the boot sector of the disk. Boot sector of the disk is the logical part of the disk, which contains the operating systems commands necessary to boot up the computer.The boot sector is the first area read by the computer when it is turned on. Viruses are very dagerous and destroys the programs, data files, information on the screen, and even wash the computer hard disk.Viruses is spread when floppy diskes or CDs are used to transfer the data from one compuer to another.
ANTIVIRUS:- Antivirus is a program, which detects the virus in the boot sector and memory of the computer. It also detects the virus in the data files and other files in the disk. It is used to detect the virus and try to remove it.
TYPES OF VIRUS:- The different types of viruses are:-
• Macro Virus
• Devolving Virus
• Boot Sector Virus
• TSR File Virus
• Non TSR Virus
• Companion Virus
• Overwriting Virus
• Multipartite Virus
Macro Virus:- Macro virus is the first virus to infect data files rather than executable files. Today many applications have macro languages, so the problem is a growing one. Macro viruses spread through people who send infected document files to each other, eitheron a floppy disk, or via the interal LAN or via an internet.
Boot Sector Virus:- One of the most common types of viruses are boot sector viruses, for example, Form and stoned. These viruses infect floppy disks in either of the following parts:
? Master Boot Record (MBR).
? Partition Sector of the DOS Boot Record(DBR).
? DOS Boot Sector of the disks.
TSR File Virus:- A less popular kind of virus is the Terminate and Stay Resident (TSR) file virus. As the name suggests these infect files, usually COM and EXE files. Although over 99 percent of executable programs have the extenstion COM and EXE, some do not.
For a TSR virus to spread, someone has to run an infected program. The virus goes memory-resident, typically looking at each proguam run thereafer and infects.Some viruses are called fast infectors and they infect if you just open the file.Dark Avenger was the first fast infector.
Non TSR virus:- There are less than one percent of reported outbreaks of Non-TSR viruses. With such a virus, running an infected program runs the virus, which at that time looks for another file to infect and infects it. Vienna is the most common Non-TSR virus seen very rarely these days.
Companion Virus:- If you have a COM file and EXE file with the same file name and you type that name, DOS runs the COM file in preference to the EXE file. Companion viruses use this fact- each file that you have acquires a companion COM file with the same name.Then, when you try to run you exe program, the COM program is actually run and that is the virus.
Over writing virus:- An overwriting virus simply overwrites each file it infects with itself. Once overwritten the program will not function, it will become so obviously apparent that something is wrong that either you will get rid of it or copy it again. This is the main reason that overwriting viruses were/are never successful in spreading.
Multipartite virus:- Some viruses infect multiple objects, when you run an EXE infected with a multipartite virus, Tequila, puts itself on the MBR,. When you boot up, the computer, Tequila runs from the MBR and goes to memory-resident, while Tequila is in the memory-resident, it infects EXE file thereby infecting multiple objects. Other viruses like, Anticad infects EXE and MBRs interchangeably.Some viruses infected COM, EXE, MBRs, and device drivers.Multipartite viruses are the third most common kind of virus.
Devolving virus:- Some viruses are badly written and ‘lose’ there own macros. The original virus may consist of the set {Auto, File Save, and File Save As}.However, if the user invokes file{Save As, the virus will fail to copy the File Save macro}. The resulting virus set { Auto, File Save, and File Save As}is known as a Devolved Macro and the original virus is devolving.
Q NO 6:- What precautionary measures can be taken to avoid virus attack? Explain.
The following precautionary measures can be taken to avoid viurs attack.
? Use standalone PCS:- As we know that virus need a mediun for its propagation, where disks and especially network- which are quite exposed to infection provides this opportunity and the virus goes on spreading form system to system. Therefore the avoidance of modens will make it difficult for viruses to computer system.
? Avoid the use of Modem:- As virus can pass very easily through electronic mail, bulletin boards, and other communication software and also through software downloads. Therefore the avoidance of modens will make it difficult for viruses to infect computer system.
? Ensure that you are the only user of your computer and software:- This is often a very hard condition to meet and the term’you’ will invariable mean you and your secreatary /partner / clerk etc. However,try to minimize the number of people using a particular computer.The use of Passwords can make it more difficult for unauthorized persons to access your computer.
? Never use Pirated software:- Many viruses are carried on pirated versions of well-known products and so user should always ensure that they are using genuine copy of all the packages on the computer.
? Only use public domain or shareware software from recognized source:- As public domain software is so easily copaied and sent from user to user it provides a good vehicle for transportation of viruses. The sgare ware market has grown a lot over the past few years offering a wide range of good quality utilities and software packages at very low prices, and many cataloguesa and clubs providing this service declare that their software are tested and are virus free. However, it is still recommended to re-test all software before installing on your computer.
? Avoid using non-certified anti-virus software:- As we know that there are hundreds of anti-virus program and some of these are not as reputble as the might be, containing lethal viruses themselves.
? Write protect critical or sensitive files:- The simplest form of virus protection on floppy disks is to place a write protect tab on the disk so that any attempt by a virus to write to the disk would be foiled.
? Use of anti-virus software:- Anti-virus software is the solution to many problems created by viruses. There are many kind of anti-virus.actully it is a vest idea to install anti-virus to tell the computer to virus check everything each time when it is loaded.
? Uses of Scanners:- A scanners is a program that knows how to find a particular collection o viruses.Virus Guard(DOS) and Win Grard(Windows) are on-access scanners and work continuously. As soon as any disk is accessed, it is checked for boot sector viruse,and as soon any file is used, it is check for viruses.
? Uses of checksummers:- A checksummers is a change detector. Executabl files should not chage, except for a good reason like updating of the software. A checksummer aims to detect changees. The advantage of checksummers is that
they do not detect a collection of viruses, so do not need updating.
FILL IN THE BLANKS:-
1. GUI stands for Graphical user interface.
2. The software, which is loaded first in to the memory when a computer is started, is called Operating system.
3. BIOS stands for Basic input output system.
4. FDISK command is used to Partitions of hard disk.
5. During installation portable option is chosen for Lop top machines.
6. Anti-virus is used to Remove the virus.
7. Scanners are used to Find a particullor colleution of virus.
8. Chechsummers are used To change the detecter.
9. Boot sector viruses infect Floppy disk.
10. TSR stands for Terminate-and-stay-resident.
MARK TRUE OR FALSE FOR EACH OF THE FOLLOWING.
1. Windows 98 is a complete operating system. (True).
2. Windows 98 is multitasking operating system.
3. Windows 98 is multi user operating system. (True).
4. Windows 98 can support 8 monintors at a time (True).
5. Windows 98 is a command based operating system (True).
6. Start button is used to open My computer folder (False).
7. The three basic parts of windows 9x are my computer, control panel, and recyclebine (False).
8. Close button is used to shut down windows (False).
9. Control menu is used to control the size, the position of a windows (True).
10. Recycle bin contains all the deleted items until they are restored or permanently deleted (True).