Computer



CHAPTER - I

(

COMPUTER

Introduction

The use of Information Technology is well recognized. This has become must for the survival of business houses with the growing Information Technology trends. “Computer” is one of the major components of an Information Technology network and has gained tremendous popularity. Today computer technology permeated every sphere of existence of modern man. From railway reservation to children’s education, from medical diagnosis to population analysis, from TV programs to satellite launching, from match making to criminal catching, from construction to destruction-everywhere we witness the elegance, sophistication and efficiency possible only with the help of COMPUTER.

What Is A Computer?

Let first define the term “Computer”. Computer is defined in the Oxford dictionary as automatic electronic apparatus for making calculations or controlling operations that are expressible in numerical or logical terms”.

The definition clearly categorizes computer as electronic apparatus. The definition is also pointing towards the two major areas of computer applications viz. data processing and computer assisted control/operations. The another important confluence of the definition is the fact that the computer can perform only those operations/calculations which can be expressed in logical or numerical terms.

Computers: Then and Now

If we want to know about computers completely then we must start from the history of computers. The very first attempt towards this automatic computing was made by Blaise Pascal. He invented a machine which consisted of lots of gears and chains and used to perform repeated additions and subtractions. Later on, Charles Babbage, the Grandfather of modern computer designed two computers-

1) The Difference Engine &

2) The Analytical Engine.

After going through the three consequent generations of computers, now we have the VLSI-based computer architecture is sometimes also referred to as Fourth generation computer. The VLSI technology is still evolving and more and more powerful microprocessors and more storage space now is being put in a single chip.

Classification of Computer:

Computers can be classified under four main classes. These are:

1. Micro Computers 2. Mini Computers

3. Mainframe Computers 4. Super Computers.

1) Micro Computers:

The microcomputer originated in late 1970s. A microcomputer’s CPU is a microprocessor. The first microcomputers were built around 8-bit microprocessor or chips. An advancement over the 16/32 bit chips are the 32/32 bit chips. Some of the popular 32-bit chips are, Intel’s 80486 and MC 68020 chip. Now we have also 64-bit chips. It is also called as a single user system. Examples: 486, Pentium-I to Pentium-IV.

2) Mini Computers:

Minicomputers are multi user systems. And it was originated in 1960s.The 16-bit minicomputer was more powerful machine, which could be used in variety of applications and could support business applications along with the scientific applications. Gradually the architectural requirement of minicomputers grew and a 32-bit minicomputer, which was called “Super mini”, was introduced. Example: (1) P.D.P-8 (2) P.D.P.-II (3) VAX-7500 (4) HCL (5) DASIS etc.

(3) Mainframes:

Mainframe computers are generally 32-bit machines or on the higher side. These are suited to big organizations, to manage high volume applications.

Examples: (1) I.B.M-360/370 (2) I.B.M-1390 (3) DEC-1090 (4) CYBER 170 etc.

(4) Super computers:

Super computers are mainly being used for weather forecasting, computational fluid dynamics, remote sensing, image processing, bio-medical applications etc. Examples: (1) CRAY (2) ROBOT (3) HITACHI (S series) (4) CRAY XMP-14 (India).

Computer Applications in Business:

Today, most large and medium sized companies are almost totally dependent on their computers for numerous administrative functions. It has been found that commercial data processing accounts for 80 per cent of all computer usage.

Some of the business fields where computer application is being used widely are as follows:

➢ Computers in Inventory Control:

Once data about customer orders is received from any order processing system, a computer-based inventory control system records changes to inventory levels and process appropriate documents.

➢ Computerized Sales Order Processing:

Computer-based sales order processing system provides a fast, accurate, and efficient method of recording and screening customer orders and sales transactions.

➢ Computer’s Role in Banking:

Today, banking is almost totally dependent on the computers. A large amount of bookkeeping is now handled very efficiently and quickly with the help of computers. Under computer control, customer’s statements are prepared and printed out onto specially preprinted stationary. The computer also provides each branch, and its customers, with prompt access to information from a much wider financial world than would be possible under a manual, local system. New developments such as automatic cash dispenser, ATM, are making it even easier for customers to deal with banks.

Implications Of Computer Applications:

[pic] Computer’s impact on Planning

Generally speaking, the use of computers can have an impact on planning activities by:

[pic] Causing faster awareness of problems and opportunities:

Computers can quickly signal out-of-control conditions requiring corrective action when actual performance deviates from what was

planned. Planning data stored online may permit managers to probe and query files and receive quick replies to their questions.

[pic] Enabling managers to devote more time to planning:

Use of the computer can free the manager’s clerical data-gathering tasks so that more attention may be given to analytical and intellectual matters.

[pic] Permitting managers to give timely consideration to more complex relationships:

The computer gives the manager the ability to evaluate more possible alternatives; it makes it possible for managers to do a better job of identifying and assessing the probable economic and social effects of different courses of actions.

[pic] Assisting in decision implementation:

When decisions have been made, the computer can assist in the development of subordinate plans that will be needed to implement these decisions. Computer-based-techniques to schedule project activities have been developed and now are widely used.

Electronic Data Interchange (EDI):

Traditionally, data transfer from one company to another is done through the paper documents, which have to be manually forwarded and entered to the destination computer. The whole process is time consuming and expensive to operate.

The solution to the above problem comes in the form of Electronic Data Interchange (EDI). As quite obvious from the name, EDI refers to the electronic interchange of data between computer systems. More precisely EDI id defined as “the transfer of structured data fro processing from computers using agreed format and protocols”.

Examples of current uses of EDI include ‘Automatic Teller Machine’ (ATMs) in banks, ‘airline reservation system’, ‘stock exchange’ etc.

Computer Applications in Productions Planning and Control:

Production Planning is one of the most lucrative computer applications that a company can undertake. Advantages of computerized production control can be summarized as follows:

❑ Reduction of work in progress and buffer stocks.

❑ Progressive tightening up of management.

❑ A challenge to management.

❑ Management statistics provided.

❑ Long term effects of management decision shown.

❑ Over and under loads on facilities shown.

❑ Foremen enabled to plan ahead.

❑ Progress chaser shown what and where to chase.

❑ More accurate information updated as and when required.

❑ Reduced paper work in use at any one time.

❑ Better communication made possible.

CHAPTER – II

What is a Computer?

The Computer

A computer is an electronic machine that processes our data or information and gives us the result. It is a machine, which can understand only electronic signals. It provides us with output based on the data we feed in. that is why it is called GIGO unit; i.e., Garbage In Garbage Out.

Parts of Computer

Computer has four main parts:

1. Monitor – Screen (VDU – Visual Display Unit)

2. CPU – Central Processing Unit

3. Keyboard

4. Mouse

All these are connected through electric wires.

Other parts are:

1. Speaker

2. Scanner

3. Printer

4. Camera

5. Joystick

6. Modem

7. Floppy Drive

8. CD Drive

9. Pen Drive

10. UPS – Un-interrupted Power Supply

Input & Output Units

We put data in the computer through input unit. All such units are also called Peripherals or Hardwares. Keyboard, Mouse, Floppy Drive, CD Drive, Scanner is the input devices; whereas Monitor, Printer are the output device.

CPU performs the multiple functions. It is an Arithmetical Logical Unit cum Control Device. It consists of Hard Disks, Floppy Disks, etc. which are called Memory or Storage Device.

Input………Processing……….Output….

1. Input is the data that we give our computer to work with.

2. Processing is the work that the computer does on the data.

3. Output is the answer or what comes out.

Data & Information

# By data we mean collection of facts.

# Facts can be in the form of words, numbers, sound, etc.

Collection of facts in their raw form is data.

# When a computer finishes processing the data, we get information as output.

Data is changed into Information. Information means data in better form, i.e., in the form we want it for daily use.

Processing Unit

The CPU (Central Processing Unit) is the part of the computer that does the processing. It has three main parts:

a) ALU (Arithmetic & Logic Unit)

b) Memory Unit

c) Control Unit

Computers are “thinking machines”. The “thinking” or work that a computer does is called processing and the brain of computer is called the CPU. It converts data into information.

Computers work everything by numbers. The ALU is where the computer works out all its circulations. When it has finished, it sends the answers through the CPU to the Memory, which stores the information. Data is also stored in memory. Control Unit manages the various parts of the computer.

Characteristics of a Computer

They are:

a) Speed: Electrical pulse, which travels at high speeds in computers, makes the manipulation pf data processing at incredible speeds. The computer performs several million calculations per second.

b) Storage: Its internal memory (main or primary) is generally large enough to retain considerable amount of information. Storage is measured in kilobytes (KB) and megabytes (MB). One byte is equivalent to one character.

c) Accuracy: The formula set in its give accurate results only. Whatever may be the long calculation, it performs up to its exact result without any mistake.

d) Automatic: Once the processing of data begins it would continue till completion without human. That’s why; it is called an automatic device.

e) Diligence & Versatility: Computer can work in so many applications at a time without getting tired up. And it works diligently on all the applications.

Hardware And Software

The components which are all physical materials and we can touch and feel those are all called Hard wares. All input devices, memory, CPU, Output devices are Hardwares.

But only those components are not enough for the computer to work. The programs (certain set of commands) are called Soft wares. A software package basically is one or more computer programs; which consists of one or more Computer Instructions or Commands.

For example, the cassette player and the cassettes are hardware and music and songs recorded in it are called software. We need different kinds of soft wares for doing different types of work in computer.

Software Packages may be divided into two types – Operations Systems and Application Packages.

Operation System

The hardware components inside the computer are controlled by software packages. Just like specialized workers in your house, the operation system programs get the detailed low-level routine tasks done from the hardware components. These programs enable us to concentrate directly on the content of the letter we are writing, for example; we do not have to worry about how the text the letter will be transmitted from the keyboard into the memory or how this text will actually be displayed on the monitor. In the background, the operation system takes care of these low level tasks. The OS is so important that we are not able to work without this loaded in the computer.

Application Softwares

These are the specialized programs for a special work. We load soft wares as per our requirements. For example, Word Processing Software helps in writing letters, notes, stories, etc; Graphics software lets us draw picture on the computer.

Popular Software

A. Operating System:

1) DOS

2) Windows

3) Mac

4) Linux

5) Unix, etc.

B. Applications:

1) MS –Word

2) MS –Excel

3) FoxPro

4) MS – Paint

5) PageMaker

6) Media Player

7) Games

8) Calculator

9) Logo

10) Basic, etc.

How to Start the Computer

• Switch on the electric supply.

• Switch on the CPU.

• Switch on the monitor.

Once the computer is switched on, you will see a blinker flashing on the screen. It is called the cursor. It indicates that the computer is ready for work.

How to Shut Down the Computer

• Click the mouse on the Start Button or Press the Window Picture Key on the Keyboard.

• Click Shut Down or Press Up-Arrow until it selects the shut down menu & then Press Enter Key.

• Choose the Shut Down menu from the list.

• Switch off the CPU when the command “It is now safe to turn off the computer” comes.

• Switch off the monitor.

• Switch off the electric supply.

CHAPTER – III

Computer Generations

Electronic Computers

IBM’s Mark-1 was the first electric computer built in Harvard University by Howard Aikens. Mark-1 could multiply two 20-digit numbers in 5 seconds (1948). John Eckert and J.W. Mauchly made the first electronic computer of history that had a small memory. It was ENIAC. ENIAC used decimal system. It was a monster like computer having 18,000 electronic vacuum valves. It was the first computer generation. BINAC was the other computer of this generation, but it used binary system. We shall learn later, what are the decimal and binary systems. Let us first learn what is the meaning of “first generation”.

ENIAC was built in the year 1946. It was the first electronic computer. After this, several types of electronic computers have been built, but now each type of computer uses a new technology. Instead saying ‘’type” we will say “generation”.

Generation of Electronic Computers

You must have seen your grand father. He was wearing dhoti and kurta. Your father might be wearing full pant and shirt but you wear slacks and jeans, tops and bottoms of different types. These are three generations of an Indian family. In case of computers, in the forty years, five different generations have emerged. The pocket calculator of fourth generation is 1000 times faster than the first electronic computer. ENIAC itself was 100 times faster then the first electric computer Mark-1.

First Generation

In each computer there is a basic switching element that allows a pulse to pass through or not. This is called gate. In first generation computers the electronic tube known as VALVE was used. The water tap is a “valve”. If you open the tap or valve, it allows the electrons to flow. Flow of electrons for a moment is known as “pulse”.

Second Generation

In Second-generation computers, Transistor was used in place of electronic valve. Transistor did the same thing as the valve did but,

• It was much smaller in size.

• It consumed less power.

• It made very little noise.

• It was more reliable.

Third Generation

The third generation computers used a ‘Chip’ or integrated circuit. In an IC hundreds of transistors are fabricated on a very small chip and connected through printed metallic lines, which act like wires. This has further reduced the size.

Fourth Generation

Later on it possible to put all components of a computer in a chip, that is known as microprocessor. Any such microprocessor will have tens of thousands of transistors and other components built in it. Fourth generation computers used microprocessor. This is called a Micro Computer or “Micro” in short. Micros are of three types.

a) Pocket Computer (Memory up to 4 KB)

b) Home Computer (Memory up to 64 KB)

c) Personal Computer (Memory up to 64 MB)

Fifth Generation

Fifth generation computer will have a number of parallels circuits. They will have some thinking powers also. This power is known as Artificial intelligence. Optical, atomic and biological computers are also being made. Several and different both words are of equal meaning we can use either several different here methods have been used in making computers as given below:

• Primitive calculators—Sand, Pebbles, Stones.

• Analog calculators—Napier’s bones, Logarithm, Slide rule.

• Mechanical calculators—Pascaline, Difference Engine, Z1.

• Electrical relay Computers—Hollerith’s tabulating machine, ENIGMA, Collosus, Z2, Z3, Z4.

CHAPTER – IV

A Little About DOS

What is DOS?

Dos is stand for Disk Operating System. It is a collection of a program. It enables the machine to us its own parts efficiently. It can also be termed as soon as acts as a interface between you and our computer.

Why do we need DOS?

What we type in simple English language, computer does not understand what we type because the only language that the computer understand is machine language. So to convert this simple English into machine language we need DOS.

Language Written in forms of Zero and Ones is called Machine Language. DOS version started from 1.0, 2.0, 2.1, 3.3, 4.0, 5.0, 6.0, 6.22 .

DOS is collection of program

1) Input Output system

2) Command processor

3) Utilities program

Input Output System Program:

Whenever we type, characters are sent from one part to another at this time, the input-output system program of your DOS plays an important role.

The Input-output system program of your DOS has two files - IO.SYS, , MSDOS.SYS, . These systems files never appear while listing the files on the disk that is when you give dir command.

Command Processor Program:

The command processor program the name implies processes the command you type from the keyboard - Language into machine language. Due to command processor program you get a:> or c:> on the monitor.

Command processor program consist one file -

1) MS-DOS company makes this file with name

2) PC-DOS company makes this file with same name i.e.

Utilities Program:

The rest of DOS consists of programs called utilities. This programe can be used also after DOS has being loaded. To use this program we require external files on our Hard Disk.

C: Prompt, Command line

Now, we will talk about a computer in which DOS has already been loaded. When we switch on the computer, after a few seconds, we see the following display at the bottom of the monitor screen,

C:\> _

This is called the C: prompt. The dash on the right will twinkle. This is the cursor. The stage is now set for you to type instructions into the computer using the keyboard. The cursor shows the position at which a typed letter will be displayed.

The rule of DOS is, you may type your instructions only on the single line on which the cursor rests. This is called the Command line. Our instructions to the computer are called Commands. After typing an instruction on the command line, when we press the Enter key, DOS tries to understand the meaning of the command and works accordingly. Remember, we must press the Enter key for DOS to act on commands.

DOS identifies the Hard Disk by the name C: and the Floppy Drive by A:. If there is a Second Floppy Drive, it is B: to DOS.

Computer Files

Whatever information you put into the computer is written and kept in computer Files. It is in the form of electronic characters. Different types of information are kept in different types of files. For example, Programs are kept in Program Files and datas are kept in Data Files.

A program is a series of instructions. When a program is executed, the computer does the job for us by following the instructions in the program.

Each file has a unique name. You have to give a name of your choice to the file you create. All these files are written in the computer disks. A file name cannot be more than eight characters and it cannot contain special characters like +, [, etc.

We may add a dot after the name and add three more characters after that. This is called extension. We may or may not add extension to the file name. The extension is used for identifying different types of files. Suppose, we have prepared a letter in the computer as, Letter.doc

Again, suppose you purchased the LOGO program from the market. You will notice that the full name of the program file is -

Note that, extension is not necessary. A file has the name - Birthday. In this file you might have written the birth dates of your friends.

Files are of two types, Program and Data. The files birthday and letter.doc mentioned above are data files. The program files contain program or instructions that the computer understands. The computer executes theses instructions to process the data stored in the data files and intimates the result to you.

Example: We have written a program called Biggest for finding out the largest among a set of given numbers. The numbers are stored in a data file called Numbers. Suppose, the numbers are 5, 12, 6, 45, 32 and 25. Program and data both will be stored in files in your computer disk. You are at C: prompt. Now let us see, how you may run the program,

C:\> Biggest

What is your data file? _

See, how easily you may run a program. At the C: prompt, just type the name of the program to be executed and press Enter. The program will start running and may ask you the name of the data file at the next step. The dash on the second line indicates cursor. Now the computer is waiting for your reply. You have to input the name of the data file. Let us see what happens now,

What is your data file? Numbers

The biggest number is 45

As soon as you have typed the name of your data file and pressed Enter, the Biggest program reads the Numbers file from disk and finds out the largest number. Now the program has only to display the result to you. It does so in the third line above. In this manner a program is run or executed.

The full name of a program that you may run in DOS normally ends with the extension .EXE or .COM. By these extensions, DOS knows that it has to execute the file.

Directory

Directories are for systemically storing different types of files in your disk. We may keep different types of files in directories just as we keep class notes on different subjects in separate drawers of your table. Just like files, each directory has to be given a unique name.

Normally, when we switch on the computer, it prepares itself for work and stops with the cursor at the C: prompt. The directory in which you are working now is called the root directory of C disk.

You may want to know the names of files contained in this root directory. The command for that is dir,

C:\> dir

If you give this command, you will see the names of all the files in the root directory. These names will be displayed line on the monitor. A directory not only contains files, it may contain other directories also. The list of names that you see on giving the command ‘dir’ contains names of both files and other directories. These other directories, in turn, may contain other files and other directories.

After some time of use, your hard disk will usually have hundreds of files. A few will be your creation. The rest will be program and data files that you purchased. If you do not keep related files in different directories, all will be mixed up. In this situation, if you want to keep back-up copies of your files, it will be very difficult for you to find your own files let alone copy those.

Working with Files

In this section we will learn many commands for working with files.

Copying a File

The command format for copying is

C:\> copy [old file name] [new file name]

You don’t have to give the brackets with the file names. Suppose, every year you create a file books to keep the list of names of the books of your new class. At the start of a year, the book file contains the book list of last year. You want to create a new book list file but want to preserve the book list of last year in a separate file. So, before creating a new book list, you have decided to copy the old book file to a file books99, delete books file and finally create a new books file for keeping new book list. For copying you have to use the command

C:\> copy books books99

Here, books is [old file name] and books 99 is [new file name]. Both files contain last years’ book list and both are in root directory of C:. As you are in C:, the destination drive, you need not mention drive name with file names. Giving only the file names will be enough. DOS searches the file names first in the directory in which you are working. Only if it does not get the file there, it processes the directory information part of the full file name.

Now, dir command will show names of only these two files. If you wanted to copy books99 to a floppy, you would have to mention the name a: of the floppy drive,

C:\> copybooks a: books99

Deleting a File

Now, we will see how you may delete the old file books. The command for deleting files is del. To delete the books file, give the command

C:\> del books

Now if you give the dir command, you will see only the name of books99 file. Remember, you have to be very careful when using the del command. If you delete an important file by mistake, you would be in trouble.

Renaming a File

The command for renaming a file is ren.

C:\> ren books books99

Viewing a File

There is only one type of file that can be read by DOS commands and also by any word-processing software. These are called ASCII text files.

Different application programs create files of different internal formats. That is why the problem of reading with another program arises. The ASCII text files are very simple with standard format and so is readable everywhere.

The DOS command for creating an ASCII text file is edit and the command for reading it is type. Let us see how type works. Suppose, you had already created our earlier file books through edit. We have to give the following command to see the contents of this file,

C:\> type books

On giving the above command, the book list will be displayed on the screen one line after another.

C:\> type books

Bengali Amar Bangla

English Radiant Reader

Mathematics New Math

C:\> _

More DOS Commands

Clearing the screen

Sometimes the monitor screen gets filled up with text or other matter. To clear the screen, you may use the following command,

C:\> cls

Seeing date and time

The computer has a clock inside it. The computer uses this for many purposes. When the computer is switched off, its clock runs on an internal battery. The clock keeps both date and time. The command to see the date is date. On this command, the computer displays today’s date and gives you a chance to correct it. If you find this date wrong, just type the correct date and press Enter. The computer will then correct its own clock date. How can the computer date be wrong? If the battery running the clock becomes weak with time, the computer clock may show wrong dates,

C:\> date

Current date is Wed 01-02-1998

Enter new date (mm-dd-yy): _

See in the second line that the date is wrong. No need to worry. You will get the chance to correct it in the third line. If today’s date is 18th march, 1999, you have to type, 03-18-99. On pressing Enter now, the computer will correct its clock. Give the date command again. You will find new corrected date displayed. If the original computer date were correct, you just have to press Enter. The time command works in the same way,

C:\> time

Current time is 5:32:43.38p

Enter new time: _

If your watch shows 45 minutes and 15 seconds past eight pm, you have to type 8:45:15p and press enter for correcting the time.

Naming files in DOS

Normally, we do not pay much attention to the job of naming the files we use. But, giving proper names to files is important in computer work. Can you say, why you would have to name files at all? It is because, amongst the files you use, you have created some of these from scratch. These are your files. You have to name these files. Amongst the rest, some will be part of the operating system and some will be the files of the application packages you purchased. These will have their names given already.

Next question is, what is meant by properly naming your files? There two things you have to keep in mind while giving names to your files. Firstly, you have to give names that are correct, and secondly, the names should be meaningful. It is very important to assign a name to a file that gives some idea about the contents of the file. For example, it is proper to name a file in which you have kept the birth date details of your friends as birthday. You might have named it as abc. But then, while seeing the file list in your directory later, you would not have been able to guess what the file abc contains.

Guessing the contents of a file from its name is important, because, after some time of computer use, your hard disk will be full of files. Computer work becomes easy and convenient, if you assign meaningful names to your files and also store files related to one type of job in a separate properly named directory. Remember; never assign file names like abc, 123 that are general in nature. Let us now see how to name files correctly in a little more detail.

Naming Files Correctly:

The rules of naming files in DOS are,

❖ A file name must be unique in the directory where you creating the file. In another directory, you may have a file with the same name. But, it is always better to use different file names even in the files are in different directories. Try creating a file with an existing name and see what happens.

❖ A file name must not be more than eight characters long and the extension, if any, must not be more than 3 characters long. If you exceed these length restrictions, the operating system would truncate the name up to the valid length. Following are a few examples,

Long names Truncated by DOS

Birthday’s birthday

Books. Chemistry books. che

Letters_to_friends letters_

It is interesting to know that, Microsoft has solved this problem of long file names in the more modern operating systems Windows 95 and its later versions.

❖ A file name cannot contain the special characters.

() + = | \. []; “ < > /

Most of these special characters are used in DOS commands somewhere or other. So, if you use these in your file names, DOS will be confused and will not work correctly as expected. That is why this restriction.

❖ A file name cannot be any of the names CLOCKS, CON, AUX, NUL, PRN etc. These are reserved by the operating system for doing special jobs. These names will not be allowed by the operating system.

Testing Correct File Naming

You may practice on the file names by using the two commands ren for renaming an existing file and seeing the result of renaming by the directory command dir. Let us understand this by some examples. Suppose, you have a file birthday and another file letter1.doc in your working directory. Give the following commands and see what happens,

C:\> ren birthday birthdays

Duplicate file name or file in use

C:\> dir birth*. *

C:\> ren birthday letter1.doc

Duplicate file name or file in use

C:\> ren birthday bdays

C:\> ren bdays birthdays

C:\> dir birth*. *

C:\> ren birthday abc+d

Path not found

C:\> ren birthday books. Chemistry

C:\> dir birth*. *

The first rename failed because DOS truncated new file name “birthdays” to “birthday” that already existed. The second rename also failed because “letter1.doc” was already there. By the third and fourth renames we tried to change the name “birthday” to nine character “birthdays”. The fifth rename using “+” in the new name gave a peculiar result. Can you say, what will be the result of the last dir command? Not that, the intention of this command was to list all the files of names starting with “birth”. This powerful method in called the wild card method.

Dos command’s are being into 2 part’s:

1. Internal command’s 2. External command’s

1) Internal commands: - resides in your command. Com. once you load this file in ram, you can use internal command directly on the a:> or c:> (Prompt).

2) External commands: - to use this command’s you require external files. This files comes in your utility program that is the third examples of:

Internal command External command

1) Dir option’s Chkdsk

2) Ver Disk copy

3) Cls Disk comps

4) Date Find

5) Time Undelete

6) Vol Label

7) Delete or erase option’s Backup

8) Copy con file making Restore

9) Copy con Comp

10) Ren Edit

11) Prompt option’s Sort

12) Md, cd, rd More

13) Type Mode three option’s Attrib

1. Dir: - this command is used to list the files on the disk.

This command shows: - 1) file name 2) extension if any

3) Bytes occupies 4) date of creation

5) Time of creation 6) file count

7) Bytes occupied by the file count

8) Bytes free on your disk.

Dir commands

1) Dir/p: - this command’s will show you list of files on the disk screen wise. I.e. 24 files on the screen and 25 lines you get a message “press any key to continue” while rest is same as dir.

2) Dir/w: - this command’s show file listing width wise. I.e. 5 disadvantages: - ** you cannot see the bytes occupied by the respective file. ** Date or time of creation

3) Dir/l: - this command show’s file listing of the disk in the lower case while rest is amel as dir command’s

4) Dir/b: - this command will show you file name sand extent ion.

5) Dir/ah: - thus cinnabd wukk sgiw tiy tge fuke listing on the disk as well as hidden files in the disk.

6) Dir/s: - this command will show you the file listing of directory and it will also show the file inside your subdirectories.

7) Dir/on: - this command will sort you the directory first in terms of no sn term’s of no’s & then alphabetical wise and then the files in term’s of no’s then alphabetical wise.

8) Dir/oe: - this will sort the files

9) Dir/od: - this will sort the files and directories in date wise fashion.

2. Ver: -This commands show you the current dos version you use.

3. Cls: - This command is used to clear the screen. It will directory take your cursor at the top of screen displaying only the prompt either it may be a: or c:

4. Vol: -This command’s show’s you the name given to your floppy disk.

5. Date: - This command can be given in two way’s

1. One step time entry a:\> time hh: mm: ss

2. Two step time entry a:\> time

Computer response: - Current date mm: dd: yy enter new date?

6. Time: - This command’s can be given in two way’s

1.One step time entry a:\> time hh: mm: ss

2.Two-step time entry a:\> time

Computer response: - Current time hh: mm: ss enter new time?

7. Directories: - At times it became mandatory to organized files into group so that a group of files can easily accessed. Such group of files is referred to as directory a disk can have multiplies directory as well as multiple directories are organized in a hierarchical manner. In this method there is a single master or a root dir. is donated by “\” Sign.

8. To make directory: - Command is Md OR Mkdir (Directory Name) Ex: Md Sky

9. To change Directory: - Command is Cd (Directory Name) Ex: Cd Sky

10. To remove directory: - Command is Rd Ex: Rd Sky OR Rmdir Sky (Directory Name)

Note: - Before removing the directory you must see the all the files are removed and the directory is empty then and then only you can remove a directory. You should be out of the directory to remove it.

Prompt: - Sets a new DOS prompt.

Prompt: - This command will only show you the current drive with a greater than sign. To change the prompt give the prompt command a with different variations.

A:\> Prompt: - Seta A new Prompt

Prompt: - This command will only show you the current drive with a greater then sign. To change the prompt give the prompt command with different variations.

A:\> Prompt A:\> A

A:\> Prompt $p $g A:\> P-path

A:\> Prompt $d $g A:\> Corresponding date G greater

A:\> Prompt $t $g A:\> Corresponding time then sign

A:\> Prompt $$$g A: $ D-date

A:\> Prompt $l A< T-time

A:\> Prompt name will give you the specified name L-less than

Sign blank

2. File making: -

1) Copy con (Filename): - To make a file dos you have a command called copy con (filename) Copy con Sky

(I will be going to Nasik)

To save it on disk press (Ctrl+ z) or F6

2) To rename a file: - To Rename file that already exist you have a command called rename or ren.

Command is: - Ren (Old file name) (New file name)

Ex: Ren Rema Prema

3) Type command: - To see the contents inside the file you got a command called type command.

Type Filename

Ex: Type Hema

4) Delete command: - This command is used to remove a file from the disk.

Del (File name)

3. Delete command

This command is used to remove a file from the disk.

Del (filename) < - / Press Enter

4. Erase command

This command is also used to remove a file from the disk.

Erase (filename)

Ex: Erase sonu < - / Press Enter

5. Copy command

The copy command is used to copy files from one place to another that is from one drive to another or it can be also from disk to another

Example: - c:\> copy Sky (filename) a:

That means you are copy file sky of c drive to floppy a drive.

External commands

Label:

This command not only you the name given to your floppy disk it also help you to modify or change the name.

1) Copy command: - The copy command is used to copy files from the one place to another that is from one drive to another. Or it can be also from disk to another.

Example: - A:\> Copy A: Hema B:

That means you are copying a file called anile from drive a to drive b

Where A: is the source destination in

Hema is the file name

B: it is the target destination

2) Edline: - (Edit a line OR line Editor) This command is used to make changes or modify the existing file.

Edit Sky (Filename)

3) Dir More: -This command is used to list the file on the disk page wised that is it is same as that of dir/p but with a change in the message more.

4) Dir Sort: - This command will sort whole disk or directory first then it will show you the bytes free. The bytes used along with the total files, then the directory in which you are the volume label. 7 then the name of files & directories is alphabetical order.

5) Undelete: - This command is used to bring back to deleted files once again on the disk.

6) Find: - This command is used to find a string of characters or number’s in specified file. Ex: Find “She” file name.

7) Mode CO40: - This command will change your mono or colour so mode to colour 4Q mode i.e. it will increase the character width to 4Q character per line instead of 8Q character.

8) Mode CO80: - This command will change the mode from mono to colour with 8Q characterized per line. This is used for games and graphics.

9) Mode Mono: - This will change the mode from colour to mono with 8Q characters/line.

10) Tree: - this command shows you the directory path listing. This command is used to see only the names. Of directories & their sub-directories in a tree format.

Command: A:\> Tree/F

11) Tree/F: - This command will show you the directory & sub-directories along with files in them but in a Tree wise format.

Command: A:\> Tree/F

12) Comp: - After copying a single file to see whether the files copied the same or no we check it with this command.

Command: A:\> Comp source file target file.

13) Attrib: - This command is used to hide the files on to the disk it is a kind of protection.

Command is A:\> Attrib +h (file name)

This command will hide your file while seeing the list of files on to disk to release it.

Command is A:\> Attrib-h (file name)

Command A:\> Attrib+ r (file name)

This command is used to give a read status to a file it will only allow you to read the file but not allow you to modify. To release it you get a command called.

A:\> Attrib-r (file name). This will allow to modify the content of file.

CHAPTER – V

Windows and Multimedia

Computers Today

The computer itself is undergoing rapid changes. It is no longer only a useful machine for the office. It has become a companion at home, a teacher for the young and a window to the world of knowledge and world at large. To make this possible, the computer hardware and software are being changed radically. With progress of time, these changes are happening faster.

In this chapter, we will give a glimpse of one of the most important elements toward change, namely, Windows Operating System. Today, majority of the PC users in the world uses the Windows as the basic operating system in their computers. On Windows, dazzling new applications are created every now and then and the whole computer industry surges forward.

1. Windows

Recall the screen of DOS where we were giving commands by typing the commands on one command line. The screen was generally black and white. We called this DOS screen as text based and non-graphical. In this type of working, one had to remember all the commands.

The way we give instruction to the computer and the computer responds is called the User Interface. In DOS environment, this interface was artificial, command-based and was not easy to use. The common users of personal computers found it difficult to adapt.

To make the computer work both easy and interesting, a new way of giving input commands was devised. This is called Graphical User Interface or GUI in short. The Computer Company – Apple Computers first created a GUI successfully for their microcomputer Apple Macintosh. But, this was a proprietary computer manufactured by only Apple. It was not an IBM compatible PC manufactured by every other company. The Software Company – Microsoft was clever enough to recognize the huge potential of this GUI concept on Personal Computers. They first made it popular in their operating system Windows.

Windows became so popular that nearly all people shifted from DOS to Windows. Simultaneously, utilizing the graphical capability of the Windows Operating System, a host of new generation applications were created. These new generation applications, though very attractive, needed more computers processing power. To meet, this demand, the computer hardware companies brought out more and more powerful computers. Overall, the development in the computer industry surged forward.

The concept of working in this operating environment is totally different from DOS. All the various tasks that we may ever want to do will either be shown as small pictures representing the tasks or will appear as options in some menu or other. One task icon will open up a new window that may contain icons for further tasks and menus. Furthermore, a menu may also contain sub-menus. The possibilities are endless.

Components of Windows

[pic] DESKTOP

After starting the computer, the very first screen and the large area that you see, is called the Desktop.

[pic] TASKBAR

The Taskbar is situated at the bottom of your screen. It contains the START button, which you can use to quickly start a program. It also displays the current System Date.

[pic] MY COMPUTER

Every programs of your computer resides into My Computer. You can access your files and folders by double-clicking the My Computer icon on the desktop.

[pic] WINDOWS EXPLORER

Windows Explorer is as same as the index of your schoolbook. You can see hierarchy of folders on your computer and all the files and folders in each selected folder. This is especially useful for copying and moving files.

[pic] FOLDERS

A Folder is like a container where your documents and programs are stored, which you can see in My Computer and Windows Explorer.

[pic] SHORTCUT MENUS

You can use your right mouse button to click any item and see a shortcut menu. This menu contains common commands that you can use on the item.

[pic] PROPERTIES

When you want to view or change information about any item, such as a document, program, folder, disk drive or printer, you can look at its properties. Use the right mouse button to view or change the properties of any item.

Using Windows

Most of the programs can be executed through a Start button menu in the bottom left hand corner of the desktop.

The Windows software has undergone many changes. At present, we will get Windows XP and Windows 2000 Professional versions of the software. When we start the computer, after a little while, Windows makes itself ready and from an hourglass, the mouse pointer changes to an arrow. Now we may work. How will we work? Just move the mouse. The mouse pointer on the screen also moves. Position the pointer on a suitable picture on the screen and then click the left mouse button. You will find that the screen changes. New windows and pictures appear.

When Windows software first starts running, the second, and third and fourth windows will not be there. These are bought from the screen by the above method. Notice a small picture of clock near the top. That is the clock icon. This icon graphically represents a clock program. When you click it twice, the clock program starts running and the larger clock window appears. This looks like a face of a running clock. Its hands actually move and you may keep time with it. Similarly, you get the Calculator program running in the third window. You may actually click the number buttons and the add, subtract and other buttons to do arithmetic on numbers. Let us learn more about these windows from the sample windows of the Windows Explorer and the Calculator.

Now, we will learn about the elements in a window. The title bar at the top of the window indicates the work being done in the window. For example, the word “Calculator” in the title bar indicates that Calculator program is running in this window.

Notice three small buttons on the right of the title bar in the Windows Explorer window. These are minimized, maximize and close buttons. By clicking on minimize, you may transform the window to a minimized name entry on the bottom bar of the screen. This does not mean you have closed the program. Everything you had done till now in this window will be available to you once you maximize it. Maximizing makes the window occupy the whole screen. In most window to a suitable size by dragging one of its corners by the mouse. By clicking the close button, you close the program.

Windows Explorer

This Windows program is very useful. With this program, you may do all the file activities like copy file, create folders, see folder contents, delete file, rename file and so on. You may do all of these by moving the mouse pointer over suitable menu options and clicking the mouse button. You do not need to input any command at all. For example, to see your contents of your floppy, click on the item denoting Floppy in the next window. This window shows the contents of the folder chosen in the left window. The scroll bar is for seeing the entries in the bottom portion of the window that is outside the visible area. Compare this method of working with the numerous commands you had to remember and input in DOS environment.

Notice the Help option in the menu bar of both Windows Explorer and Calculator windows. This is a specialty of Windows working. By clicking this option, you may always get help regarding how to do a particular task.

Color

If you have a color monitor, your Windows can be very colorful and rich in pictures and graphics. You may also change these colors by mixing the primary colors Red, Green and Blue. Apart from the colorful drawings, you may even change the color of different parts of your text. Because of this special capability, we say, Windows is colorful. Is the color only good to look at? No, you should know that, color not only is attractive, it may carry special information for you. For example, in a page of text, you may color warning text always in red and good news in blue.

Formatting and Drawing

With Windows, you may change the shape and size of the characters that you type in a word processor. Notice the different shapes and sizes of the headings and body text in this book. This has been done by using formatting facilities of a Windows word processor. In addition to changing character shapes, electronic drawings can be pasted on your document, line spacing may be changed and many other formatting actions may be taken in Windows environment. With these capabilities, you can make your computer outputs very attractive looking.

Multiple Windows

A window is a container of work. While working on the Calculator, you may open a Windows Explorer to work on files. Both windows may remain open. Each of these two windows contains all the information necessary for carrying out the task particular to the window. Any number of windows may be open at any time. Because of this facility, you may work very flexibly in the Windows environment.

2. Multimedia

In DOS, we worked mostly with text and numbers. Pictures and color were rare. With the introduction of Windows, the computer screen acquired rich colors and became full of pictures. Can you say what was the next new element the windows acquired? Obviously, it was sound.

With Windows, we can fit a special sound card in our computer, attach two speakers to it and our computer gets converted to a music system. We can attach microphones to it and record music as we do with a tape recorder. The music is actually converted in computer files and stored in the disk. To listen to music, we execute its file and the sound card converts the electronic information to the sound of music.

But, sound was not enough. Many people wanted movement of the pictures on the screen. So, in the next step, animation was created in computer. After animation, finally, the full motion video was also introduced. The Media Player in Windows is versatile software.

This combination of text, picture, animation, sound and video is called multimedia. If you have a good computer, you may even see films on CD-ROMs in your computer. Its quality does not deteriorate easily with time.

MULTIMEDIA is ability of a computer based system to handle information in the form of high quality graphics, full motion picture, full screen video accompanied by high fidality audio, superbly implement animated graphics as well as text information in any language.

The added advantage in multimedia is the ability to select and use information at will, allowing co-interaction with medium.

So, What Is Multimedia?

Combining still and moving images, sound, audio, text and interactivity, multimedia has initially culminated the revaluation of the way in which we communicate information. Day to day application of multimedia can be visualized by considering activities that resemble the process of communicating information. E.g. include education and training, reference, point of information, business presentations, manuals, data bases, geographic information systems, advertising documentaries and so on.

Hardware/ Software requirements of Multimedia:

A multimedia system includes the following components.

1. The personal computer-486/ Pentium/ Pentium 2

2. Appropriate display – preferably an SVGA monitor

3. Means of user interaction such as a remote control device, mouse, and joystick touch screen or keyboard;

4. Multimedia kit - which includes; CD-ROM drive, CD-ROM or CD-I, sound synthesizer; if necessary, a stereo amplifier with accompanying speakers.

Uses of Multimedia:

In Training: Training is supposed to be a vital process for organizational building and development. These training inputs vary from technical to soft skills training. Training is an on going process in an organization, involving various stages of a person’s carrier. Training, like specific technical knowledge, on job training as well as periodic updation of skills through refresher courses.

E.g.: Shop floor maintenance and troubleshooting heavy engineering industries, vital employee involvement in identifying mal-functions and also taking appropriate and corrective action until the expert engineers presence. This can be done through a dedicated multimedia application containing comprehensive listing of all malfunctions, the symptomatic diagnosis, short-term corrective actions as well as maintenance procedures. It can also be put to use for alerting workers against possible dangers.

Equipment/ Machinery operations: In industries where heavy machinery is used intensively, e.g. gas, petroleum etc. multimedia has proved to be a safer and more effective medium for training workers to handle the equipment. Simulation through Multimedia can be used for training such cases.

Sales and Marketing: Sales training, which is a top priority for employees’, can be done effectively through Multimedia. This training may involve sales procedures, and techniques, product research and comparisons, etc. A greater absorption of information is possible while training, as there is lesser amount of stress, which is the possibility in case of group-bound oral presentation training. Trainees can re visit the areas of interest or where there is a problem, that portion of the session time and again.

Soft Skill Training: one of the most essential and difficult areas of training is sensitizing for soft skills, such a kind of learning is essentially experienced in nature and could cover topics ranging from public relations, handling customers, team building, inter personal relationships, organizational values etc. Multimedia use here allows people/trainees to gain real life situations experience through simulations of such situations e.g. a client contact can be simulated without losing valuable customers.

Multimedia in Information Dissemination: Communication by its very definition is the dissemination of information. The difficulty lies in effective and efficient presentation of the information so that the person to whom it is addressed absorbs it. Companies disseminate information for various reasons but the need for information is heightened in a dynamic business environment.

Corporate Communication: A multimedia database consisting of an introduction to the company, its history, locations, employees, products, processed products feature and working product sale, value added services offered etc, would be an ideal presentation kit for any company. It can be used at pairs and trade exhibition for explorations of prospective customers/Investors.

Travel and Tourism: It is probably one of the industries where multimedia can prove extremely beneficial. Information kiosks at locations such as airports, hotels supermarkets, railway station would invite prospective tourists to go through the contained data or information to make choices on where to go next. Even simulations are being used to enhance, or rather help a tourist to choose between special and few selective spots. Virtual reality, a field that is still ongoing with the revolutions will be a very effective utilization of multimedia through virtual reality concepts.

Banks: They can save execution time by the installation of multimedia system, which can take care of general enquiries made by the customers for e.g. an elaborating of all the banking facilities, banking policies schemes, methods for opening and closing an account etc. in multimedia formats would save bank personnel a lot of time, while at the same time attending to customer needs and enquires.

Museums and Educational Institutions: In Institutions where the amount of information to be disseminated is voluminous and where the choice of accessing information is in the hands of the viewer, multimedia scored high against conventional methods. It is also more interesting alternative to books and periodicals.

Multimedia in business application: Not only multimedia can be used for the highly technical and time intensive application, but also smaller everyday business applications. Online updations for customer’s awareness through multimedia can be very effective by giving vital information about products, their features, price and also placement of order by customers.

Multimedia in Education: In most educational institutions we notice the absence of motivation to learn. The main factors influencing these including the usage of understanding and full textbook, lack of room for explorations, insufficient faculty interaction etc., group learning phenomenon. Adoption to multimedia allows students to learn at their own pace. Besides this, the fact that the most boring subjects are presented in a visually and orally stimulating manner using photograph, animation, text graphics, audio and video makers the subject more interesting than reading from an inanimate book.

Multimedia in Entertainment: Entertainment and game applications are still the most popular anywhere in the world. Entertainment application of Multimedia normally combine some information along with the game, now known as Infotainment in the industry, as is doubly beneficial. People learn with fun. These applications are enhanced by the diverse media elements that multimedia uses to give a finished product that is visually attractive as well extremely challenging.

Multimedia has transformed the use of computer to more than of mere data processing. The ability to use information in a faster, more enjoyable and more meaningful manner made the usage of Multimedia vital in all areas where communication plays an important role.

Multimedia makes use of Infotainment, which means Information with Entertainment.

Multimedia is the dawn of the learning with interest and fun…

CHAPTER – VI

USING PAINTBRUSH

Paintbrush is used in the Windows environment for drawing pictures. We can draw lines, squares, rectangles, triangles, circles and many other shapes using Paintbrush. In Windows 95/98, Paintbrush has 16 tools and also a colour palette. Each painting tool has a specific function.

Paintbrush In Windows 3.1

Paintbrush has 18 tools and also a colour palette. Each painting tool has a specific function.

Open Windows and get into Paintbrush. Draw the pictures.

Painting Objects With Different Colours

Now let us see how to change the colour of the picture that is already drawn.

• Draw any object; say a square, by selecting the rectangle tool.

• Select the colour in which you want the drawing and choose the fill tool from the toolbox.

• Click inside the square. You have painted the square with the help of the fill tool.

This tool can paint the picture only within a closed area.

• Select some other colour and click the fill tool inside the square.

• Try the same with different colours.

• Select any colour and click the fill tool outside the square. What happens?

Since we have clicked outside the square, the outer area gets painted.

Editing

Once the drawing is made, you might have to make some changes in it such as copying, deleting, moving, pasting, etc. All these are a part of editing.

Delete

How do you delete any picture? Have you got any picture on the screen? If not, draw some pictures using Paintbrush.

Now we have to select a particular portion in the picture. How?

• Select the second tool from the toolbox, called selection tool.

• Move the mouse, position the pointer at one place in the drawing and drag the mouse to another place by holding the left button.

Do you see a box with dotted lines? This is the boundary of the portion you have selected.

You can choose any portion of the picture using the selection tool.

What do you do with this selected portion? It can be deleted, moved or copied.

Note: After selecting the portion in the drawing, do not click anywhere in the drawing area. Otherwise, the selected portion will be deselected.

Cut

Select any portion of the drawing. Click on the Edit menu from the Menu bar. This would have a lot of options. Options available in Windows 3.1 and Windows 95/98 are shown side by side in the picture. Click on the Cut option. What do you see on the screen? The selected portion is being cut from your drawing.

Where ha sit gone? It will be stored in a temporary place called the clipboard.

Undo

If you do not want to delete or cut the portion, click on the Undo option in the Edit menu. You will get back your original picture.

Repeat Command In Windows 95/98

This option from the Edit menu, works along with the Undo command. Clicking on this command will reverse the effect of Undo command. Do the following to understand the working of the REPEAT command.

• Draw a circle.

• Fill the circle with green co lour.

• Select the select tool from the toolbox.

• Select the circle by dragging the mouse.

• Click on the Copy command.

• Click on the Paste command.

• Click on the Undo command.

• Click on the Repeat command.

What happened?

The circle inserted by the PASTE command, was removed by the UNDO command. The same circle is inserted again by the REPEAT command.

That is whatever you did by using the UNDO command was cancelled by REPEAT command.

Paste

The portion that was cut or deleted could be inserted at any place in the drawing.

• First draw a picture. Select any portion of the drawing.

• Click on the Cut option from the Edit menu.

• Click on the Paste Option.

Have you got the deleted picture back? But where is it placed? It is at the top left corner of the drawing area.

Place the mouse pointer on it and drag the picture. Is it moving? Release the mouse button after placing the drawing at the required position.

Click on the Paste option from the Edit menu again. The same portion of the picture will get inserted again.

You can place the portion at some other location and insert it into the drawing any number of times using the Paste command.

Copy

After selecting the portion of the drawing, if you click on the Copy option in the Edit menu, the selected portion will not be removed. But the copy of the portion will be placed in the Clipboard.

Copy To Command

You have already learnt how to save your drawings by using save command from File menu, so that they may be recalled later for modification. The Save command will save the entire picture at the current drawing board.

You can also save parts of a picture, using the Copy To command. This command is available under the Edit menu. To use this command—

• Select the portion of your drawing to be saved by using the Select tool.

• Click on the Copy to command.

Now the paintbrush will prompt for the file name. if you type some name, the selected portion of the drawing will be saved under this name.

This command is used when some potions of one drawing only are to be used in another drawing.

Clear Selection Command In Windows 95/98

This command is used to clear the drawing or object selected by the section tool. To see the effect of this command.

• Draw a rectangle.

• Select it by using Select tool.

• Click on Clear Selection command.

What happened? The rectangle drawn by you is gone. Does it look similar to the Cut command? But there is a difference. Now,

• Click on Paste command.

What happened?

Are you able to get the rectangle back? No! Why? The Clear Selection command will erase the drawing like Cut command, but it will not copy the drawing in the temporary memory. That is why you are not able to get it back by using Paste command.

Hence if you want to remove some portion of any drawing, which is not required by you later, use the Clear Selection command.

Select All Command In Windows 95/98

This command will select all the objects in the drawing board. If you want to copy or cut all the objects in the current drawing file, you can click on Select All command, instead of selecting them by using Select tool.

Paste From

Now you have learnt how to insert pictures from your own drawings. You can also insert pictures from an already existing drawing. This can be done using the Paste From command from the Edit menu.

It will ask you to specify the file name. It should be a picture file.

After choosing the file name, the picture will be inserted into your drawing.

You have place the mouse pointer on the picture to be inserted, drag the picture to any position by pressing the mouse button and fix it by releasing the mouse.

Flip

What do you mean by flipping a picture? It is similar to making a mirror image. You can flip the picture horizontally or vertically.

• Select the object or picture and click on the Flip Horizontal option from the Pick menu.

Your picture will get flipped horizontally. In other words, the mirror image of the object will be obtained.

If you click on the Flip Vertical option, the image will be produced upside down.

Shrink And Grow

• First select the picture by covering its boundary.

• Select the Shrink Grow command from Pick menu.

• Indicate the area by dragging the mouse using the left button.

If the area covered by you is larger than the original picture, the picture will be magnified. If you select a smaller area than the original picture, then the newly inserted picture will be smaller. If you select the Shrink Grow command again, the effect of this command is put off.

The toggle command will switch over between ON and OFF status by pressing it again and again.

Terms To Remember:

Clipboard: A temporary storage location where a section cut or copied from a picture is held until it can be pasted into another location.

Edit: To create, modify or add to a document.

Paste: To insert the contents of the clipboard into a drawing at a desired point.

Flip: To make mirror image of a picture.

Tool Box: A place where different tools are available. These tools are used for drawing different shapes and coloring them.

Shrink + Grow: To reduce or increase the size of a picture.

Points To Remember:

1) Any closed object can be painted with different colures. The colures can be selected from the co lour palette.

2) If you click inside any closed object after selecting the fill tool, the inner portion will be painted with the co lour.

3) If you click outside any closed object, the painting will be done on the area outside the object.

4) Choosing the selection tool and then defining the boundary of the object using the mouse can select an object or portion of an object.

5) The selected portion will be copied into the clipboard.

6) The Cut option will delete the selected portion of the object.

7) The Copy option will copy the selected portion of the object.

8) The Paste option will insert the contents of the clipboard into an object at the desired point.

9) The Undo option will reverse any recently done action.

10) The Flip Horizontal command will produce the mirror image of the selected object in a horizontal line.

11) The Flip Vertical command will produce the mirror image of the selected object in a vertical line.

12) The Shrink + Grow command will convert the selected object to smaller or bigger size, based on the area selected.

13) The Repeat command will reverse the effect of Undo command.

14) Clear Selection command will remove selected portions of a drawing.

15) A drawing erased by using Clear Selection cannot be inserted again like the Cut command.

16) Select all command will select all the objects of the current drawing file.

17) Copy To command will save a portion of a drawing into another file.

CHAPTER - VII

LOGO

An Introduction To LOGO

We speak and hear many languages such as Hindi, English, Marathi, Gujarati, Kannada, and Tamil etc. Similarly, there are different types of computer languages, such as LOGO, BASIC, PASCAL, COBOL, C, etc. Since the computer does not understand our language, hence to work on a computer, we must learn a computer language. A language is a way of talking, writing or reading. Similarly, we will talk to our computer in LOGO language. A computer language is one, which a computer can understand.

LOGO is one of the computer languages. LOGO is the easiest and simplest computer language. You can draw, do sums, write and can do any kind of work with it. When we want to work in LOGO language, we have to provide he LOGO program to the computer.

Just as when you want to hear the songs of a particular movie, you have to put the audiocassette of that movie in the tape-recorder and then switch on the tape. Similarly, LOGO language is available on a CD. We must put the CD in the CD-drive and type LOGO. Let’s see the stepwise procedure to put LOGO on the computer.

Switch on all the connections of the computer.

Start the computer in DOS Form.

After you get C:> _

Type CD Logo and press ENTER key.

Now type Logo again and press ENTER key.

Once LOGO is stored properly in the CPU, it will display the LOGO screen.

TURTLE:

When we work with LOGO on the computer, a triangle is seen in the center of the screen. This triangle is known as TURTLE. Beneath the TURTLE on the left side of the screen a question mark and small, thick bar appears that is known as cursor. Here we type our orders and Turtle who is our friend obeys our orders. The center of the screen is the Turtle’s home. TURTLE moves all over the screen on our order. Whenever TURTLE moves on the screen, it leaves a trail.

Turtle’s body has two parts. The top point, which is facing the upper side of the screen, is called NOSE and the other part i.e., the bottom part is called TAIL or BACK. If TURTLE has moved anywhere on the screen, and you want it to go back to the center of the screen, i.e., it’s home, then type HOME and press ENTER. The TURLTLE follows your order and returns to its home, the center of the screen.

PROGRAMS AND PRIMITIVES

Mary is a girl of your age studying in the third standard. Mary’s mother has prepared a program for her after school. It is as follows:

Mary will go home, remove her shoes and uniform.

Then she will have a wash.

Then she will have some snacks and go to play.

After playing, she will do her homework.

So here are some instructions set by Mary’s mummy for her. A set of instructions to do a work is called program.

The TURTLE is our most obedient friend. The TURTLE will obey all our orders and will do whatever we want. But all this is possible when only if it understands our orders. So we have to communicate with the TURTLE in a language, which it can understand. Our friend TURTLE has a special name for our orders. TURTLE calls our orders by the name PRIMITIVES. Orders given to the TURTLE are called PRIMITIVES.

These primitives or orders given to the TURTLE to do a particular work are called a program. Thus, a set of primitives given to the TURTLE to do a particular work is called a program.

Let’s try this primitive!

Type FD 50 and then press ENTER key.

What happens?

The TURTLE has moved up.

Type HOME (press enter key)

TURTLE has moved back to the center of the screen and it has left a trail behind it.

You brought the TURTLE back with two primitives --- so you call it a program. Hence a program means many orders, many primitives!

LOGO SCREEN AND RULES FOR WRITING PRIMITIVES

When the screen has a question mark and a cursor, it means LOGO is ready to take our instructions, and we can give primitives to the TURTLE to do the work. Turtle is very fussy. It demands proper numbering and correct spelling of the primitives. If you make a mistake and enter your program, TURTLE will not obey your orders, and Turtle’s answer, “This is not a Logo procedure” will appear on the screen.

So remember, we have to follow certain rules when we write primitives. As we have rules for English grammar, we have rules for the grammar of computer languages too. Grammar used for any computer language is called SYNTAX. If we do not follow the syntax rules, then LOGO Turtle points out our mistakes and says, “I do not know”.

RULES FOR WRITING PRIMITIVES:

We must write the correct spelling of the primitive.

We must leave a gap between primitives and numbers.

Once we write the primitive and number then we must press the ENTER key. As soon as we press the ENTER key, TURTLE executes the order which has been given to it.

HOW TO COME OUT OF LOGO?

After you finish working with LOGO, at question mark type .DOS and press Enter key. It will show you the original screen.

RECAP

LOGO is a computer language.

Computer language is a language, which the computer can understand.

In LOGO, there is a moving triangle, which is known as TURTLE.

TURTLE’S body has two parts, Nose and Back.

TURTLE’S home is in the center of the screen.

A set of instructions to do a particular work is known as program.

Order given to the TURTLE is known as primitive.

‘HOME’ primitive brings back the TURTLE to the center of the screen and when the TURTLE returns home, it leaves a TRAIL behind it.

The full form of LOGO is Logic Oriented Graphic Oriented.

CHAPTER – VIII

Logo Primitives And Commands

The instructions or orders which we give the Turtle are known as Primitives in LOGO language. They are also known as Commands. In fact, all preliminary orders or commands of LOGO are known as Primitives. Examples of Primitives are:

FORWARD, BACK, CLEAN, DRAW, CS, REPEAT, RIGHT, LEFT, and HOME etc.

1. DRAW Command

This command is given first at the time of starting the drawing. This command only doesn’t work. Other moving commands like Forward, Backward, Right, Left, etc. are follows in the procedure.

Example: DRAW

FD 40

RT 90

FD 40

2. RIGHT OR RT Command

The RIGHT command will rotate the turtle-head in the clockwise followed by an input.

Example: RIGHT 45 or RT 45

RT 45 will rotate the turtlehead in the clockwise direction by 45 units from the current position.

3. LEFT OR LT Command

The LEFT command will rotate the turtle-head in the anti-clockwise direction for the given number of units. This command is also followed by an input.

Example: LEFT 45 or LT 45

LT 45 will rotate the turtlehead in the anti-clockwise direction by 45 units from the current position.

4. FORWARD OR FD Command

This command is used to draw a line in the forward direction. It is followed by a number. The number indicates the length of the line the turtle has to draw.

This is a primitive used to move the TURTLE in front. Whenever Turtle moves, it leaves a trail (footstep) behind.

Example: FD 50 will move turtle 50 steps forward.

5. BACK OR BK Command

This is used to draw a line in the backward or reverse direction. It is also followed by a number, so that Turtle can understand how many steps it has to move.

Example: BK 50. This will put the Turtle where it was started.

6. SETH Command

The SETH command followed by a number will set the turtle head in a specific direction. The turtle head is not rotated for the given units as in the case of RIGHT or LEFT commands, rather it is fixed in the given direction. The directions are indicated as 00, at the top, 900 towards right, 1800 at the bottom, 2700 towards left and 3600 again towards the top.

Example: SETH 45

7. HOME Command

If the turtle is away in the field from its home, the command will call back to its original position, i.e, the Home command will set the turtle-head to its default position. The home position of the turtle is the center of the screen with its nose pointing upward. But it does not clear the screen of whatever is drawn up by it previously. Instead it draws a straight line between its previous & home positions.

Example: DRAW

FD 40

RT 90

FD 40

HOME

8. CLEAN Command

It rubs all the lines drawn by turtle previously without asking the turtle to go home. The turtle remains at the same position, which it was last occupying.

Example: FD 30

LT 45

FD 50

CLEAN

9. CLEAR SCREEN (CS) And BYE Commands

If you want everything to be erased on screen the CLEARSCREEN (in short CS) command may be used. It rubs all the drawing. It causes turtle to come to HOME position facing upwards.

BYE command takes you of the LOGO Program, and the DOS Prompt returns.

10. HIDE TURTLE And SHOW TURTLE Commands

The HT command will hide the turtle and the ST command will show the turtle.

11. PENUP And PENDOWN Commands

These commands are used to decide whether the turtle has to draw a line or not.

While making figures, sometimes we need turtle to move further, but without drawing any line. This can be done with PENUP command.

Example: FD 40

PENUP

FD 20

The turtle always moves with the pen in down position.when its pen is in down position, it draws the line in which turtle moves.

Example: PENUP

FD 20

PENDOWN

FD 20

In Logo, the turtle’s pen, if it is down, can operate in three modes; PAINT, REVERSE, and ERASE.

11A. PENPAINT OR PPT Command

This command sets the turtle’s pen position to DOWN and the mode to PAINT. PAINT is the normal mode for the turtle to draw. Thus when the turtle’s mode is in the PAINT position it draws along its path.

Example: FD 20

PENERASE

FD 20

RT 45

PENPAINT

FD 20

In the above, PENPAINT is given to restore the turtle to the drawing mode.

11B. PENERASE OR PE Command

This command sets the turtle’s pen position to down and the mode to erase. Any drawing commands followed after the PENERASE command will erase all the lines, on its way.

11C. PENREVERSE OR PX Command

This command sets the turtle’s pen position down and the mode to reverse. The reverse mode on its way will change the status of the point. That is, on the way, if there are lines already, this command will erase it. On the other hand if there is no line, then it will draw the line. This command helps the turtle to cancel the function of the PEN command issued previously.

So the PAINT mode always draws a line, whereas the reverse mode will change the effect, i.e., drawing a line or erasing it depending on the status of the path.

12. TEXT Commands

a) TEXTSCREEN Command helps to print the text information. If any other command related to the text is given after this command, it will switch from the drawing mode to the text mode.

b) PRINT Command is used to print any text or number on the LOGO screen. To print any number, give the PRINT command followed by that number.

For example, PRINT 120

To print any text, give the PRINT command followed by the text, either in quotation marks, or inside square brackets.

For example, PRINT, “I AM WORKING WITH LOGO”

PRINT, [I AM WORKING WITH LOGO]

c) FIRST And BUTFIRST (BF) Commands

FIRST command is used, when we want to pick up the first letter or number in a word.

Example: PRINT FIRST “APPLE”

A

BUTFIRST is used to print or display all the characters except the first one. BF is the short form of BUTFIRST.

Example: PRINT BF “SMILE”

MILE

13. LAST And BUTLAST (BL) Commands

LAST command will display only the last letter of a word.

Example: PRINT LAST “12345”

5

BUTLAST command displays all the characters except the last one. BL is the short form for the BUTLAST.

Example: PRINT BL “CUTE”

CUT

14. COUNT Command

It tells us how many inputs are keyed in, meaning how many groups of letter or number are present.

IN COUNT primitive, numbers are written as they are, but letters are written in square brackets. If we leave space in between characters, they are counted as separate inputs.

Examples: PRINT COUNT 9321

4

PR COUNT [CAT RAT]

2

PR COUNT [b e a u t I f u l]

9

PR COUNT [beautiful]

1

15. PR ITEM Command

ITEM primitive is used to display a particular input. It follows by the number of the item to be displayed.

Example: PR ITEM 4 13569

6

PR ITEM 5 [c h o c o l a t e]

O

PR ITEM 3 [123 456 789 0]

789

PR ITEM 1 [RAM GOPAL]

RAM

16. SHOW Command

This command is available in MSW Logo. SHOW will display the input values on the screen. This command is of the following form:

SHOW value1, value2…

Where, Value1, value2… are the things you wish to display on the screen.

This command is used to print the input. Its action is similar to PRINT, except than if an input is a list, it is printed inside square bracket.

17. REPEAT Command

Sometimes, you may have to repeat a command more than once to draw an object. For example, to draw a square, you have to give the following command four times.

FD 40 RT 90

The same effect can be achieved using the REPEAT command.

REPEAT 4 [FD 40 RT 90]

The number 4 indicates that the command must be repeated four times. The commands are enclosed inside square brackets. The REPEAT command is very useful for drawing different shapes.

Now, let us draw a rectangle.

HOME

CLEARSCREEN

REPEAT 2 [FD 30 RT 90 FD 50 RT 90]

18. REPEAT INSIDE REPEAT Command

If you want to draw two triangles in different positions, say from 00 and 900, what commands will you use?

CLEARSCREEN

REPEAT 3 [FD 50 RT 120]

RT 90

REPEAT 3 [FD 50 RT 120]

Here the REPEAT 3 [FD 50 RT 120] command is given two times. The same effect can be obtained using the commands in a different way.

CLEARSCREEN

REPEAT 2 [REPEAT 3 [FD 50 RT 120] RT 90]

19. SETSCRUNCH command

By this command, you may change the height of a picture to be drawn next by changing the height of the turtle. SETSCRUNCH 1 restores turtle height to normal. SETSCRUNCH 2 doubles the height of a picture while SETSCRUNCH 0.5 will reduce the height of a picture to half. By the commands below, you may draw a flattened Square of half the normal height,

? CS

? SETSCRUNCH .5

? REPEAT 4 [FD 50 RT 90]

? HT

By the SETSCRUNCH .5 command, the height of the turtle is changed to half its normal. Now, whatever way you move the turtle, it will only move half the normal distance vertically. Thus, the resulting drawing will be a half-height picture. Remember, the horizontal width of the picture does not change with SETSCRUNCH command; only its vertical height is changed. If the SETSCRUNCH parameter value is less than 1, the height is reduced, and if it is more than 1, the height is increased.

Even FD and RT can easily draw this short height picture. But, flattened circle or ellipse cannot be drawn easily in any other way. You may draw this picture very easily by using the SETSCRUNCH command as shown in the figure below. Notice the use of the second SETSCRUNCH 1 for making the height of further drawings normal. SETSCRUNCH .2 reduces the height of a picture to one-fifth of the normal height. Remember, till you make the height of the turtle normal by SETSCRUNCH 1, all the pictures drawn will continue to be of changed height only.

? CS ST

? REPEAT 360 [FD 1 RT 1]

? SETSCRUNCH .2

? REPEAT 360 [FD 1 RT 1]

20. SPLITSCREEN, TEXTSCREEN AND FULLSCREEN

The LOGO screen in which you draw pictures by commands has two portions. The picture is drawn in the upper portion and commands are given in the lower. The upper portion has 20 lines and the lower has 5 lines of vertical space. But when LOGO starts running, the full screen of 25 lines of vertical space is reserved for giving commands only. You cannot draw any picture in it. Recall that you had given DRAW command for starting drawing. This divided the screen into two portions and you started to draw pictures in the upper portion by giving commands in the lower one. Instead of DRAW command, you could also have also pressed F2 key or given SPLITSCREEN (SS in short) command for doing the same job. The drawing portion of the screen is 160 turtle steps high and 320 turtle steps wide.

TEXTSCREEN (TS in short) command transforms the full area of the screen for typing commands only. Normally, your screen has only five command lines at the bottom. But, when the screen is transformed into a text screen, all the 25 lines become reserved for typing commands. No space remains for drawing. Though you cannot see pictures in this condition, any picture that you were drawing before giving this command still remains in RAM. You can bring it and also the drawing screen back by the command SPLITSCREEN (SS in short).

Just as you convert the screen to text screen by TS, the complete screen can also be converted; to be used only for drawing. You may do this by the command FULLSCREEN (FS in short) or by pressing the F4 key. There will be no space on the screen for your commands. You may still give commands in this condition, but these won’t be displayed on the screen. This full drawing screen is 200 turtle steps high and 320 turtle steps wide.

21. WINDOW, FENCE AND WRAP

When you draw, you give the commands in the lower portion and the picture is drawn in the upper. The upper part is 160 turtle steps high and 320 steps wide. This is the drawing area of the screen. The turtle starts to draw from its home at the center of the screen. That means, it can move 80 steps upward and 80 steps downward before meeting the boundaries of the drawing area of the screen.

If you give the command FD 120, the turtle would move 80 steps upward reaching the screen boundary. It will not stop there. It will wrap around and start from the bottom of the drawing area of the screen to cover the rest of the journey. That will be 40 steps more. This is shown in the next figure. This is called wrapping. Under normal circumstances, if the drawing gets larger than the screen, it wraps around the opposite sides. If you want to stop this, FENCE command is to be used. After giving this command, if you now give the command FD 120, LOGO would display,

TURTLE OUT OF BOUNDS

WRAP command restores this wrapping property again. To draw outside the screen, WINDOW command is sometimes used. After you give this command, turtle continues drawing even if it goes out of the screen. In this case, you won’t be able to see the drawing.

The area bounded by the dotted line and upper edge of the screen vertically, and left and right edges of the screen horizontally is the drawing area of the turtle. This area is 160 turtle steps high and 320 turtle steps wide. Usually, the turtle can move around and draw pictures only in this area. Similarly, the area below the dotted line is the command area. You can see a maximum of five commands in this area and in the bottom-most of these is your command line.

With FULLSCREEN command, this drawing area covers the full screen and its height increases to 200 turtle steps. The commands given are stored in RAM and are not shown on the screen.

Points to Remember

The RT, LT, SETH and HOME commands are used to rotate the head of the turtle in a given unit direction.

The FD and BACK commands are used to draw lines.

The PENUP command is used to move the turtle without making lines. This action can be reversed by a PENDOWN command. The PENERASE command is used to erase the drawings.

The TEXTSCREEN command will switch between the text screen and the drawing screen. The PRINT command prints any text or number on the screen.

The CLEARSCREEN command will erase all the pictures and command from the screen and place the turtle at its original position.

The REPEAT command is used to repeat any command more than once.

The REPEAT command is followed by a number (indicating the number of times the command is to be repeated) and the set of commands to be repeated (inside square brackets).

The RPEAT inside REPEAT command is used to draw the same picture from different positions any number of times.

In MSW Logo Pen can be to three different modes, PAINT, ERASE or REVERSE.

PENPAINT (PPT) command will enable the turtle to draw lines.

PENERASE (PE) command will enable the turtle to erase the drawings.

PENREVERSE (PX) command will either erase or draw the lines based on whether the drawing exists on the path or not.

SHOW command will print the input values (number, text or list). List items are printed inside a set of square brackets, unlike the PRINT command.

CHAPTER – IX

Drawing Figures In Logo

Do you find working with LOGO interesting? You have now learnt to draw different shapes in LOGO. In this chapter, we shall learn some more commands, which would help you to draw faster.

1. CLEARSCREEN AND CLEAN COMMANDS

You have studied about the CLEARSCREEN command. What is its use? It clears all the information on the screen and brings the turtle to its home position.

What is the function of CLEAN command? Draw some pictures on the screen and give the CLEAN command. Do you see the difference?

The CLEAN command clears the screen, but leaves the turtle in its current position.

2. REPETITION OF PICTURES

You have seen how the REPEAT command is used to draw a square, rectangle, triangle, etc. It is used whenever to achieve the same. How? This can be done using procedures.

PROCEDURE

Procedure is a set of commands or instructions. The set of instructions is given a name. By referring this name in any other command, you can execute the set of commands contained in the procedure.

3. TO AND END COMMAND

A procedure is defined using the TO and END commands.

For example, if you want to give commands to draw a triangle as a procedure, you have to type the following.

TO TRI

REPEAT 3 [FD 40 RT 120]

END

As soon as you type the TO command, LOGO understands that you are giving some procedure commands. Have you got anything on the screen now? No, because the TO-END command does not draw the picture immediately. It stores the set of commands (between the TO and END command) in the name given after the TO command (in this case TRI).

Now, type the name of the procedure, TRI. What happens?

In MSWLogo as soon as you type the TO MODE command, LOGO takes the command in a separate window, which is shown below:

You have to type the command and press the Enter or the OK button. This will prompt you for more commands. Once all the commands in the procedure are over, you will have to type the END command, which will close the input mode. Now that your procedure is defined, you can type the procedure name, which will give the desired result.

The procedures may be entered using the File menu option also, as shown.

* Click on the File menu

You will see a pull down menu with the following options.

Click on Edit option. This will prompt you to type the procedure name.

Type the procedure name, for example, TRI and press the OK button or ENTER key.

This will open the Editor window.

You can notice that the editor automatically contains the TO and END commands. You can type the LOGO commands in between them. After typing the commands, click on the File menu and select the Save and Exit option. This will save the procedure and return the control back to LOGO screen.

To execute the procedure at the Commander Window, type the procedure name (as per this example, TRI) and press the Enter key.

a) EDITING THE EXISTING PROCEDURE

If you wish to make changes in an existing procedure, click on the File Menu and select the Edit option. Now the Edit Procedure Window will be displayed. Now select the required procedure name from the listed names and press the Enter key or the OK button.

The editor will be opened with the selected procedure and you can do the changes. Save the procedure and execute.

In MSWLogo, the Save command will save all the current procedures, fewer than one file name with the extension as .LOG. Once this LOG file is opened by the LOAD command then all the procedures will be available to you so that you may use them in your LOGO.

Let us create a procedure for drawing a square.

TO SQUARE

REPEAT 4 [FD 50 RT 90]

END

Now type SQUARE. Do you see a square on the screen?

b) PROCEDURE WITH PARAMETERS

Now you have learnt to create a procedure for drawing any shape. You will get the picture on the screen only after typing the name of the procedure.

Hoe would you draw shapes of varying sizes?

SQUARE

Consider the procedure called SQUARE. In order to get a square of different size, make the following changes.

TO SQUARE: X

REPEAT 4 [FD: X RT 909]

END

Now type SQUARE. What happens?

Did you get any error message stating, NOT ENOUGH INPUTS TO SQUARE? What does it indicate?

Since you have mentioned the size, it cannot draw the square of the required size. Hence the error message.

In the above procedure, the letter X stands for the size of the square. It is called a parameter. It can be given any input value.

Let us take the value X as 30 and replace it in the procedure. Now type the command as SQUARE 30. This indicates that you want a square of size 30 units. Check what you get on the screen.

Now type the same command three times with 40, 50 and 60 units, respectively. You will get squares of three different sizes.

So, by using the same procedure called SQUARE, you can draw any number of squares of different sizes. This is the advantage of creating procedures with parameters.

RECTANGLE

The procedures can be created with more than one parameter also.

Suppose you want o draw a rectangle. You need two values, one for length and one for breadth.

Let us see hoe to create a procedure for drawing a rectangle with two parameters.

TO RECT: X: Y

REPEAT 2 [FD: Y RT 90 FD: X RT 90]

END

Type the above commands, give different values for X and Y. now type the command RECT X Y (by giving different values for X and Y) and get rectangles of different sizes.

POLYGON

What is a polygon? It is a closed shape with many sides. The minimum number of sides in a polygon is three.

If you develop a procedure to draw a polygon, then it can be used to draw a triangle, square, pentagon, etc.

The sum of the internal angles in a polygon is 360.

To get the angle of each side in any polygon, divide 360 (total angle) by the number of sides in that polygon.

For example, Triangle -- 360/3 = 120 (If all the sides are equal)

Square – 360/4 = 90

Pentagon – 360/5 = 72

Now let us create a procedure for drawing a polygon.

TO POLY: N

REPEAT: N [FD 20 RT 360/: N]

END

The parameter stands for the number of sides. The commands are repeated N times to draw N sides. The angle to be turned each time is 360/N.

Now type POLY 3. Do you get a triangle on the screen?

Type the command POLY 4. You get a square.

You can draw any polygon by just changing the value of N.

THE POTS COMMAND

Sometimes, you tend to forget the names of the procedures created. How can you know the names?

The POTS command (stands for Print Out Titles) will display all the procedure names. The names are listed in their order of creation, i.e., the newest procedure will be listed at the top and the oldest procedure at the bottom.

THE SAVE COMMAND

LOGO can remember the procedures till the software is on. How to make LOGO remember the procedures always?

All the procedures can be saved in the disk using the SAVE command. The SAVE command is given as below.

SAVE “name of the procedure”

For example, to save the Procedure SQUARE, you have to type

SAVE “SQ”

The SAVE command helps to recall the procedures for future use.

THE LOAD COMMAND

How to recall the procedures you have saved in the previous sessions?

This can be achieved by loading them into the computers’ memory.

Type the LOAD command. This is given as

LOAD “name of the procedure”.

For example, LOAD “SQ”

This brings the SQ procedure into the memory and you can use it for drawing squares.

THE ERASE COMMAND

Try this SQ procedure:

TO SQ

REPEAT 3 [FD 50 RT 90]

END

Now type SQ. what do you see on the screen? You can see a square with three sides and having the fourth side open. This is because you have made a mistake in the procedure. You have typed 3 instead of 4 after REPEAT. How can you change it?

Type TO SQ. this will give a message stating that the procedure already exists.

If you want to erase the SQ procedure and retype the same without mistake, you can do it using the ERASE command.

Type ERASE “SQ”

This will undefined the SQ procedure.

How to verify that SQ is deleted? Type the command SQ. LOGO will display the message “I DO NOT KNOW HOW TO SQ”. Thus you are sure that SQ is erased from the memory.

Now, you can define the SQ procedure again:

TO SQ

REPEAT 4 [FD 50 RT 90]

END

Terms to Remember:

Procedure: A set of commands or programs that carries out well-defined operations o data specified by parameters.

Parameter: An alphabet given along with the name of the procedure, which will be substituted by any number during the execution of the procedure.

Polygon: A closed object with three or more sides.

Points to Remember:

The CLEAN and CLEARSCREEN commands are used to clear the contents of the LOGO screen.

The CLEAN command will erase all the information on the screen and retain the turtlehead at the current position.

The CLEARSCREEN command will erase all the information on the screen and set the turtlehead at its home position.

A procedure is a set of LOGO commands defined by TO and END commands.

A procedure can be called or referred by any other procedure, like a LOGO command.

Procedure with parameter is used to draw shapes with varying sizes.

LOGO cannot remember a defined procedure. It remains only till the LOGO software is on.

The POTS command will list all the already defined procedure names in their order of creation.

To recall the procedure for future use, it must be saved using the SAVE command.

The saved procedure can be recalled using the LOAD command.

The procedure can be removed or deleted using the ERASE command.

CHAPTER – X

CURVES, WORDS AND LISTS IN LOGO

PICTURES WITH CURVES

You know how to draw objects with straight lines using LOGO. You can also use LOGO to draw many pictures with curves.

CIRCLES

In the last chapter, you had developed a procedure called POLY to draw a polygon with many sides. Now try this POLY

Procedure with the input value as 10.

TO POLY: X

REPEAT: X [FD 20 RT 360/: X]

END

Type POLY 10.

What do you get on the screen? Does it look a circle? If the circle is not smooth, try the POLY procedure with an input value of 15. Does thus circle look better?

What do you infer from this? As the number of sides of a polygon (the input value) increases, the resulting picture resembles a circle.

ARCS

Do you know what an arc is? It is a part of a circle.

Can you draw an arc? Drawing small curves and then connecting them can make an arc.

Let us try the following:

CLEARSCREEN

REPEAT 9 [FD 10 RT 10]

This command instructs LOGO to draw a line of 10 units, rotate it by an angle of 10 and repeat the same process 9 times. Check the shape you get on the screen.

Now try the following command.

RT 90

REPEAT 9 [FD 10 RT 10]

How does the picture look? Does it look like the petal of a flower? If you change the angle in RT or the unit in FD command, you will get petals of different sizes and shapes.

Try changing the values to get petals of different sizes.

Do you always get a closed petal? Sometimes the two arcs do not meet to form a petal. You will get a closed petal only by covering 90 degrees.

So the general procedure to be adopted is

REPEAT N [FD 10 RT 90/N]

If the number of turns is N, then each turn should be 90/N.

By changing the value of the FD command, you can get figures of different sizes.

The procedure for the above command is defined as PET.

TO PET: N: D

REPEAT: N [FD: D RT 90 /: N]

RT 90

REPEAT: N [FD: D RT 90 /: N]

RT 90

END

Now you can define another procedure to make a complete flower from a petal as FLO.

TO FLO: N: D: C

REPEAT: C [PET: N: D RT 360 /: C]

END

[C = Number of petals]

Type FLO 9 10 10 and see whether you get a flower with 10 petals.

In the above procedure FLO, you have used another procedure PET.

Thus a procedure can be used as a part of another procedure.

WORDS AND LISTS

You have learnt how to draw pictures using various commands. You have also learnt commands to create you own procedures and the methods of using and saving them in LOGO.

Now let us discuss the commands to be used with characters and strings. LOGO handles three types of data: numeric, string and list.

Numeric data

Numeric data are numbers on which you perform arithmetic operations like addition, subtraction, multiplication and division.

String

String, also called word, is a data with alphanumeric characters. The items in this data are given within quotation marks. For example.

“CHENNAI

“1998

“FILE1



The number of characters counts the length of each data. For example, in the first data “CHENNAI, the length is 7; in the second data, the length is 4; the third data is of length 5 and the last data is of 0 length, i.e., it is an empty one.

List

List is a set of words or numbers enclosed inside square brackets. A few examples are given below.

[I AM LEARNING LOGO]

[XAVIER GUPTA]

[A B C D E]

[2 3 5 7 11]

The number of elements in it counts the length of a list. For example, the length of the first list is 4 and the second list is 2.

THE COUNT COMMAND

The COUNT command is used for finding the total number of characters in a word or total number of elements in a list.

Let us take the first example “CHENNAI. To count the total number of characters in this word, type the following command.

PR COUNT “CHENNAI

You will get 7 on the screen. This indicates that the word has 7 characters in it. The PR command is used to print the result. Take another example. Type this command.

PR COUNT [I AM LEARNING LOGO]

You will get 4 on the screen. This indicates that this list has 4 elements in it. The COUNT command can be used with other commands also. For example, if you type

FD COUNT [LOGO IS VERY SIMPLE AND INTERESTING]

The turtle will move 6 units in the forward direction.

THE FIRST COMMAND

This command gives the first character of a word, first digit of a number or first element of a list. Hence a number, word or list should follow the FIRST command.

PR FIRST 1998

This will print the result as 1.

PR FIRST “COMPUTER

This will print result as C.

PR FIRST [MY TEACHER IS VERY NICE]

This will print the result as my.

THE LAST COMMAND

Can you guess what the LAST command does? Yes, you have guessed it right! It gives last element of a list, last character of a word or last digit of a number. This command also takes a number, word or list as input.

PR LAST 1998

This will print the result as 8.

PR LAST “COMPUTER

This will print the result as R.

PR LAST [MY TEACHER IS VERY NICE]

This will print the result as nice.

THE BF COMMAND

BF stands for But First. This command gives all the elements except the first as the result.

PR BF 1998

This will print the result as 998.

PR BF “COMPUTER

This will print result as OMPUTER.

PR BF [MY TEACHER IS VERY NICE]

This will print the result, as teacher is very nice.

THE BL COMMAND

BL stands for But Last. This command gives all the elements except the last.

PR BL 1998

This will print the result as 199.

PR BL “COMPUTER

This will print the result as compute

PR BL [MY TEACHER IS VERY NICE]

This will print the result as my teacher is very

THE WORD COMMAND

If you have two numbers, you can add them using the SUM command. Let us see what is the use of the WORD command.

Type the following commands and note the result from LOGO.

PR SUM 5 6

PR WORD 5 6

Have you got the results? What is the result from the first command? It is 11. LOGO has calculated the sum of 5 and 6 and given the result as 11.

What is the result of the second command? Is it 56? Can you guess what LOGO has done in the WORD command? It has simply joined both the numbers, instead of adding them. Hence the result 56.

Thus, you can join two words as below.

PR WORD “AB “CD

You will get ABCD

The WORD command also join one word and one number.

PR WORD “ 1

You will get A1.

Note: The WORD command can take only a word or number as input. It cannot join two lists.

THE SE COMMAND

This command can join two numbers or words and make a sentence. It will leave a blank space between the numbers or words.

For example, try the following:

PR SE 5 6

This will give the result as 5 6

PR SE “AB “CD

This will give the result as AB CD

PR SE “A 1

This will give the result as A 1

Terms to Remember

String: A data with alphanumeric characters given within quotation marks.

List: A set of words or numbers enclosed inside square brackets.

Points to Remember

LOGO can be used to draw pictures with straight lines and curves.

LOGO handles three kinds of data: Numeric, Word (String) and List.

The COUNT command will take a number, word or list as input. It can count the total number of characters in a word, digits in a number or elements in a list.

The FIRST command will give the first digit of a number, the first character of a word or the first element of a list.

The LAST command will give the last digit of a number, the last character of a word or the last element of a list.

The BF command will return all the input elements (word, number or list) except the first.

The BL command will return all the input elements (word, number or list) except the last.

The WORD command will join two digits or characters to make one word. It cannot join two lists.

The SE command will join two digits or characters to make one sentence by leaving a blank space in between.

CHAPTER – XI

Programming In LOGO

What is a LOGO Program?

Till now, we were drawing pictures by using individual LOGO commands, some pictures needed less number of commands, and some needed more. If you put a few commands in a file for later execution of the commands, the collection is called a Program. Instead of giving the commands one by one, just type the program’s name and press Enter. The program will start running and all the commands in it will be executed one after the other. Let us study the example below,

TP PENTAGON

REPEAT 5 [FD 30 RT 72]

END

The name of the above program is PENTAGON. Following some rules, you may give any name of your choice. The first line of a LOGO program always starts with the word “TO” follow by the program name. The desired commands are written second line onwards. The program ends with the word “END” in the last line. This indicates to LOGO that the program has ended. The usual preparatory commands CS and ST in the beginning and HT at the end need not be included in a program. To draw a pentagon now, you have only to say,

? CS ST

? PENTAGON

? HT

Note that, you have used the name PENTAGON in such a way as if it were a LOGO command; as if one more command has been added to the LGO language. The advantage here is that, you have written the program beforehand. Now, when you are drawing the pentagon, you do not have to think at all how you will draw it using which commands. You have done the thinking earlier at leisure. If you want to draw a smaller or larger pentagon, edit the PENTAGON program suitably giving it a new name and use the new program just like a command.

How to Write a Program

Now, we will learn how to write a program. A program contains commands. These are to be inputted in the program file by using a text editor. Recall the use of DOS Edit command. This command can be used for creating program files. But, still easier is to be use the text editor in LOGO itself. If you press F1 key in LOGO, you wou8ld get the LOGO editor screen.

The lines at the bottom of the screen tell you about the function of some keys. For example, you learn here that F2 key takes you to the split screen, F9 is to be used for loading old programs in the editor screen and F10 saves the program you are writing.

Using this editor, we will now write the program Pentagon,

TO PENTAGON

REPEAT 5 [FD 30 RT 72]

END

Notice that, the program starts with the word “TO” followed by the program name. The commands in the program follow this first line. The program ends with the word “END”. All LOGO programs have to be written this way. If you want to write a program for drawing the picture of a flower, you may write FLOWER after TO in the first line. The second line onwards will contain the commands for drawing the picture. The last line will contain END.

Notice that, the cursor rests at the top corner of the editor screen. Type the first three lines of the PENTAGON program one after the other. The characters are to be typed at the position of the cursor and it will shift to the right with typing of every character. After typing each line Enter key has to be pressed. If you make any mistake, you can correct it by using Arrow, Backspace or Del key. You may move the cursor to different positions in the screen by using the four Arrow keys.

Pressing the Backspace key once will delete the previous character. To delete a line, bring the cursor at the beginning of the line and press the Del key. If the program is large, it may not be accommodated fully on the screen. You will see only a part of it. To see he rest of the program pages, you have to use the PgDn key. To see the previous pages of a program, PgUp key has to be used.

Saving and Loading a Program

After you finish a program, pres F10 key to save it permanently. LOGO will then ask the program file name from you,

Save File Name :

Now type a suitable name for your program file. A good name gives an idea about the content of the file. The file will be saved on pressing Enter after the name. Remember, you have to type the name of the program file and not the name of the program here.

Pressing F2 key now will tale you back to the drawing screen where you will find the display,

PENTAGON DEFINED

This means that the LOGO program now knows about the PENTAGON program. To express this in another way, the PENTAGON program has now been loaded in the RAM for execution. If you type PENTAGON at the LOGO prompt now and press Enter, the program would be executed and a pentagon would be drawn. It is as if you have used the name of the program like a LOGO command. You could have come to the drawing screen by pressing F2 key without saving and then could have run the program. But, in that case, you would have lost the program. If you wanted to draw the same picture again later, you would have to write all the commands again.

Suppose, you have written and saved the PENTAGON program. Later, after starting LOGO, you have typed PENTAGON at the LOGO prompt and pressed Enter. You will expect the picture of the pentagon to be drawn. Instead, you will get the display,

This is not a LOGO procedure: PENTAGON

Top level

?_

You know that you saved the program, but what happened then? The answer is, though the program is in your hard disk, LOGO cannot read the hard disk directly until you load the program. Loading copies the program from the hard disk to the RAM. Only then can LOGO execute it and draw the desired picture. To load a program, you have to press F9 key. LOGO will then ask the name of the program file to be loaded. It will display in the last line,

Load File Name :

Now type PENTAGON and press Enter. LOGO will display,

? : Loading file PENTAGON.LGO

PENTAGON Defined

? _

The PENTAGON.LGO in the first line is the name of the program file. When you save, LOGO by itself adds the extension .LGO to the file name. the PENTAGON in the second line is the name of the program. There is no relation between these two names. A program may have the name FLOWERPOT, but its program file name may be FLRPOT (.LGO extension will be added by LOGO). At the time of saving and loading, you have to use the program file name. You may also load a program by pressing F9 at the edit screen.

While working in LOGO, if you want to see the list of programs in your directory, you have to give the command (DOS [Dir]) at the LOGO prompt. By the command – (DOS [Dir A:]), you can see the directory of your floppy disk in the same way. You may also give other DOS commands inside the brackets.

Program Name

The program name has to be written after “TO”. This name is different from the program file name. The name of a program for drawing the picture of a flowerpot may be FLOWERPOT. But, when you save it in the disk, you cannot use such a long file name. This is because the file names in DOS cannot exceed eight characters. Suppose, at the time of saving, you have named the file as FLRPOT. So, the program name in this case is FLOWERPOT, but the program file name is FLRPOT. When you run this program from the drawing screen, you have to use the name, FLOWERPOT, but, at the time of editing, saving or loading you have to use the name FLRPOT.

Remember, the name of a program file is formed just like other DOS files. Let us now learn the rules of forming the program names.

Rules of forming Program Names

Using letters and numbers only forms program names. Special characters such as, #, +, \+etc. cannot be used. A program name cannot have a space in it. The following are all valid LOGO program names,

SQUARE, FLOWERPOT2, P, 3FLOWERS

In a program name, only characters can be used, but a name containing only numbers is not a valid name. At least one character must be there in a program name.

A program name has to be unique in the directory. You cannot use a command name as a program name. For example, the name FD is an invalid program name.

Changing or Editing Programs

You may want to change the PENTAGON program any time while you are working on the drawing screen. First you have to press F1 key to bring the edit screen and then F9 key to load the program. The last line of the screen will say,

Load File Name :

Type PENTAGON and press Enter. The program lines will be displayed on the edit screen. If you want to reduce the size of the pentagon, change the program accordingly and save it. If you do not save, LOGO would not remember the changes in the program. Notice that, while loading and saving, you have to use the program file name.

Another easy method for editing the program PENTAGON is to give the following command at the LOGO prompt,

? EDIT PENTAGON

You will then get the PENTAGON program in the screen for editing.

CHAPTER – XII

More Programming in LOGO

Programs within a Program

You have written all the programs till now by using only LOGO commands such as FD, BK, and REPEAT etc. but in your program, you could also have used the names of other LOGO programs just like any LOGO command. This is what we call “using programs within a program”. We will learn how to do this. We will also learn the use of variables and the technique of recursion in writing a LOGO program.

A LOGO program for drawing a flower is,

TO FLOWER

REPEAT 10 [FD 4 LT 6]

LT 75

REPEAT 5 [FD 3 LT 9]

RT 180

REPEAT 8 [REPEAT 10 [FD 3 RT 9] RT 135]

END

The name of the program is FLOWER. You know that the first line of a LOGO program starts with the word “TO” and then the program name follows. The subsequent lines contain the commands that do the main job and the last line always has the word “END”. This indicates to LOGO that the running program has finished its job. Also, CS and ST in the beginning and HT at the end are not normally included in a program. These three commands are gives when the program is used as a command at the LOGO prompt.

The program to draw a pot for keeping flowers is,

TO POT

RT 70

REPEAT 20 [FD 3 RT 2]

RT 140

REPEAT 20 [FD 3 RT 2]

LT 120

FD 45

LT 80

FD 43

LT 80

FD 45

END

By the following commands, you may now draw the flowerpot adorned with a flower,

? CS ST

? FLOWER

? PU

? HOME

? LT 90

? FD 27

? RT 90

? PD

? POT

? HT

See how easily you have drawn the picture by only a few commands. This has become possible because you have already written the programs POT and FLOWER. While drawing the flowerpot, you have used these two program names just like any other LOGO commands. You have not thought about the details of drawing the flower or the pot at all. You have completed these jobs beforehand. If you want to make flower bigger or smaller, you just have to change the program called FLOWER. No change is needed in the commands in which you have used this program FLOWER.

You have given the commands for drawing the flowerpot directly at the LOGO prompt. Instead, you could have put these commands in a program file FLRPOT and used this new program later on. Give a name FLOWERPOT to this program. We have already the name of he program file as FLRPOT.

So, the program file FLRPOT contains “TO FLOWERPOT” in the first line instead of “CS ST”, hen the commands as above (left of Fig. 9.1) and finally “END” instead of “HT” in the last line.

Suppose, you want to draw the picture of your room by a program. In this program, just use the name FLOWERPOT to insert the picture of the flowerpot suitably in the overall picture. Of course, you have also to write the programs for drawing pictures of the other objects I your room.

The above figure shows that, within the program for ROOM, the program FLPOWERPOT has been used. Within program again, the programs POT and FLOWER have been used like LOGO commands. These two programs POT and FLOWER are called the subprograms of the program FLOWERPOT.

Remember, unless you load all of these three programs, you will not be able to run the FLOWRPOT program.

Advantages of using LOGO Programs

Let us now try to understand the advantages of using LOGO programs,

Drawing a picture by using subprograms need fewer commands.

A program used for drawing a picture may also be used for drawing another picture. This is called Program Reuse. For example, you could have put your FLOWER in a POT or in a VASE. You have only to write one program for VASE and another for FLOWERVASE. You do not have to write FLOWER program again. Just use it again in the program FLOWERVASE.

A correctly written program may be used in future for any length of time.

4. A program name may be used as a LOGO command for drawing pictures. You may go on increasing the number of LOGO commands this way by writing more and more programs. This takes the LOGO languag3 more powerful. After some time of working in this manner, you may build a Program Library for drawing standard pictures. Using these programs, you may be able to draw larger and more complicated pictures easily.

It is difficult to change an already drawn picture without redrawing. But, if a picture us drawn by using a program, you may change the program just a little bit and have the changed picture. As the previous commands are available in the program, you do not have to retype the commands. Thus, pictures drawn by using programs are very easy to change.

To draw a large picture, you have to first identify the different types of objects in it. Then, you have to write a program for drawing each of these types of objects and use these appropriately in the larger picture. For example, for drawing a picture of the flowerpot adorned with flower, we have written the programs for the pot and the flower first. Then, we needed only to use these two programs as commands and get the final program FLOWERPOT for the larger picture.

It is not easy to draw a large picture at one go. It is much easier to draw the parts and then combine to get the whole. It is easy to draw the flower and the pot separately and then combine these two to get the flowerpot. When you draw the flower, you do not have to think at all about how to draw the pot, or for that matter, the complete flowerpot. This is liker splitting a complex puzzle into small parts and gets the solution of the original puzzle by solving the smaller parts and combining the results.

This technique of splitting a large job into smaller tasks in steps and combining the results of these smaller tasks to get the end result is called Structured Programming. This method of working has an added advantage. Even your friend can do a few smaller subprograms and thereby share you’re your workload. It is always easier to do a job in a team rather than doing it alone.

Not only LOGO, but any good programming language also has these advantages.

Use of Variables in a LOGO Program

A program to draw a square is,

TO SQUARE

REPEAT 4 [FD 20RT 90]

END

Each side of this square is 20 turtle steps long. If you want to draw another square with sides 30 steps long, you have t write another program. If you had used Variables in writing the original program, the same could have been used for drawing smaller or bigger squares also. No new programs would have been required.

Any variable has a Name and a Value. The computer reserves a space in the primary memory for this variable. The name of this space is in the name of the variable. The value of the variable is stored in this space. As this value changes from time to time, it is called a variable. By the following program, you will be able to draw squares of various sizes. The size of the square will depend on the value of the variable SIDE.

TO SQUARE: SID

REPEAT 4 [FD: SIDE RT 90]

END

Let us see how you can actually draw squares by this program,

? SQUARE 20

? SQUARE30

? SQUARE 40

? _

You have given the value of the variable SIDE as 20 in the first command, 30 in the second and 40 in the third. The picture drawn is as shown above. The first square drawn was of side length 20 turtle came back to its Home. Similarly, the second and the third squares were come to rest as its Home.

The writer of the program has given the name SIDE to the variable and while running the program; you have communicated the length of the side to the program through this variable. The same job would have been done even if the name of the variable were LENGTH instead of SIDE.

Only one variable has been used in the above program. You may also use more than one variable in a program. In the program below we have use two variables, LENGTH and BREADTH,

TO RECTANGLE: LENGTH: BREADTH

REPEAT 2 [FD: LENGTH RT 90 FD: BREADTH RT 90]

END

To run this program, we have to give the values of the variables as below,

? RECTANGLE 20,10

? RECTANGLE 30,20

? RECTANGLE 40,30

? _

The variable values, while using the program, have to be given in the same sequence of variable names written in the first line of the program. The variable LENGTH appears first in the RECTANGLE program, and so, the first value in the RECTANGLE commands (Program Calls) above, will be assigned to the variable LENGTH. By the same logic, the second value I the RECTANGLE commands will be assigned to the variable BREADTH, which is the second variable in the RECTANGLE program.

In the last RCTANGLE command, LENGTH will have vakue 40 and BREADTH 30.

You may also create a new variable by the command MAKE. This command has an additional advantage. With this command, yo may assign a starting value to a variable and may also change its value within the program. Let us make this point clear through an example,

TO SPIRAL

MAKE “STEP 10

REPEAT 12 [FD: STEP RT 90 FD: STEP RT 90 MAKE “STEP (: STEP + 10)]

END

The variable STEP stared with the value 10 in the MAKE command at the second line. Inside the REPEAT command, twice the turtle went straight and hen turned. After that, the value of STEP increased by another 10. These steps were repeated 12 times in total to form the rectangular spiral.

Recursion

Recursion means using a program within itself. We will learn the command IF along with recursion in this section. Let us try to understand this by drawing the picture of our Spiral using recursion.

TO SPIRALNEW: STEP

REPEAT 2 [FD: STEP RT 90]

IF: STEP > 110 THEN STOP

SPIRALNEW: STEP + 10

END

In the first line of the above program, there is no starting value of the variable STEP. Can you say wherefrom the program will get this value?

When running the program, suppose you have given the starting variable value 10 with the program name. In the second command, the turtle moves straight twice and then take a right-angled turn as before. The IF command at the third line means, if the value of STEP becomes more than 110, then the program will stop. Otherwise, the command at the fourth line will be executed. In this case, any other command before the End and after the IF command will also be executed.

Let us now take a close look at the command in the fourth line. Notice that, this line contains the same program name. This is recursion. It means, the program will start executing from the first line again. The only difference this time will be in the value of the variable STEP. This will have a value increased by 10 when the program runs a second time. This value will further be increased by 10 during the third execution.

The SPIRALNEW program will run again and again in this way. With every execution, the value of STEP will be increased by 10 from its previous value. In the twelfth such execution, the value of STEP will be 120. Then only the IF command at the third line will find this value more than 110 and will immediately stop the program. The REPEAT command will be executed 12 times in total. The condition: STEP > 110 in the third line is called the Terminating Condition and is used for stopping the program when its work is properly finished. If you make any error in setting this condition, the program execution would be seriously erroneous.

In the IF command, you could have used: STEP = 120 instead of: STEP > 110. This changed program could have drawn the same picture also. But, this changed program would have had a serious flaw hidden in it. If, by mistake, you had given the command SPIRALNEW 5 while using this changed program, the variable STEP would never have been equal to 120. The program would have continued to run for infinite time. This is called an infinite loop condition and is the worst mistake a programmer can commit.

Examples:

1. We will draw a picture of three balloons first,

TO 3BALLOONS

LT 30 FD 50 LT 60

BALLOON

FD 45 LT 90

BALLOON

RT 30 FD 50 LT 120

BALLOON END

TO BALLOON

SETSCRUNCH 3

REPEAT 60 [FD .4 RT 6]

PU HOME PD

SETSCRUNCH 1

END

2. Now, we will draw circles within other circles,

TO CIRCLES: STEP

REPEAT 3 [CIRCLE: STEP MOVE1 MAKE “STEP (: STEP - .3)]

END

TO CIRCLE: DIST

REPEAT 360 [FD: DIST RT 1]

END

TO MOVE1

PU RT 90 FD 17 LT 90 PD

END

If you give the command CIRCLE 1 at the LOGO prompt, the picture drawn will be as shown above. First time, STEP or DIST will have value 1. Second time, the value will be reduced to 0.7 and third time to 0.4. The more this value will reduce, the smaller will be the circle. Every time, the CIRCLES program will pass on the value of the variable STEP to the value of DIST in the CIRCLE program. These two variables will always have some values.

CHAPTER – XIII

LOGO Arithmetic

LOGO Arithmetic

You may do many more things in LOGO than drawing pictures. We will learn now how to do LOGO arithmetic. You may do addition, subtraction, multiplication, division and a few other arithmetic operations in LOGO. Before you learn how to do thee, let us see how you can display words on the screen. He command to display on the screen is PRINT or PR in short. If you give the command, Pr “Welcome, the computer will display the word “Welcome” on the screen. To see the result of the sum of two numbers 4 and 3, you have to give the command,

? PR SUM 4 3

7

? _

LOGO will show the result just below the command. You may do the same job by the command PR 4+3. To add more than two numbers and see the result, you may use the following command,

?PR (SUM 45 56 9)

110

?PR 45+56+9

110

?_

A first bracket is to be used for adding more than two numbers by the command SUM. Within the first brackets, any number of numbers may be added by the command SUM. Whatever numbers follow SUM will be added by LOGO and the result will be given to the command that called SUM. In the case of our example, PR is the calling command and the command SUM is the called command. Instead of PR, the calling command could very well have been FD, BK etc.

The same result may be obtained without the help of the SUM command by directly summing up the numbers. In this case, remember, writing 45 +5 will be wrong but 45+5 or 45 + 5 will not be.

It is easier to use no space between the two characters. This eliminates chances of error.

You may further use – for subtraction, * for multiplication and / for division. These are shown in the example below left. Note that, we have not used any space between the numbers and -, * or / symbols.

? PR 69-5-4 ? PR PRODUCT 5 7

60 35

? PR 4*5*8 ? PR (PRODUCT 6 7 3)

160 126

? P-R 45/6 ? _

7.50

? _

Remember, you should never divide a number by zero. This will make the result of division infinite that no computer can handle. This is another of the most serious errors a programmer can commit. You may also do multiplication by the command PRODUCT in the same way as SUM, as shown above right. To multiply three numbers by PRODUCT, you have to enclose the expression within first brackets. Lie the SUM or + command, you may multiply many numbers by using the PRODUCT or the * command.

Till now, we have used only one type of arithmetic command at one time. It is also possible to combine the arithmetic command as per your requirement. For example, you may add two numbers, multiply the result by a third number and display the result. This is shown in the next example.

? PR (69-5-4)*5

300

? PR 69-5-4*5

44

? PR 10+(4*5*8)

170

? PR 10+45/6

17.50

? _

In the first line above, the first expression of (69-5-4) produces the result 60. 5 to produce the final result of 300 further multiply this. Notice that, in the third line, the bracket is not used and the final result is different, though the expressions are similar. In this case, LOGO evaluates first 4*5 separately and uses the result 20 for subtraction. The resultant expression becomes 69-5-20 in this case. This phenomenon is called operator precedence. Let us elaborate it a bit further.

In an arithmetic expressing, the *, -, + or/ symbols are called operators and these indicates to LOGO the operations of addition, subtraction, multiplication and division, respectively. In an expression where different types of operators are used, LOGO first evaluates the * and / operations. It means, wherever it finds multiplication or division, LOGO performs those calculations first. At the next stage then, LOGO performs the additions and subtractions.

So, we say, * and / have equal precedence relative to each other. The operations + and – also have equal precedence relative to each other. But, the operations * and / both have higher precedence compared to the operations + and -.

Notice that, the operator first bracket has overridden this normal precedence relation in the first of the above examples. This is the specialty of the bracket operator. Whatever expressions are enclosed within the first bracket will be evaluated first and only then the rest of the expressions will be evaluated. So we say that, in an arithmetic expression, the first bracket operator has the highest precedence, followed by the * and /, and finally, by + and -. To understand the mechanism of precedence, you should experiment yourself.

If we change the expression 10+(4*5*8) by adding 10 later, we get the expression, (4*5*8)+10. this does not work properly. When he first brackets are removed, you get the desired result of 170 again. In LOGO, you should not use the bracket operator where it is not necessary.

Finally, a special result is, with an arithmetic command, if you do not give the PR, you would still be able to see the result. But, an extra word RESULT: would be displayed before the actual result,

? 5+5

RESULT: 10

? _

Let us try to understand this. If you do not give PR, even then LOGO will calculate the actual result. The job of PR is to display, but not to calculate. It displays numbers, words, calculation results or anything given to it. Instead of PR 20+30, you may very well use the command FD 20+30. This will move the turtle forward by 50 steps. Similarly, you may use FD 30-20 or FD 30*5 or FD 120/4 also. LOGO first evaluates the expression and then only passes the result of evaluation to the command preceding the expression.

LOGO has also got facilities for calculating the quotient and the remainder of a division. As you know, quotient is the result of a division. The commands for doing these are QOUTIENT and REMAINDER. The first three commands below are examples of these two. In the third and fourth command, a new command INT is used for showing the integer part only.

? PR REMAINDER 45 6

3

? PR QOUTIENT 45 6

7.50

? PR INT QOUTIENT 45 6

7

? PR INT 40.96

40

? _

In the second result, the quotient is a fraction. To show integer part only, INT command is o be used. He two commands for showing numbers in integer form are, INT and ROUND. These two commands are used below,

? PR INT 40.96

40

? PR ROUND 40.96

41

? PR ROUND 40.49

40

? _

A number may have two parts, integer and fraction. ROUND truncates the fraction part if it is less than 0.50. If the fraction part is equal to or more than 0.50, the integer part is increased by 1 and fraction is eliminated. Rounding is an approximation to reduce the number of decimal digits.

On the other hand, INT always truncates the fraction part and keeps the integer part only.

RANDOM is an interesting command that operates on numbers,

? PR RANDOM 12

3

? PR RANDOM 12

10

? PR RANDOM 12

1

? _

The function of the above RANDOM command is to output a number between 1 and 12 randomly without following any rules. Randomly means, next number that will be displayed is unpredictable. The umber to be displayed follows no pattern. Using this command, you may write a program for playing a number guessing game with your friend. This command may be used with other command also as shown in he next example.

? REPEAT 4 [PR RANDOM 12]

1

7

6

11

? _

This time, you will get four random numbers instead of one.

There is another command IF, by which you can compare two numbers to see which one is the larger.

? IF 10>15 THEN PR “GREATER ELSE PR “LESSER

LESSER

? _

10 is not larger than 15 and so the word “LESSER” is displayed. LOGO evaluates the condition is true under IF and executes the expression under THEN if the condition is true. If it is false, the expression under ELSE is executed.

Examples

1. The program below will add any two numbers,

TO ADD: NUM1: NUM2

PR: NUM1 +: NUM2

END

To add the two numbers 145 and 67, you have to give the command,

? ADD 145 67

212

? _

2. The ADD program above adds two numbers and displays the result on the screen. Instead of displaying by PR, if we had used OP command, the result would not have been displayed, but it would have been available to any other command for its use. It would have been available in RAM. Let us see how this happens,

TO ADD2: NUM1: NUM2

OP: NUM1 +: NUM2

END

This ADD2 program transfers the result of the addition to the RT command,

? RT ADD2 20 30

The OP command in ADD2 program does he addition and outputs the result to the RT command. RT takes the value of the addition and executes accordingly. The result of addition is not displayed; it merely turns the turtle right.

If we used PR instead of RT in the command above, then the result would have been displayed. You would get the same result by using PR instead of OP in ADD2 program and running ADD2 from LOGO prompt. But, in this case, you would have lost the flexibility of passing the result of addition to any command like LT, BK or FD.

3. The PR command first displays on the screen and then moves the cursor to the prompt in the next line. Another display command TYPE also displays on the screen, but does not shift the cursor at all. It waits in the same line and same position for the next print command. We will write a small program for calculating the cost of materials by using this command.

The COST program COST program run

TO COST: RATE: QUANTITY ? COST 5 30

TYPE [COST =] COST = 150

PR: COSAT *: QUANTITY ? _

END

CHAPTER – XIV

Playing with Words in LOGO

So, we now know how to draw pictures and how to do arithmetic sums in LOGO. But, LOGO can do even more for you. We will learn here how to play with words in LOGO.

Like sums, LOGO has various textual commands. With these you may transform words. After transforming, as before, you will display the results by using the PR command.

If no textual commands are used in a command, LOGO will directly display the text given with PR. When textual commands like BF, BL are used, LOGO first executes those commands and then passes the result on to the Pr for display.

We will learn here the commands for inputting, dissecting and concatenating words. In the process, we will build word puzzles also.

Working with Words

Instead of a number, a word may be given with PR. When you give the command, PR “Welcome, LOGO will find that no calculation is to be done. It will hand over the word straightway to the command PR that will display it on the screen. A single word can be displayed by the command from PR “,

? PR “Welcome

Welcome

? _

any such word may be displayed through PR,

? PR “3FLOWERS

3FLOWERS

? PR “22NOV1986

22NOV1986

? PR “TODAY

TODAY

? _

All these are single words. You cannot use the special characters -, +, *, / within any of these words. More than one word may also be displayed by using PR. A few words together form a sentence. “WHST IS YOUR NAME?”,“THIS IS YOUR BIRTHDAY”, “ROSE ISRED” are such sentences. We will display these on the screen by the commands below. The sentences are to be enclosed between third brackets or parenthesis,

? PR [WHAT IS YOUR NAME?]

WHAT IS YOUR NAME?

? PR [THIS IS YOUR BIRTHDAY]

THIS IS YOUR BIRTHDAY

? PR [ROSE IS RED]

ROSE IS RED

? _

The content within the parenthesis is called a List in LOGO terminology. The objects in the list are called Elements. The elements may be words or may be other lists or may even be other types of objects. Recall our REPEAT command, REPEAT 360 [FD 1 RT 1]. Here, the contents within the brackets formed a list. In this chapter, we will work only with words.

The list concept of LOGO is a powerful one. You have the flexibility of putting anything you like within parenthesis to make it a list. You may even put other lists within a list. With a list you have the capability to process the elements individually or all together like you have done in PR [ROSE IS RED].

Dissecting Words

To get the first or the last character of a word, FIRST or LAST command is to be used,

? PR FIRST “LOGO

L

? PR LAST “LOGO

O

? _

The first letter L and last letter O will be output by the above commands. Note that, in the first line, FIRST command is executed first. The result produced is the letter L. this result is given to PR for display.

Similarly, you may get the letters excluding the first or the last letter by the commands BUTFIRST and BUTLAST, the former meaning “all the rest excluding the first” and the latter “all the rest excluding the last”. Examples of these two commands are given below,

? PR BUTFIRST “LOGO

OGO

? PR BUTLAST “LOGO

LOG

? _

The above two commands may be used in shorter form as BF or BL. In all these word-dissecting examples, only single words are used. This is because we have used “along with the words. For multiple words or sentences, we may use the same commands if we enclose the words within parenthesis.

If we enclose a few words within parenthesis, the result becomes a list. The words within the parenthesis are the elements of the list. In this case, the BF and BL commands operate on the elements of the list and not on the characters of the words. Note that, for BF “LOGO command, BF operates on the characters of the word, which are the elements in this case. The action of BF and BL on a list of words is shown in the next example.

? PR FIRST [HAPPY BIRTHDAY TO YOU]

HAPPY

? PR LAST [HAPPY BIRTHDAY TO YOU]

YOU

? PR BF [HAPPY BIRTHDAY TO YOU]

BIRTHDAY TO YOU

? PR BL [HAPPY BIRTHDAY TO YOU]

HAPPY BIRTHDAY TO

? _

These commands FIRST, LAST; BF and BL may even be used one after the other.

? PR FIRST BF [ROSE IS RED]

IS

? PR LAST BL [FOX IS A CLEVER ANIMAL]

CLEVER

In the first example, the BF command and not the FIRST command works first. BF returns the result, {IS RED]. When the action of BF ends, the resultant command looks like,

PR FIRST [IS RED]

When the action of FIRST finishes, we get the answer “IS”. In the second example, BL works first and returns the result [FOX IS A CLEVER] to LAST.

The COUNT command gives you the number of characters in a word or the number of words in a list,

? PR COUNT “SUNDAY

6

? PR COUNT [THIS IS SUNDAY]

3

? PR COUNT [APPLE GUAVA MANGO CHERRY]

4

Similarly, by the ITEM command you get a specific letter of a word or a specific word of a sentence. To get the second word of the sentence THIS IS SUNDAY, you have to use the ITEM command,

? PR ITEM 2 [THIS IS SUNDAY]

IS

? PR ITEM 3 [MANGO ORANGE BANANA GUAVA]

BANANA

? _

Concatenating Words

By the WORD command, you may add or concatenate one word to another and form a new word. The next command will add the word “DAY” to the word “SUN” and form the new word “SUNDAY”. Remember, you cannot concatenate more than two words. Also, none of the strings to be concatenated may be a sentence or a collection of words. Only two words may be concatenated by this command. Note that, an individual word such as SUN is preceded by the symbol “, while a sentence such as TODAY IS SUNDAY is to be enclosed within parenthesis.

? PR WORD “SUN “DAY

SUNDAY

? PR WORD “FOOT “BALL

FOOTBALL

? _

Words may also be concatenated by the commands FPUT and LPUT. Each of these commands will have two strings that are to be concatenated.

The first string has to be a single word. The second string may be another word or may even be a sentence or list. FPUT puts the first word at the beginning of the second string and LPUT puts it at the last. But while concatenating, a space is introduced in this case. You will understand this from the next example.

? PR FPUT “MY [NAME IS RUBAI]

MY NAME IS RUBAI

? PR LPUT “ANINDYA [MY NAME IS]

MY NAME IS ANINDYA

? PR LPUT “APARNA [MY FRIENDS ARE SMITA BONNY]

MY FRIENDS ARE SMITA BONNY APARNA

? _

The shortcomings of these two commands are the same. These cannot concatenate two sentences or lists. The command for doing this is SENTENCE or SE in short.

? PR SE [FOOTBALL IS A] [GREAT GAME]

FOOTBALL IS A GREAT GAME

? PR SE [WOULD YOU] “COME?

WOULD YOU COME?

? PR SE “I [PLAY CRICKET]

I PLAY CRICKET

? _

Conversing With the Computer

Like every other job, you will need a program to converse with the computer. Conversing with the computer means, the conversing program will run in the computer and will display questions on the screen. You will answer the questions by inputting the answer through the keyboard. The computer will read this answer and again give a response. You must have been put in the program beforehand. The rest will be formed by the computer, from your inputs.

The commands READCHAR (RC in short) and READLIST (RL in short) allows you to give these inputs and also transfers the input information to the program. Only one character may be inputted through RC. So, we have RL command for inputting a list or a sentence. Let us try to understand this.

We will write a program that will first ask you the question, WHAT IS YOUR NAME? Suppose, you are TINKU and so you will input TINKU in response to the question. On reading this input from you, the program will then say, GOOD MORNING TINKU. This is what we call conversing with computer. It is as if the computer is talking to you. The program below will do this job.

TO GREET

PR [WHAT IS YOUR NAME?]

MAKE “REPLY RL

PR SE [GOOD MORNING] :REPLY

END

The first PR command displays the question. A variable REPLY is created by the MAKE command. Because of the RL command, the program will wait for your reply. Your input will be the value of the variable REPLY.

The SE command will form the computer reply by using the value of the variable REPLY. Finally, the second PR command will get this sentence from SE command and will display it on the screen.

You may create many interesting conversations with the computer in this way.

CHAPTER – XV

Computer Virus

What is a Computer Virus?

We know that virus causes diseases such as common cold and chicken pox. Frequently we find people down with rival fever. There is no connection between the computer virus and these human viruses. The computer virus is a computer program. If such a program enters your computer, it may prevent you from properly using the computer. Some virus programs may even destroy the programs and data in your disk. In such a case, you will not be able to use the computer at all unless you remove the harmful program completely.

The computer virus affects only the program and data. It cannot harm the hardware components. At times, in a virus infected computer, the monitor, the printer and the hard disk might seem to have become totally defective. After removing the virus program, if you restore all the programs and data, the apparently defective hardware components would start working normally again.

A special property of a virus program is its ability to spread very easily from one computer to another or to all-important files within your computer itself. Normally, a virus program attaches itself to your files. You may say, it hides itself in your files. You will be surprised to know that a virus program can create its own copies. A file infecting virus program might have entered your hard disk sometime back. Unknowingly you went on working. Within days, it would spread to all the important files of your hard disk. In addition, it would lodge itself into all the floppies that you had used in your computer after the virus attack. So, when a virus affects your computer, it is not enough to remove the virus from the computer. You have to clean all your floppies also. If a virus remains in any of your floppies, it will spread again when you use the infected floppy unknowingly in your computer.

How Virus Spreads

Virus enters the computer in three ways. Let us see what these are,

1. Computer viruses enter the computer mostly through floppies. This is the first source of virus. You might have copied a file from your friend’s floppy not knowing that it was virus infected. The virus will enter your computer. Where it will enter? It will lodge itself into your hard disk.

How will it enter your hard disk? When a virus-infected file is processed for any job, the virus first goes into the RAM. You already know that for any processing, the concerned program and data files must be loaded in the RAM. When you do any operation like copy, the corresponding program of DOS is also executed in the RAM and gets infected immediately. All the programs of the DOS operating system are normally available in the hard disk only. The computer does its work by copying these DOS program files from the hard disk to the RAM. Through the RAM, the virus spreads to the disk.

The virus will enter your hard disk even if you see the directory of a virus-infected floppy or execute a virus-infected file. But, if you only insert the floppy into the floppy drive without accessing the drive at all, virus would not infect your computer.

2. The second mechanism of virus attack is booting your computer through a virus infected boot floppy. When you switch on your computer, after going through a series of steps, the computer displays the C: prompt. This is called booting. For booting, a few special DOS programs are to be executed. These programs are normally available in the hard disk. So, the computer boots from the C: disk as a routine. But, it is possible to store the boot programs in a floppy and boot from this floppy disk instead of the C: disk. This is what we call booting from floppy. If, by chance, this boot floppy contains virus, the computer gets immediately infected on booting.

3. The third source of virus is the computer network. You know that a computer network is a number of computers connected with each other through cables. In a computer network you may transfer files from any other computer in the network. If a virus-infected file is transferred from another computer in the network to your computer, it gets infected.

Types of Viruses

The number of known virus programs is very large. Their names are different and their capabilities of doing damage also vary. Some people are busy throughout the world in creating and spreading these harmful programs to the computers of unsuspecting users. This has been going on for many years. Below are the names and brief details of a few common computer virus programs,

1. Alabama: This virus changes the names of the files you copy in your virus-infected system. If this goes on for some time, you would not be able to find your desired files at all.

2. Brain: This boot sector virus was created in Pakistan. Boot sector is a special area in the disk that is used by the operating systems for keeping very important disk information. This virus spreads very fast. It is difficult to detect and remove it from the system. It damages the disk files.

3. Cascade: This virus attacks other program files. If you suddenly see the characters displayed on your monitor screen falling down in showers, you may be sure that you have got this virus. This virus does serious damage to the files.

4. Dark Avenger: This virus attacks only program files but not the data files. It spreads very fast by finding uninfected programs and attaching a copy of itself to it.

5. Dir_ll: This virus attacks all your disk files. This sometimes damages the File Allocation Table (FAT) of your disk also. The details about the file locations in your disk are written in the FAT. Without it, you will effectively lose your files. This virus is also known by the name Creeping Death. Sometime back, this virus was infecting PCs all around. It is not only troublesome; it was also difficult to eradicate.

6. Disk Killer: This is an old boot sector virus. When this virus program becomes active, you will see the following display, Disk Killer Version 1.0 from Ogre Computers now killing disk. Please do not power down your system. The virus will start erasing your files ten seconds before this display. Even if you switch off the computer immediately after getting the display, you won’t be able to prevent the file loss.

7. Friday the 13th: This virus starts its activity on 13th day of s month if it is also a Friday. From the computer clock, it keeps track of the calendar. This virus program damages other programs. Sometimes, after a lot of damages have been done, the following is displayed; We hope we haven’t inconvenienced you.

8. Ghost: When this virus becomes active, you will see a ball of light jumping all over your monitor screen. This virus infects both the boot sector and the system programs.

9. Hong-Kong: This is a boot sector virus. In addition to damaging data files, it harms program files and information about the files also. This virus is difficult to remove from the computer system.

10. Joshi: When this virus program starts running, the screen shows, Type “Happy

Birthday Joshi” If you type as instructed by the virus, you would be able to start working again without any harm to your data or programs.

11. Jerusalem: This virus program was created in the University of Jerusalem. Over the years it affected a large number of computers in various countries. There are many versions of this virus. By changing a program a little, a new version of the program is created. It attacks only program files. Its main job is to make its own copy very fast and attach it with other programs. If this replication is uncontrolled, the computer may totally stop working after some time.

12. Michelangelo: This is a harmful boot sector virus. This may do great damage to the disk. This virus is not easy to remove. It sleeps all the time except 6th of March. On this day, it starts running and does the damage. Once, it caused a worldwide panic.

13. Stoned: This is also a boot sector virus. Its two other names are New Zealand and Marijuana. This damages files in both hard disk and floppy disk. If you see on the screen, you may be sure that your disk has Stoned virus. “ Legalize Marijuana. Your computer is now stoned”.

14. Yankee Doodle: This virus does not do any harm. Exactly at 5 p.m. it plays on the computer the tune of the song “Yankee Doodle Dandy”. The computer has a small speaker through which simple tunes can be played.

15. Chernobyl: Recently, this virus created extensive damage in computers worldwide. It activated on 26th of the month and damaged the partition table of the hard disk. In most cases, the disk data was completely lost.

These are not the only virus programs. There are a few thousand-virus programs spread all over the world! Some of these are very difficult to remove and also highly dangerous. Just as some people are busy in creating new virus programs, there are groups of people equally busy in creating programs that remove the viruses. These are called Anti-virus programs.

As new virus programs are created, corresponding anti-virus programs also follow. The only difficulty is, even if a virus is created in China, it may enter your computer in a short while without intimating you. You don’t have to purchase the virus program. But, in case of anti-virus, purchasing is not enough. You have also to keep it always up-to-date. An old anti-virus program will not be able to detect or remove the latest viruses. This is like a war in which no party will emerge as a clear victor. The fight will go on forever. The only option open to the computer user is to remain always alert against the menace. We will know in a short while how to minimize the risk of virus attack.

The virus programs may be divided into two types according to its location inside the computer. The two types are File virus and System virus. The file virus attaches itself with files in the disk. When an infected file is loaded into the RAM, the virus also gets loaded. Normally, program files are infected in this way. The system virus, on the other hand, lodges itself into two very important areas of the disk. One is the boot sector and other is the Partition Table. These areas contain important and necessary information for using the disk and accessing the files stored. If any of these two areas gets damaged, the disk becomes unusable. You effectively lose the files.

Its signature can generally identify a virus program. The signature is a unique series of characters that appear in a virus program. By extensive study of a virus program, its signature is identified. The anti-virus program knows the signatures of all the viruses that it can identify. When such a program is run, it searches the disk areas and the files for the virus signatures it knows. These way viruses are detected. But, there are some dangerous virus programs that change their signatures continuously. It is difficult to detect these. Recently, another special type of programs has been created that produces new virus programs. These are called virus generators. The fight with the virus menace is a never-ending process.

Anti-virus Programs

You already know that an anti-virus program removes viruses from the computer. You have also learnt that this program scans the disk trying to identify the signatures of a few thousand viruses it knows. If it does not know the signature of a particular virus, it won’t be able to identify that virus, let alone remove it.

Virus removal is done in two steps. Firstly viruses are identified and then removed. The first step is detection and the second vaccination. The part of the anti-virus program that removes a particular virus is called the vaccine for that virus. It might happen that an anti-virus program could detect the Stoned virus, but could not remove it. In that case a message might be displayed

“Does not have the vaccine for Stoned virus. Unable to remove”

While scanning the hard disk, an anti-virus program may not look into every file in the disk. Most of the viruses attach themselves with program files and infect special areas of the disk. Thus an anti-virus program normally scans only the program files and the special disk areas, boot sector and partition table.

A few popular foreign anti-virus software packages are, McAfee Virus can, Dr. Solomon’s Anti Virus, Central Point Anti Virus (CPAV), F-Prot and Symantec Anti Virus. You may purchase these packages from the market. But, it is not enough to only purchase such a package. Regularly, you have to get its latest version also. If you do not do that, you won’t be able to remove the latest new viruses with the old anti-virus package. The old package would not have the signatures of the new viruses.

Getting new versions of foreign anti-virus packages is not always easy, particularly when new versions of most anti-virus packages are released every month. This is one of the reasons why a few indigenous packages have become quite popular. Amongst many, a few well-known Indian anti-virus packages are Nashot, Smart Dog and Red Alert.

You might think that you need only one anti-virus package for removing all viruses. Actually, after sometime, you will find that one package is not a foolproof protection against all viruses. You may have to finally use two or three packages. Apart from software anti-virus packages, hardware anti-virus cards also are available. You have to attach these electronic cards with the computer. Some of these cards work along with a software component. The popular among the hardware anti-virus solutions are Protector-Plus, Knox card, and Vigilant Plus.

As viruses mostly attack the hard disk and infect it, you should run the anti-virus program from the floppy. Before starting the anti-virus scan, you should first switch off the computer and boot it from a clean boot floppy. This ensures safe booting and a virus free RAM. After booting, remove the boot floppy and insert the anti-virus floppy. Now you may start your virus scan. The anti-virus software itself will guide you step by step. Any anti-virus software package will have standard set of facilities available through menus. One of these facilities will invariably be to scan a floppy in addition to the hard disk.

How to keep your Computer Safe from Virus

You already know that you cannot totally eliminate the possibility of a virus infection. But, if you follow a few rules, chances of virus infection and consequent damages would be reduced. A few such rules of virus protection are listed below,

1. Believe that a virus infection can do a lot of damage to your work. It might not matter to you even if a virus attack damages all your disk files. In that case, you are not really using the computer for any important purpose. You may as well do without it.

2. Do not use a floppy from an external source without first scanning it for virus. Do not allow an outsider to use your computer without your permission. When scanning, use all of your anti-virus packages. You may keep your anti-virus software permanently running in your computer. It then acts as a protective shield. It raises alarm if any mischievous program is executed. But, this way of working may be slightly inconvenient because of frequent undue interruptions in work.

Just as you do not allow unknown floppies in your computer, you should not use your own floppy also in any other potentially unsafe computer. Your floppy is as powerful a virus carrier as your friend’s floppies.

3. You should always keep good anti-virus software handy with you. If one is not good enough, use more than one. Upgrade your anti-virus as soon as its new version is released. You should also keep a boot floppy and the Operating System floppies readily available with you. You have already learnt about booting. An infected computer sometimes fails to boot. In such a case, even to run the anti-virus you need to boot from the floppy. Making a boot floppy is easy. Sometimes, the operating system programs in the hard disk get damaged. Then you have to load it again from a clean set of floppies. You should always keep the boot floppy and operating system programs write-protected.

4. You should always create your files in separate directories for ease of back up and restoration. For example, you may use a directory LETTERS for storing your letter files. By the word-processing program MS Word, you might create these files. While work in this directory it is possible for you to run MS Word, which resides in its own WINWORD directory. In this manner, you may create your LOGO picture files in LOGOPIC directory, even though the LOGO program resides in LIOGO directory.

One advantage of this way of working is that you always know which directory contain what files. The other big advantage is that you can regularly copy the files in an organized manner. This is called back up. In case of file damage by virus attack, you may restore the files easily from the back-up copies. You should take regular back up of your important files. When a virus damages some of your files, remove the virus first. Then, copy the desired files back to the disk from your back up. You will not suffer any loss.

5. To be sure that your system is completely free from virus, you may have to run the anti-virus program repeatedly. But your job does not end there. You have to scan and clean each of your floppies that might have been infected. Otherwise, within a few days, the hard disk will again be infected. It is a good habit to scan your hard disk and floppies regularly even if you do not suspect a virus attack.

6. If a floppy gets full with files that you would not change, make the floppy write-protected immediately. By this, the files can be read from the floppy, but nothing can be written on it. To infect a floppy, a virus program has to write its copy on the disk. Thus, write-protection of a floppy ensures total safety from virus till you make the disk writable again.

How do you make a floppy write-protected? One of the two holes near the lower edge of the floppy can be closed or opened by moving a notch. Opening the hole make the floppy write-protected. Some of the software packages come in write-protected floppies.

7. Passwords may be used in modern PCs for restricting access. A Password is a special secret word known only to the owner of the PC. After the PC is switched on, it will first ask the correct password to be inputted before it boots. Without knowing the correct password, such a PC cannot be used. Keep your computer switched off when not in use. This will ensure that nobody can use it in your absence.

8. Tell your friends about the virus menace and how to remain safe from it. This will decrease the chances of virus infection to your computer.

9. If you are not able to remove a particularly bad type of virus yourself, do not hesitate to consult an expert. Sometimes, wrong method of virus removal causes serious damage to the files.

10. Be careful when copying files over a computer network.

11. While working on the Internet, keep your network virus-guard always on. Enhance the security of your computer through the settings of the Internet browser.

12. Not only executables, but also document files may contain viruses. Possibility of this form of virus contamination is especially highly if you use E-mail regularly. Do not open an attachment to a mail without first scanning it.

CHAPTER – XVI

An Introduction To Internet

Computer Networks and the Internet

You must be knowing that a worldwide computer network called Internet is making the world real small. This is a network of every conceivable type of computer networks spread worldwide.

Today, the internet is vast. But more significant is its very high rate of expansion. The days are coming when every person having access to the Internet. The variety and scope of applications on the Internet becomes unlimited when every thinking person from all corners of the globe share their knowledge and create knowledge in a continuous manner. But, before Internet, let us first know what a Computer Network is.

Sometimes, we need to exchange information between two or more computers. To do this, the computers are connected to each other using cables and accessories or through communication media. Special communication software packages have also to be run in these computers. This arrangement is called a Computer Network. In a computer network, information can be exchanged between any two computers in the network. You no longer have to copy the computer files in floppies from the first computer, go to the second computer and copy it there. The information is transferred from one computer to another through the cables or transmission media connecting the computers.

According to an expert, the value of information in two connected computers is more than double the value of information in a single isolated computer. In advanced countries, most of the jobs in offices and organizations are done through computer networks. It is possible to establish connection even with a faraway networked computer over the telephone lines or by other means. An example of a computer network is shown in Fig. 15.1.

The cloud is the symbol of the worldwide network. The single network shown gets connected to the worldwide network through communication media. Other computer networks also are connected to some point of the network. Thus a web of computer networks spanning the globe is formed. Each network in this web may contain a single to thousands of computers. These networked computers may be as diverse as PCs to large mainframe computers. If a computer wants to get connected to the web of worldwide network, it simply connects itself to its nearest computer connected to the web. Through this computer, it can then access any of the computers in the web. This is the basic principle on which the Internet works.

Internet is a computer network in which more than seventy million computers are permanently connected. These are spread all over the globe. Theoretically, any of these computers can exchange information with any other computer in the network. Remember, this number of permanently connected computers or hosts of the Internet in turn serve, on an average, two or three times more actual users. These users get connected to the Internet temporarily and log off after using it.

It is said that all the knowledge of human civilization is available on the Internet. You can find any piece of information on the Internet if you have the patience to search for it. If your computer is connected to the Internet, you may copy lots of game programs in your computer. You may electronically visit and read books of many large libraries in the world. You may even see famous paintings from renowned arts galleries around the world. If you are music minded, you may copy music programs into your computer and listen to the music of many different countries. If you want, you may make friends electronically over the Internet and discuss your favorite topics at your convenience.

A big attraction of the Internet is Electronic newspaper. All the major newspapers of the world are available on the Internet. As a source of knowledge and information, Internet is by far the best choice. If you want to know something about a specific topic, send your question electronically into the Internet. Within a day, you will get many answers, some of which most probably will satisfy you.

The most popular application of the Internet is electronic mail or E-mail. You may send electronic letters by using this facility. You can address a letter to your friend in any part of the world. Of course, your friend has also to be connected to the Internet.

The advantage of E-mail is, at the time of sending your mail, your friend need not be connected to the network. Then, how would he receive the mail? It is simply really. The Mail files actually are deposited in a Mail Server computer where your friend has his Electronic Mailbox. The Mail Server computer is always actively connected to the network. It is always on. When your friend logs into the network from his computer, the Mail Server informs him about the arrival of new mail. This facility is nearly free.

In many countries, Internet is considered to be an essential part of any activity. Most organizations, schools, colleges and universities are connected to the Internet. Even regular classes in some schools are conducted using the Internet facilities. During the early nineties, widespread use of personal computers affected everybody. Today, it has become necessary for everybody to connect to the Internet. The Internet is considered to be the latest computer revolution. This will radically change human civilization and the change has already started.

In India, you may get an Internet connection from Videsh Sanchar Nigam Ltd., Dept. of Telecom and a few other private companies. These are the ISPs or Internet Service Providers to you. To encourage quick spread of Internet use, recently the business of ISP has been opened to private companies.

As a student, for a few hundred rupees per year, you will get an Internet shell account. In this type of connection, you can see only texts from different computers of the world. To see pictures, you have to get a TCP/IP account. This will cost you more. You will need a good computer, a modern and a telephone line for an Internet connection. In addition, you will need an Internet browser software or communication software in your PC for dialing, connection and retrieving information. Nowadays, like PCO booths, Internet booths or kiosks are coming up. From these, Internet can be accessed on time rate basis.

People in the Internet

There are millions of people who work on the Internet. Some of them provide information to others. Most of them use this information.

People who only use Internet Information

People like you, who do not provide any information to others, but only use the information provided by others, are the largest in number. Typically, these people get an account from their ISP and connect their computers to the Internet through telephone lines. They are the common users. The computer of a common user does not have any identify in the Internet. Nobody else in the Internet can connect his or her computer to the computer of such a common user.

You, as a common user, connect your computer only to the computer of your ISP and to no other computer. Then how will you get information from other computers in different parts of the world? We will soon see.

People who provide Information to others

People who provide information to others maintain this information in computers called Internet Servers. These computers have unique addresses in the Internet. These are also directly connected to one or more of the ISP computers in their locality. Web servers are one of the most frequently found servers in the Internet.

Furthermore, one server may host more than one Internet Site. An Internet Site deals with only one type of information. For example, there are Sites that keep computer games only. So, to get a computer game, you have to land on one such Game Site. Similarly, there are Music Sites that maintain libraries of electronic music.

Internet Site is actually a collection of programs and data files doing a specific type of job on the Internet. We say that the Server on which the Site is running hosts the Site. In an Internet Server computer, there may be many sites running. A Server and each of its Sites are identified in the whole of the Internet by a scheme of unique addressing. You will know more about these in future.

These are millions of Internet Sites maintaining all types of information that are possible under the sun. One special kind of Web Site maintains information about Internet Sites only. These are called Web Search Engines. Yahoo!, 123india and Altavista are a few such popular Sites. These Sites maintain the information on the contents of many Internet sites. When you connect to a web search site, you get a list of subjects on the first screen. Each entry in this list will be underlined. These are called hypertext entries. When you move your mouse arrow over such an entry, the mouse pointer arrow will be transformed into a hand. If you click your mouse button now, you get immediately connected to the site providing the particular entry. It is that easy!

These screens containing hypertext entries are called Web pages. The first screen that you see from a site is its Home page. The home page of a web search site gives you the Internet search capability. Any item on a web page that converts the mouse pointer to a hand contains a link to another site. First you log on to the Internet by connecting to the ISP computer. Then, through your Internet browser software, you connect to the first web site which usually is a search site. Now you are free to click on any hypertext link and connect to other sites. If you do not find your desired matter, click on a link and connect to another site. This way of working is called Net Surfing.

Internet Service Providers or ISPs

ISPs are the people who provide the Internet Services to others. In India, VSNL, DoT and a few private companies are the ISPs. These people maintain powerful computers and connect these to a few ISP or Gateway computers in other countries. To connect to the Internet through your computer, you have to dial a telephone number given to you by your ISP. This telephone line allows you to log in to your ISP computer.

When you connect to the ISP computer, you get a screen asking for your Internet user name and Password. You get these from the ISP when you open your account on payment of requisite charges. Remember, you have to keep these secret. The ISP keeps a track of how long you have used the Internet facilities against your account. As the number of hours of use is limited by the money you paid to the ISP, each hour of use cost you some money. You have to carefully spend these hours. Otherwise, one fine morning you may find that you are unable to log-in to the Internet because you have exhausted your allotted hours!

After successfully logging in to the ISP computer, you need to run an Internet browser software for browsing the Internet. When you run this software, it will display the home page of the Start site that may be any site of your choice.

Suppose, you want to connect now to - the search site Altavista. You have to type this address in a space provided in your Internet browser screen and then click the mouse button. The ISP computer will immediately set up a connection with the Altavista computer and will show the first page or home page of the Altavista site. By clicking on the hypertext entries in the Altavista home page, you may connect to further sites and surf the Net.

All these connections are set up for you by the ISP computer to which you had connected in the beginning. The ISP computer and not your computer get connected to other computers. The screens and information are collected by the ISP computer and transferred to your computer. All the while you work on the Internet, you pay only the local telephone call charge in addition to the account charge that you had paid once only to your ISP.

An Internet Page

An actual page from the search site Yahoo is shown in Fig. 15.2. The browser software used here is the Microsoft Internet Explorer. Netscape Navigator and Internet Explorer are the two most used browser software packages in the world. The browser software controls access and display of Internet information. On top of the screen, notice the Explorer buttons. The underlined subject entries are in hypertext language. By clicking on these entries you may connect to other sites or other pages of the current site.

Computers Tomorrow

Let us see first how the CPU changed over time,

1981 – Release of the first Personal Computer by IBM

1984 – Launching of IBM PC AT 286 (8 MHz, 0.9MIPs)

1985 – Intel creates its 32 bit 386 chip (16 MHz, 5MIPs)

1989 – Intel 80486 DX with math co-processor, still 32 bit (25 MHz, 20MIPs)

1993 – Intel Pentium chip released (60 MHz, 100MIPs)

1995 – Intel Pentium Pro chip released (150 MHz, 320MIPs)

1997 – Intel Pentium MMX chip released (150-200 MHz)

1998 – Intel Pentium II (233-300 MHz)

1999 – Intel Pentium III (400-500 MHz)

MIPs is Million Instructions per second.

Intel plans to release this year (2000 AD) Micro 2000 chip. It will be a 50,000 MIPs chip. The next release of Micro 2011 is planned to be released in 2011 AD. It will be a 10 GHz (100 times 100 MHz) and 100,000 MIPs chip. This will contain hundreds of millions of transistors,

User Interface

We are now used to mouse clicking and typing on the keyboard. With the power of the PC accelerating, it will be common, not far in future, to communicate with the computer in your normal voice.

Home and Office of the future

Many small computers sitting at various corners of your house and hidden inside walls and equipment will make your house intelligent! Your fridge may have a flat panel display with a hidden processor controlling the fridge operations optimally. One computer will control the temperature and humidity of your house and another will control the security mechanism. Another may remind you of your pending jobs and guide you through the day. Yet another may advise you on food and even control the purchase of food items and their preparation.

It is only a matter of time before your TV set, music system, telephone handset, VCR and your home PC (if you have one) will be combined into a single equipment. You will be permanently linked to the worldwide computer network and even in your absence your PC (if you call it that) will communicate with the outside world as you wished it to do.

When you can video-conference with any selected group of workers from your home, or can have at your fingertips all the data and information that you need for your work from your home computer, you do not really need to go out to an office spending time and burning petrol.

Electronic Shopping & Business, - e-commerce

In future, you may not need to go to any shop for purchase. For any shop, information about all their products would be available in the network. On your computer display, if you select a particular shop, its three-dimensional picture will be displayed. By voice command, you will be opening the door and go into the shop getting and inside view on your display. On the 3D racks you will see the 3D products displayed. With a bit more extra expenditure, you may even be able to pick up an item, feel its weight and texture and inspect its function! This is the area of Virtual Reality on the network that exists in limited form even today. If you choose the item for purchase, just select Order button on your screen or place the order by voice command. Business on the Internet or e-commerce has already become a buzzword today though we have to wait some more time for its full use.

Future Education

After sometime, a large percentage of the population have to educate themselves by Electronic Tutor on the network. Computer knowledge will be a necessity. By 2005, literacy in IT will be essential for any employment. In 2010, most people would have learning as a life long pursuit. A decade later scenario – 50% of students go to public schools, 20% are home schooled and the rest go to the human mediated private schools. World library and Electronic books are certainties.

Future Transport

You will simply tell the car’s navigation system where you want to go, and it will plot a course for you, based on whether you want the fastest, cheapest, or the most scenic route.

Natural Language Processing

By 2010, a program will allow users to speak any language and it will translate those words into synthesized speech in a different language. Eventually, computers will recognize and respond not only to speech and video but also to gestures and facial expressions. It is predicted that, ultimately, computers will anticipate our desires!

Telepresence

The sense of being there or telepresence, delivered by devices like the Smart Chair, will be much stronger than today’s videoconference systems. Flat-screen, two-dimensional pictures will give way to 3-D sight and sound projections that encircle participants.

A picture in 2010 – a half dozen people, scattered around the globe, phone in to a single videoconference room. The audio quality is excellent. Many cameras and massive screens give a real 3-D feel to the gathering. The group decides they’d rather chat on the beach in Goa. So the backdrop of the room gives way to a clear-blue sky and a blue-green sea. The conference participants are treated to the sound of waves in the background, as they tackle the meeting’s agenda!

Personal Area Network

Ultimately, the network connection will extend to human beings in an organic man-machine interface. Individual’s medical records, financial data, daily appointments, shopping habits, preferences, tastes, and behavioral patterns will be kept on a miniature smart card inserted right under the skin.

Want to give someone your business card? A handshake will do. Looking for your hotel key? Grab the door handle, and your body will transmit your room password to unlock the door!

What will the humans do?

If the networked computers do all the work, what will the humans do? Will they only consume? An author gave an interesting solution some years ago. Half the work force will be busy removing the errors from the computer systems not knowing that the other half is busy introducing them.

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

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download