You are on page 1of 265

Table of Contents

Table of Contents
Unit 1 Computer Fundamentals................................................................................. 10 1.1. Introduction to Computers................................................................................ 10 1.2. 1.3. 1.4. 1.5. 1.6. 1.7. 1.8. 1.9. 1.10. 1.11. 1.12. 1.13. 1.14. 1.15. 1.16. 1.17. 1.18. 1.19. 1.20. 1.21. 1.22. 1.23. 1.24. A Brief History of Computers.......................................................................... 11 Different Types of Ports ................................................................................... 21 Storage ............................................................................................................... 22 Memory ............................................................................................................. 24 Secondary Storage ............................................................................................ 24 Data Hierarchy .................................................................................................. 26 Input Devices .................................................................................................... 26 Output Devices.................................................................................................. 28 Device Drivers .................................................................................................. 31 System Software ............................................................................................... 32 Application Software ........................................................................................ 32 Booting the Computer ...................................................................................... 33 Software Evaluation.......................................................................................... 34 Information Networks....................................................................................... 35 Network Topologies ......................................................................................... 36 Communication Media ..................................................................................... 37 Data Transmission Types ................................................................................. 39 Network Interface Card (NIC) ......................................................................... 39 Types of Networks ............................................................................................ 40 Network Protocols ............................................................................................ 40 Computer Virus................................................................................................. 42 Main Phases of Virus Activity ......................................................................... 44 How to Protect a Computer from Computer Viruses ..................................... 45

Faculty of Information Technology-University of Moratuwa

Table of Contents 1.25. 1.26. 1.27. 1.28. 1.29. Internet............................................................................................................... 46 Internet Browsers .............................................................................................. 47 What is an URL?............................................................................................... 48 Resources Found on the WWW....................................................................... 50 Internet Glossary ............................................................................................... 51

Unit 2 Mathematics for Computing ......................................................................... 58 2.1 Number systems................................................................................................ 58 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 2.11 2.12 2.13 2.14 Decimal system [Base-10]................................................................................ 60 Binary system [Base-2] .................................................................................... 61 Octal Number System [Base-8] ....................................................................... 65 Hexadecimal Number System [Base-16] ........................................................ 66 Data Structures.................................................................................................. 68 ASCII, BCD and EBCDIC Codes ................................................................... 69 BCD (Binary Coded Decimal) ......................................................................... 71 EBCDIC (Extended Binary Coded Decimal Interchange Code)................ 72 Boolean Algebra ............................................................................................... 73 Basic Laws and Axioms of Boolean algebra .................................................. 74 Truth Tables ...................................................................................................... 75 Logic Gates and Circuits .................................................................................. 76 Exercises............................................................................................................ 78

Unit 3:Information Systems ....................................................................................... 84 3.1. What is a System?............................................................................................. 84 3.2. 3.3. 3.4. 3.5. Elements of a System........................................................................................ 84 Information Systems......................................................................................... 85 Types of Information Systems......................................................................... 86 Systems Development Life Cycle (SDLC) ..................................................... 88

Faculty of Information Technology-University of Moratuwa

Table of Contents 3.6. Phases of the SDLC .......................................................................................... 89

Unit 4. Introduction to Programming Languages ....................................................... 94 4.1. Generations of Programming Languages ........................................................ 94 4.2. 4.3. 4.4. 4.5. 4.6. 4.7. 4.8. 4.9. 4.10. 4.11. 4.12. 4.13. Pascal Programming ......................................................................................... 98 Pascal Programming Basics ............................................................................. 98 The Structure of a Pascal Program .................................................................. 99 Pascal Identifiers ............................................................................................. 100 Constants ......................................................................................................... 102 Variables and Data Types............................................................................... 102 Operation ......................................................................................................... 104 Formatted Input and Output........................................................................... 107 Sequential Control .......................................................................................... 110 Procedures and Functions............................................................................... 114 Enumerated Types .......................................................................................... 118 1-dimensional Arrays...................................................................................... 119

Unit 5- Office Applications and Internet ................................................................... 122 Unit 5.1: Word Processing.............................................................................................. 122 5.1.1. Introduction to Word .......................................................................................... 122 5.1.2. Starting Microsoft Word .................................................................................... 122 5.1.3. A typical Word screen ........................................................................................ 123 5.1.4. Selecting Text ..................................................................................................... 123 5.1.5. Viewing the Toolbars ......................................................................................... 124 5.1.6. Spell Checker ...................................................................................................... 126 5.1.7. Correcting............................................................................................................ 126 5.1.8. Page Setup........................................................................................................... 127 5.1.9. Saving Documents.............................................................................................. 128

Faculty of Information Technology-University of Moratuwa

Table of Contents 5.1.10. Creating a New Document................................................................................. 128 5.1.11. Formatting........................................................................................................... 128 5.1.12. Indenting.............................................................................................................. 130 5.1.13. Line Spacing ....................................................................................................... 131 5.1.14. Bullets & Numbering ......................................................................................... 131 5.1.15. Borders and Shading........................................................................................... 134 5.1.16. Searching For Text ............................................................................................. 134 5.1.17. Replace text......................................................................................................... 135 5.1.18. Header & Footer ................................................................................................. 135 5.1.19. Page Breaks ......................................................................................................... 137 5.1.20. Inserting Special Symbols.................................................................................. 137 5.1.21. Inserting Clip Art into a Word document.......................................................... 137 5.1.22. Resizing a clip art image .................................................................................... 138 5.1.23. WordArt............................................................................................................... 139 5.1.24. Inserting Page Numbers ..................................................................................... 140 5.1.25. Setting a tab stop in Word.................................................................................. 142 5.1.26. Formatting tabs by adding a Leader.................................................................. 142 5.1.27. Columns............................................................................................................... 143 5.1.28. Tables .................................................................................................................. 145 5.1.29. Sum a row or column of numbers...................................................................... 146 5.1.30. Printing ................................................................................................................ 146 Unit 5.2 Spreadsheets........................................................................................................... 156 5.2.1 5.2.2 5.2.3 Introduction to Excel ...................................................................................... 156 Starting Microsoft Excel................................................................................. 156 Order of Operations Excel Uses..................................................................... 158

Faculty of Information Technology-University of Moratuwa

Table of Contents 5.2.4 5.2.5 5.2.6 5.2.7 5.2.8 5.2.9 Moving around the worksheet: Using the Keyboard.................................... 158 Selecting a range ............................................................................................. 158 Correcting Mistakes........................................................................................ 159 Autosum .......................................................................................................... 160 Copying and Pasting Formulas ...................................................................... 161 Using the Fill Handle to Fill a Series of Cells .............................................. 161

5.2.10 Relative Cell References in Copying a Formula........................................... 161 5.2.11 Formatting Cells.............................................................................................. 162 5.2.12 Formula and Functions................................................................................... 166 5.2.13 Charts............................................................................................................... 167 5.2.14 Filters ............................................................................................................... 170 5.2.15 Sorting ............................................................................................................. 171 Unit 5.3 - Microsoft PowerPoint ............................................................................................ 179 5.3.1 5.3.2 5.3.3 5.3.4 5.3.5 5.3.6 5.3.7 5.3.8 5.3.9 Introduction to presentation ........................................................................... 179 Starting Microsoft PowerPoint....................................................................... 179 Creating a New Presentation.......................................................................... 180 Creating a Blank Presentation........................................................................ 181 Auto Layout..................................................................................................... 182 Slide Manipulation.......................................................................................... 182 Inserting Clipart or Pictures ........................................................................... 182 Formatting Text............................................................................................... 183 Inserting A New Slide .................................................................................... 183

5.3.10 Formatting A Slide Background.................................................................... 183 5.3.11 PowerPoint Views........................................................................................... 185 5.3.12 Changing the Layout of a Slide...................................................................... 187

Faculty of Information Technology-University of Moratuwa

Table of Contents 5.3.13 Notes Page....................................................................................................... 188 5.3.14 Inserting Objects in a Presentation ................................................................ 188 5.3.15 Animating an Object....................................................................................... 190 5.3.16 Transitions....................................................................................................... 190 5.3.17 Saving the Presentation .................................................................................. 191 5.3.18 Arranging slides for Printing.......................................................................... 192 5.3.19 Printing ............................................................................................................ 192 Unit 5.4 - Databases ................................................................................................................ 196 5.4.1 5.4.2 5.4.3 5.4.4 5.4.5 5.4.6 5.4.7 5.4.8 5.4.9 Introduction to Access.................................................................................... 196 Starting Microsoft Access .............................................................................. 196 Steps in designing a database......................................................................... 197 Creating New, and Opening Existing Databases .......................................... 197 Create a Blank database.................................................................................. 198 Create a database using the Database Wizard ............................................... 199 Access Databases............................................................................................ 199 Defining the fields in a table .......................................................................... 201 Primary Key .................................................................................................... 204

5.4.10 Combo box ...................................................................................................... 204 5.4.11 Saving a Table ................................................................................................. 205 5.4.12 Switching Views ............................................................................................. 205 5.4.13 Entering Data .................................................................................................. 205 5.4.14 Manipulating Data .......................................................................................... 205 5.4.15 Queries............................................................................................................. 206 5.4.16 Select queries .................................................................................................. 206 5.4.17 Creating a Query ............................................................................................ 206

Faculty of Information Technology-University of Moratuwa

Table of Contents 5.4.18 Multiple criteria in a query ............................................................................. 207 5.4.19 To run a query ................................................................................................. 208 5.4.20 Sorting a Table ................................................................................................ 208 5.4.21 Create a Form using the Wizard .................................................................... 209 5.4.22 Reports............................................................................................................. 212 5.4.23 Create a Report using the Wizard .................................................................. 212 5.4.24 Grouping.......................................................................................................... 215 Unit 5.5 - Information & Communication ............................................................................. 220 5.5.1 5.5.2 5.5.3 5.5.4 5.5.5 5.5.6 5.5.7 5.5.8 5.5.9 Introduction to Internet................................................................................... 220 What is Internet? ............................................................................................. 220 World Wide Web (WWW)............................................................................. 220 Electronic Commerce ..................................................................................... 220 Hyperlinks ....................................................................................................... 220 URLs ................................................................................................................ 221 What is http?.................................................................................................... 221 What is an ISP? ............................................................................................... 221 Accessing Internet........................................................................................... 221

5.5.10 Connecting to your ISP................................................................................... 222 5.5.11 Exploring the Internet ..................................................................................... 222 5.5.12 Searching the Internet ..................................................................................... 223 5.5.13 Choosing terms and syntax ............................................................................ 223 5.5.14 Exploring with use of the Yahoo Page .......................................................... 223 5.5.15 Downloading a web page ............................................................................... 226 5.5.16 Printing ............................................................................................................ 227 5.5.17 Electronic Mail................................................................................................ 228

Faculty of Information Technology-University of Moratuwa

Table of Contents 5.5.18 Getting started ................................................................................................. 228 5.5.19 E-mail address................................................................................................. 229 5.5.20 Email folders ................................................................................................... 229 5.5.21 Creating and sending e-mail messages.......................................................... 229 5.5.22 To create and send an e-mail message from Outlook 2000 ......................... 229 5.5.23 Signatures ........................................................................................................ 233 Unit5.6 - Operating System .................................................................................................... 237 5.6.1 5.6.2 5.6.3 5.6.4 5.6.5 5.6.6 5.6.7 5.6.8 5.6.9 Introduction to Operating System.................................................................. 237 Features Expected of an Operating System................................................... 237 Types of Operating Systems .......................................................................... 237 The Windows Desktop ................................................................................... 238 Point to items with right-facing arrows to open secondary menus.............. 240 Keyboard Keys................................................................................................ 240 Using a Mouse................................................................................................. 241 Starting and Quitting Programs...................................................................... 243 Personalising Your Desktop Display............................................................. 244

5.6.10 Managing Files and Folders ........................................................................... 246 5.6.11 Searching Files and Folders ........................................................................... 249 5.6.12 Viewing Folders .............................................................................................. 252 5.6.13 Formatting a Diskette ..................................................................................... 252 5.6.14 Shutting Down Your Computer..................................................................... 252 5.6.15 Printing ............................................................................................................ 253 Unit 6 - ICT for National Development..................................................................... 257 6.1. 6.2. Introduction..................................................................................................... 257 Evolution of Poverty Eradication Programs.................................................. 258

Faculty of Information Technology-University of Moratuwa

Table of Contents 6.3. 6.4. 6.5. Harnessing the potential of ICT for Development........................................ 258 How does ICT enhance and facilitate Development? .................................. 259 Information and Communication Technology (ICT) to Rural Areas in Sri Lanka-

Problems and Issues. ................................................................................................... 260

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals

Unit 1 Computer Fundamentals


1.1. Introduction to Computers A computer is a man-made, programmable electronic machine that can store, retrieve, and process data according to a given set of instructions. Whatever information given to a computer is termed input. The computer input typically comprises of two things: Data and Instructions. The data are the facts, which are to be processed, and the instructions describe how the computer should process the data. The data which has been converted or organized into a more useful or intelligible form for direct utilisation or helps human beings in their decision making process is typically termed information. The heart of the computer is a microprocessor chip. Today microprocessors are embedded inside various every-day machines such as cars, television sets and washing machines. These microprocessors usually control some function of the machine and are hidden from the user. The term computer can virtually be applied to any such device that has a microprocessor in it. However most people describe a computer as a device that comprises of a keyboard, mouse, a central processing device and a screen.

Figure 1.1 Overview of the Personal Computer Characteristics of Computers The main characteristics of computers are: Speed A computer can perform tasks very fast. For example, the amount of work that a human being can do in an entire year - if he worked day and night and did nothing else, can be accomplished by a computer within a few minutes.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals Accuracy The accuracy of a computer is consistently high and the degree of accuracy of a particular computer depends upon its design. Errors can occur in a computer, but these are mainly due to human mistakes. Diligence Unlike human beings, a computer is free from monotony, tiredness, lack of concentration, etc., hence a computer can work for hours without making any errors or complaints. Even if ten million calculations have to be performed, a computer will perform the ten millionth calculation with exactly the same accuracy and speed as the first one. Versatility A computer is capable of performing almost any task provided that the task can be reduced to a series of logical steps (i.e. a computer program) Power of Remembering Every piece of information that a user stores on a computer can be retained as long as is needed and can be recalled when necessary. Even after several years, the information recalled would be identical to what was fed to the computer. A computer will never lose stored information on its own; a user has to remove (or delete) the information from it. No I. Q. A computer can only perform tasks which a human being can. The difference is that it performs these tasks with unmatchable speed and accuracy. It possesses no intelligence of its own. Its I.Q. is zero, at least till today. It has to be told what to do. Hence, only the user can determine what tasks a computer will perform. No Feelings Computers are devoid of emotions. They have no feelings and no instincts because they are machines. Although human beings have succeeded in building a memory for the computer, a computer does not possess the equivalent of a human brain. Based on our feelings, taste, knowledge and experience, we often make certain judgments in our day-to-day life, but computers cannot make such judgments on their own. Their judgment is based on the instructions given to them in the form of programs by someone. 1.2. A Brief History of Computers Ancient Times In the beginning, man used his fingers and toes to perform simple computations such as addition and subtraction. Later, man realized that by using some objects to represent digits, it might be possible to perform computations beyond the limited scope of ones own fingers and toes. The first man-made computing device is the Abacus. In the Abacus, small beads are arranged on a series of vertical rods in a manner that by manipulating them, it is possible with some skill and practice, to make rapid calculations. Addition, subtraction, division and multiplication can be performed on a standard abacus. The abacus is still in use today by shopkeepers in East Asia and some parts of North America.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals

Figure 1.2 The Abacus Besides the abacus, early man also invented numbering systems to enable him to easily handle numbers greater than 10. One such numbering system is the decimal numbering system, which is traceable to early Hindu-Arabic influence. This decimal system, with specific digits representing numbers from 0 to 9, came into general use in Europe and has survived ever since. 1600 1900 In 1642, Blaise Pascal, a French mathematician, invented an adding machine. The machine has adopted partly the principles of the abacus but did away with the use of the hand to move the beads or counters. Instead, Pascal used wheels to move counters.

Figure 1.3 Adding Machine, In 1642, Blaise Pascal The principle of Pascals machine is still being used today, such as in the counters of tape recorders and odometers. Pascals machine was one of the first mechanical calculating machines. In 1674, Gottfried Wilhelm Von Leibnitz made improvements on Pascals machine. With Leibnitzs improvements, it was possible for the machine to divide and multiply as easily as it could add and subtract. When the age of industrialization spread throughout Europe, new machines were invented to be used in agricultural and production sites. An invention that made profound changes in the history of industrialization was the mechanical loom invented by a Frenchman named Joseph Jacquard. With the use of cards punched with holes, it was possible for the Jacquard loom to weave fabrics in a variety of patterns. The idea of using a punched card to store a predetermined pattern to be woven by the loom clicked in the mind of Charles Babbage, an English mathematician who lived in the nineteenth century. He foresaw a machine that could perform all mathematical calculations, store values

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals in its memory and perform logical comparisons among values. He called it the Analytical Engine. Babbages analytical engine, however, was never built. The technology at that time was not adequate for building Babbages dream because electronics was not yet known or even thought of.

Figure 1.4 Babbages Analytical Engine

Herman Hollerith adopted the punched card concept of Jacquard to devise a system to process census data. Census data were translated into a series of holes in a punched card to represent the digits and the letters of the alphabet. It was then passed through a machine with a series of electrical contacts, which were either turned off or on depending on the existence or nonexistence of holes in the punched cards. These different combinations of off/on situations were recorded by the machine and represented a way of tabulating the results of the Census. The Code developed by Hollerith is called the Hollerith Code. Holleriths machine was highly successful. It reduced the time by two thirds of the time it took to tabulate the result of the Census manually. 1900 1945 Howard Aiken of Harvard University thought that technology in 1937 was just right to implement Babbages concept. With the combined effort of his colleagues in Harvard and IBM, the Automatic Sequence Controlled Calculator was built in 1944 and it was called MARK I. MARK I could perform division, multiplication, addition and subtraction in a specified sequence determined by the setting of the switches. MARK I used a typewriter connected to it or punched cards to output results. It contained more than three thousand electro-mechanical relays and weighed five tons. MARK I was used for 15 years. 1946 1960 The ENIAC (Electronic Numerical Integrator and Computer) was the first electronic digital computer. It was built in 1946 at the Moore School of Electrical Engineering of the University of Pennsylvania. The ENIAC had no moving parts. It was programmable and had the capability to store calculation steps. The ENIAC used vacuum tubes (about 18,000 in number).

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals A computer using vacuum tube technology is referred to as a first-generation computer. The ENIAC could perform an addition in 0.2 millisecond. This means that the machine was capable of performing about 5,000 computations per second. The principal drawback of ENIAC was its size and processing ability. It occupied 1,500 square feet of floor space and could process only one program or problem at a time. In the 1950s, Remington Rand manufactured the UNIVAC I (Universal Automatic Calculator). It could calculate at the rate of 10,000 additions per second. In 1957, the International Business Machine Corporation (IBM) developed IBM 704 which could perform 100,000 calculations per second. The Age of Transistors In the late 1950s, transistors were invented and quickly replaced the thousands of vacuum tubes used in electronic computers. Transistor-based computers could perform 200,000 to 250,000 calculations per second. The transistorized computer represents the second generation of computer. It was not until the mid-1960s that the third generation of computers came into being. These were characterized by solid state technology and integrated circuitry coupled with extreme miniaturization. The fourth-generation of computers came into being after 1971. These computers were characterized by further miniaturization of circuit, increased multiprogramming and virtual storage memory. In the 1980s, the fifth-generation of computers were operating at speeds of 3 to 5 million calculations per second (for small-scale computers) and 10 to 15 million instructions per second (for large-scale computers). The Age of Microcomputers The age of microcomputers began in 1975 when a company called MITS introduced the ALTAIR 8800. It was a computer, which can be programmed by flicking switches on the front. It came as a kit and had to be soldered together. It had no software programs, but it was a personal computer available to the consumer for a few thousand dollars when most computer companies were charging tens of thousands of dollars for their computers. In 1977, both Commodore and Radio Shack announced that they were going to make personal computers. Mass production of the APPLE began in 1979, and by the end of 1981, it was the fastest selling of all the personal computers. GENERATIONS OF COMPUTERS FIRST (early SECOND (late FOURTH (70's THIRD (60's) 50's) 50's) +) Integrated microchips Technology vacuum tubes Transistors circuits (LSI, VLSI) Relative speed 1 100 100 1,000,000 +++ Relative cost 1 0.1 0.01 0.001 --RAM capacity 32,0001,000-8,000 4,000-64,000 32,000,000+++ (bytes) 4,000,000 External storage cards Tape magnetic disks mass storage Single user; Single user; Multiple users; Operating Multiple users; jobs scheduled jobs scheduled distributed System time- sharing manually automatically systems Table 1.1 - Generations Of Computers

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals Different types of computers. A number of different dimensions can be used to classify computers into different types. Traditionally, the size and the capabilities of computers are used as the main criterion and the computers are classified into the following types. PC - The personal computer (PC) is small in size and is designed for general use by a single person. Desktop - A PC that is not designed for portability. A desktop computer is typically set up in a permanent location. Laptops (Notebooks) - A portable computer that includes a battery to provide power for some specific period of time. Palmtop - More commonly known as Personal Digital Assistants (PDAs). Palmtops are small, lightweight and tightly integrated computers which usually do not have keyboards but rely on touch screen technol ogy for user input. Palmtops are equipped with a battery with reasonable life. Workstation - A desktop computer with a powerful processor, additional memory and enhanced capabilities for performing a special group of tasks, such as 3D graphics. Server - A computer that has been optimized to provide services to other computers over a network. Servers usually have powerful processors, lots of memory and large hard drives. Mainframe - Mainframes are huge computers, which could fill an entire room or even a whole floor. Over the years, the size of computers has diminished while the power has increased; the term mainframe has fallen out of use. You will still hear the term used, particularly in large companies to describe the huge machines processing millions of transactions every day. Supercomputer - This type of computer is usually are very expensive. Although some supercomputers are single computer systems, most are comprised of multiple high performance computers working in parallel as a single system. The best-known supercomputers are built by Cray Supercomputers.

Figure 1.5 Difference Types of Computer

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals Data Representation Computers use the two-state system to represent data. Such a two state system is referred to as a binary system. In computers these two states are denoted by the digits 0 and 1 and any such value is called a binary digit or bit. Inside the computer these two states are typically implemented by using two different voltages. As in any other measuring system, bits are also combined into a number of groups. A group of eight bits is called a byte, 1024 bytes is called a kilobyte, 1024 kilobytes is called a megabyte and 1024 Megabytes is called a Gigabyte. ( In computer jargon, One Kilo = 210 ) Letters, numbers and special characters are represented within a computer by means of a binary coded scheme. Three popular binary coding schemes are ASCII, EBCDIC and Unicode. The ASCII and EBCDIC schemes use eight bits to represent characters whereas Unicode uses 16 bits.

Figure 1.6 The ASCII and EBCDIC schemes

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals

Figure 1.7 Unicode Character (Sinhala)

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals Components of a Computer System By considering the functions performed by the various components, a computer can be represented as a collection of logical components as in Figure 1.3. The main hardware components of a modern computer system are the central processing unit (CPU), the main memory, the secondary storage and the input-output devices.

Figure 1.8 Block Diagram for Computer System

System Unit The system unit, or the cabinet houses most of the essential components of the computer system such as the power supply, the motherboard, the CPU chip, specialized chips, the system clock, RAM, ROM, expansion boards and bus lines.

Figure 1.9 System Unit

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals Central Processing Unit (CPU) The central processing unit performs the majority of calculations and controls the operation of a computer. CPUs are rated by the speed at which they can execute instructions. The speed of a CPU is measured in Megahertz (MHz), and is also known as the clock speed. The higher the value of the speed the faster the computer can run programs. The capacity of a CPU is expressed in terms of word size. A word is the maximum number of bits that the CPU can manipulate or store at one time.

Figure 1.10 CPU

Different manufactures are making CPUs today. Some of these popular CPUs available today are the Intel, AMD, Cyrix and Motorola. The CPU consists of two parts: the control unit (CU) and the arithmetic/logic unit (ALU). Control Unit (CU) The control unit controls and directs the operation of the entire computer system. Although it does not perform any actual processing on the data, the control unit acts as a central nervous system for the other components of the computer. It obtains instructions from the program stored in main memory, interprets the instructions, and issues signals, which cause other units in the system to execute them. Arithmetic-Logic Unit (ALU) The Arithmetic-Logic unit performs arithmetic operations such as addition, subtraction, multiplication and division on data. It also performs logical operations, which involve comparison of data. In microcomputers, the entire CPU is typically fabricated on a single chip. CPU Properties Property Speed Word Size Data Path Maximum Memory

Meaning The number of operations which can be performed per second The largest number of bits which can be handled in one operation The largest number of bits which can be transported into the chip in one operation Amount of memory that CPU can address

Units MHz Bit Bit MB

Table 1.2: CPU Properties

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals Mother Board The mother board is the main circuit board inside the computer. It can be considered as the main communication centre through which all the components of the computer transmit data back and forth. All the main parts including the CPU of the computer are typically plugged into the motherboard. The motherboard also provides sockets, called expansion slots, to plug in special electronic circuit boards to enhance the functionality of the computer. These extra circuit boards are called expansion cards, by using which you can customize a computer to suit your needs. One other major function of the motherboard is to supply the necessary power to all its expansion cards.

Figure 1.11 The mother board

System Clock Computers run to the beat of a clock. A clock in the computer that ticks one million times per second is called a one megahertz (1MHz) clock. Generally a faster clock means faster execution of programs, hence better performance. However the actual performance of a computer depends on many other factors. Power Supply The regulated power supply inside the computer transforms mains electricity into DC current used in the computer. It has an internal fan to cool the unit. Peripheral Devices Peripheral devices are the components of the computer which are situated outside the main casing of the computer. Peripheral devices are typically connected to the computer by using ports.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals 1.3. Different Types of Ports A typical computer may provide a number of different types of ports to connect external devices to it. Some of these different port types and their typical usages are explained in the following sections.

Figure 1.12 System Unit, Ports Layouts

Serial Port A serial port is used to connect external modems or an older computer mouse to the computer. There are two serial port versions : 9-pin version , or 25-pin version. Serial port is a male port and the typical data transfer rate over a serial port is 115 kilobits per second.

Video Card Port This connector is used to connect a computer display monitor to a computer's video card. The port is a female port and has 15 holes.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals
Parallel Port

A Parallel port has 25 holes and is commonly known as the printer port. They are used to connect external devices such as scanners and printers.

PS/2 Port A PS/2 port, also referred to as a mouse port, is used to connect a mouse or keyboard with the computer. Most computers come with two PS/2 ports, one for the keyboard and the other for the mouse.

USB Port A universal serial bus (USB) port is a fairly new port - introduced around 1997. This port can be used to connect all kinds of external devices, such as external hard drives, printers and mice, scanners. USB-compliant devices can draw power from a USB port. USB 2.0 connectors were introduced in 2003 and are capable of transferring data at 480 Mbps.

Ethernet (Network) Port This port is used to connect the computer to a network or to Internet. Data travels through this port at speeds of either 10 Megabits or 100 Megabits depending on the speed of the network card in the computer. Little monitor lights on these devices flicker when the port is in use. 1.4. Storage Generally, computers provide many different types of storage systems. The different types of storage systems in a computer can be arranged in a hierarchy according to speed and their costs as shown in Figure 1.12. In this figure, as we move down the hierarchy, the cost to store a bit generally decreases, whereas the access time generally increases.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals

Registers Cost Cache Access Time

Main Memory

Disks

Magnetic Tapes

Figure 1.13 Storage Systems Comparison The smallest unit of data that can be stored in a computer is a bit. A bit will have the value 0 or 1 . A large collection of such 0s or 1s is what makes up data in a computer. Smallest Unit 8 bits 1024 bytes 1024 kilobytes 1024 megabytes 1024 gigabytes - 1 bit - 1 byte - 1 kilobyte (KB) - 1 megabyte (MB) - 1 gigabyte (GB) - 1 terabyte ( In computer jargon, One Kilo = 210 =1024) The capacity of a particular storage device and the space taken up by a file are always measured using these units.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals 1.5. Memory The programs and data must be in the main memory to be used by the CPU. The main memory is the only large storage area that the CPU can access directly. Memory of a computer is measured in Megabytes. The three basic types of memory used in a computer are Cache Memory, Random Access Memory (RAM) and Read Only Memory (ROM) . Cache Memory The CPU contains a small amount of internal memory to keep data temporally for its immediate computations. This memory is called Level 1 cache. If the data required by the CPU is not in Level 1 cache, the Level 2 cache is searched. The Level 2 cache is situated typically outside the processor chip. The advantage of cache memory over normal RAM is that the cache can be searched quicker than the normal RAM. Random Access Memory (RAM) RAM or the main memory is the computers short-term memory that temporarily holds data and instructions, which will be needed shortly by the CPU. Data and instructions can be stored and retrieved from anywhere in the RAM, and the time taken for such operations is approximately the same irrespective of the locations they are stored in the RAM. RAM is volatile, which means that it loses its data when the computer is turned off. RAM is supplied in modules; small circuit boards which can be plugged into the motherboard in special sockets. Read Only Memory (ROM) A type of data storage device, which is manufactured with fixed contents. ROM is also known as firmware. ROM is non-volatile storage in contrast to RAM. It retains its contents even when the power is switched off. ROM stores critical programs such as the program that boots the computer. In addition, ROM is used extensively in calculators and peripheral devices such as laser printers. 1.6. Secondary Storage Secondary or auxiliary storage devices are used to store large volumes of information more permanently. They can be used as input and output devices. There are many types of secondary storage devices. Hard Disks A hard disk drive is a device housed inside the computer, on which data is stored for later retrieval. Most computers will have at least one hard disk. A hard disk consists of multiple disk "platters" (magnetic surfaces) on which data is Figure 1.14 - Drive Physical and Logical Organization Faculty of Information Technology-University of Moratuwa

ddadad

Computer Fundamentals electronically written. Data can be written or read from the hard disk. These surfaces on which data is written are usually sealed inside a drive (casing), to prevent contamination and moisture. Hard disks are considered the most reliable method of storage. Hard disk storage capacities range from a few hundred megabytes to many gigabytes. The speed of a hard drive is measured in terms of average access time, the speed at which the hard drive finds data. The average access time is measured in milliseconds (1/1000 of a second). While hard disk drives are usually installed inside the system unit of the computer, there also are portable hard drives that can be connected to the computer externally. Such hard drives are useful as they can be used to transfer large quantities of data between different computers. Floppy Disk A floppy disk or a diskette is a round flat removable piece of plastic plate coated with a Ferric Oxide layer, and encased in a protective plastic cover, called the disk jacket. The Ferric Oxide layer is capable of holding a magnetic field. Data is stored on a floppy disk by means of a disk drive, which alters the magnetic orientation of the particles in the Ferric Oxide layer. Reading data from a diskette means that the data stored as a magnetic pattern on a diskette is converted to electronic signals and transmitted to the memory of the computer. Writing data on a diskette means electronic information is transformed into magnetic patterns and recorded magnetically on the diskette. Floppy disks are made to be removable and easy to carry. They are more sensitive and unreliable than hard disks. Floppy disks are also slower than hard disks and the storage capacity is typically 1.44 megabytes.

Year Introduced 1970s 1973 1976 1980

Physical Size (in inches) 8 8 5.25 5.25 3.5

Evolution of Diskettes R/W Maximum Capability Capacity R 100 Kilobytes R/W 250 Kilobytes R/W 100 Kilobytes R/W 1.2 Megabytes R/W 1.44 Megabytes Table 1.3 - Evolution of Diskettes

Number of sides used Single Double Single Double Double

Zip disks and Jaz disks These disks are very similar to floppy disks except that they can be used to store large amounts of data. Zip disk capacities range from 100 to 750 MB and Jaz disks come in 1 & 2 GB capacities. Both these disks are removable and portable and provide much better performance than floppy disks.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals Magneto optical disk Magneto optical disk drives use a combination of a laser, to heat the surface of the disk, and a magnetic head, to record data. While these disks are high performance, they are expensive. Magneto optical disks have capacities ranging from 128 MB to several gigabytes. Magnetic Tape Magnetic tapes are similar to audiotapes and store data in a serial manner (i.e. data is stored one after the other on the tape). These tapes can store large amounts of data but are primarily used for backup purposes because the access speeds are slow. CD/ DVD A compact disc is a plastic disc where data is optically written on its surface. The data written on the disc is read using a CD-ROM drive which uses lasers for this purpose. Usually once the data has been written (or burnt) on to the CD, it is not possible to change it, hence Read Only Memory. The faster the CDROM drive can read a CD, the faster the computer will be able to get data from the CD. Digital Versatile Discs (DVD) use a similar concept to CDs except that they are able to use multiple surfaces on a single disc and so can be used to store larger amounts of data. A typical CD can store 650 to 700 MB of data while a DVD can store from 2GB to 8 GB of data. Some CDs are re-writeable. To write to a CD, a drive called CD Writer must be used. Formatting Hard disks and Diskettes must be formatted before saving data on them. Formatting can be considered as an initialization process that prepares the disk or diskette electronically so that it can store data or programs. 1.7. Data Hierarchy Data in storage can be organized into a hierarchy of categories. Character : a single letter, number or a special character. Field : Typically, a sequence of characters. Record : Collection of related fields File : Collection of related records Databases : Collection of interrelated files.

1.8. Input Devices Input devices enable data to be fed into the computer in a form that the computer can use. Input devices are categorized into two types: keyboard entry devices and direct entry devices. A device through which data can be entered to the computer by pressing keys is called a keyboard entry device whereas all the other types of input devices are called direct entry devices.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals Keyboard The keyboard is the most commonly used input device and has been used since computers were first introduced. They are intelligent devices and contain their own chips. Each key is a switch, which closes when that particular key is pressed. The microprocessor scans the keyboard hundreds of times a second to see if a key has been pressed; if it has, a code that corresponds to that key is sent to the Processing Unit. The CPU then translates this code into the ASCII code (the code that computers use to represent characters on the computer keyboard), which is then used by the computer program. Mouse A mouse is another popular input device that forms an essential part of a computer system. Its movements on the desktop are translated into digital information, which in turn is fed to the computer, causing the cursor to move on the screen. Underneath the mouse there is a ball which rotates when the mouse is moved by the user and sensors pick up this movement. A mouse usually has two or three buttons, and these are used to make selections on the screen. The Mouse is classified as a pointing device. Joysticks, Touch Screens and Light Pens are a few other examples for pointing devices. A newer type of mouse is the optical mouse. An optical mouse uses a light-emitting diode (LED), an optical sensor, and a digital signal processing (DSP) in place of the traditional mouse ball and electro-mechanical transducer. Movement is detected by sensing changes in reflected light, rather than by interpreting the motion of a rolling sphere.

Figure 1.15 Mice Microphone A microphone can be used to record sound into a computer. Microphones are also used for voice communication through a computer, for example, for making telephone calls through a computer. Camera Digital Cameras store the images digitally rather than on film. Digital still cameras can be connected to a computer and the pictures taken on them can be transferred while digital motion cameras or web cams can be used to create video and for video conferencing purposes.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals

Figure 1.16 Digital Camera

Scanner Scanners are input devices normally used to scan text or pictures. The scans are then stored in a computers memory where they can then be accessed and modified using a desktop publishing package, before being printed. Both black and white, and colour scanners are available. Optical character recognition (OCR) is where the text on a page is scanned and then converted and fed into a word processing package so that it can be modified according to the needs of the user. Scanners often come with OCR software. OCR software may not recognize certain characters, be they handwritten, typed fonts or symbols. Figure 1.17 Scanner

Other Devices A variety of devices exist which allow people to input different kinds of information into a computer. Some such devices are: Fingerprint reader - Used to capture a fingerprint of a person into the computer Magnetic Ink Character Recognition (MICR) - Used to recognize characters printed in special ink. e.g. on cheques Environment Sensors - Movement, Temperature, Humidity, etc., can be monitored through a computer using these devices.

1.9. Output Devices Output devices translate information processed by the computer into a form that either humans or other machines can understand. There are a variety of output devices, which can be connected to a computer. Some of the common output devices are explained in the following sections.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals Monitor The most common form of output is the computer screen. It is more correctly called the monitor and sometimes referred to as the visual display unit or VDU. The quality of a computer monitor is based on the following properties: Resolution: Resolution is the number of pixels, which the screen can display. A pixel is the picture element and refers to the smallest area of the screen that the computer can change. The number of colours it can display (dependent on the computer as well) Radiation output. Different types of display screens CRT monitor A cathode-ray tube and associated electronics connected to the video output of a computer. These have higher resolution than TVs. Larger monitors with high resolution are used for specialised application such as desktop publishing and CAD. Liquid crystal display (LCD) LCDs are screens made from two glass/plastic plates with liquid in between. LCDs are commonly used for calculators and laptop computers, as they are far flatter than is possible with cathode ray screens used in TVs and standard computer monitors. :

Main differences of LCDs as compared with CRT monitors are Take s very little space Small energy consumption Sharp pictures Figure1.18- CRT/LCD No flicker or geometric distortion Monitors Fairly expensive Limited viewing angle Slower response time

Printers Many different types of printer are in use today. Two primary technologies used for printing are impact printing and non-impact printing. Impact Printers use a print head containing a number of metal pins which strike an inked ribbon placed between the print head and the paper. The non-impact printers are much quieter than impact printers as their printing heads do not strike the paper. Three most common printer types are: Dot matrix printers, Inkjet printers and Laser printers.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals

Dot matrix printers - These printers work by firing a matrix of tiny pins (which are located in the print head), through a ribbon similar to that found on a typewriter. Such printers are cheap and have the lowest running cost compared to any other type of printer. As the head moves across the paper the correct pins are fired out to hit an inked ribbon and form the shape of the character required. The greater the number of pins, the higher the quality of the print. Dot matrix printers are impact printers and are used to print multipart stationery. So to print several copies of a document at the same Figure 1.19 Dot time you will need to use a dot matrix Matrix printer. Inkjet printers - Inkjet printers can produce high quality text and graphics. They are quieter than dot matrix printers. The technology involves ink flowing through the appropriate nozzles (usually an array of 64) where it is then heated and a bubble is formed. This expands to release a tiny droplet of ink onto the paper.

in

Figure 1.20 -Inkjet

Laser printers

Figure 1.20 Laser printer and its functionality These non-impact printers offer high-speed printing and an excellent quality of text and graphics. A laser beam is used to form an image on a rotating, charged metal drum. This then picks up toner from the toner cartridge and transfers it onto paper. Very soon afterwards heat and pressure are applied so the toner sticks to the paper. Since they are page printers they are

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals very fast. Colour laser printers are now available and are mainly used for desktop publishing. Although they are expensive, they are likely eventually to come into widespread use. Speakers / Headphones Speakers or headphones may be used to get sound output from a computer. There are different types of speakers ranging from simple speakers, which provide simple sound to speakers, which can provide theatre-like surround sound.

Figure 1.21 Speakers and Headphones 1.10. Device Drivers Virtually every hardware component located inside or connected externally to a computer requires associated software component to enable that hardware to communicate and function with the operating system, other applications and other hardware components of the computer. This software component is referred to as driver software of that hardware component. Until you install the proper software derive for a hardware component that hardware component remains logically isolated from the rest of the components of the computer.

Software Software refers to instructions which are used by the computer to perform various tasks. The word programme is synonymous with software. Software is created with programming languages and related utilities. Software is generally classified into two types: system software and application software. Application Programs Utilities Operating System Physical Devices

Abstract view of the Components of a computer system

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals 1.11. System Software System software is responsible for controlling, integrating and managing the individual hardware components of a computer system so that other software and the users of the system see it as a functional unit without having to be concerned with the low-level details of the computer hardware. System software can be further classified as: Operating Systems Utilities and Service Programs Operating Systems (OS) The Operating System manages the resources and the basic operations of the computer. Without an operating system the computer would not work. The operating system (or a part of it) is loaded into the main memory when the computer is switched on and handles many tasks, which we are unaware of when we use the computer. A part of the operating system remains in main memory until the computer is turned off. There are several operating systems used with personal computers such as Windows 98, Windows XP, Linux and Mac OS. Different operating systems are designed for different hardware platforms or for different functions. Operating systems may provide different types of user interfaces such as Command Line Interface and Graphical User Interface (GUI). In the command line interface, users communicate with the operating system by typing commands using the keyboard. One of the main disadvantages of the command line interface is that the user has to memorize the commands exactly. The graphical user interface was first developed for Apple Macintosh Computers. In the graphical user interface, a user invokes a command by means of graphical objects shown on the screen and the system translates the user actions to the operating system commands and executes them on behalf of the user. The general-purpose operating systems are typically supplied on CD-ROMs and must be installed before using the computer. Some computers such as hand held computers come with pre-installed operating systems on the computers ROM. Such operating systems provide only limited capabilities and are virtually impossible to be upgraded. Utilities and Service Programs Another category of software is utility software, which is a collection of useful programs that enhance the capabilities of the operating systems. These software programmes are designed to perform various tasks. Some examples of utility software are Norton Utilities and Download Accelerator. 1.12. Application Software Application software is designed to perform useful general-purpose tasks. For example, an application program called Solitaire is a single program that lets you play a card game. Application software can be grouped as customized software or as application packages. Customized software is generally designed for a particular customer whereas application packages are off the shelf programmes designed for the general public.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals

Common types of application software are: Word Processing Spreadsheet Database Management System Presentation Software Desktop Publishing and Graphic Design Web Design and Development

1.13. Booting the Computer The process of loading the operating system into the computers main memory from the hard disc, floppy disk or CD is called booting. A programme known as the boot routine or bootstrap loader is in change of the booting process and this boot routine is stored permanently in the computers electronic circuitry, typical in ROM. Another series of programmes which start up prior to the booting process are the diagnostic routines. These programs test the main memory, the CPU and other parts of the system to make sure that they are running properly.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals System Start up Process

Figure 1.22 System Start up procedure

When you switch on a computer it automatically loads a program called the Basic Input/Output System (BIOS). The BIOS is stored on a special chip on the computers motherboard. As it runs, it performs a number of essential tests on the computer hardware. These tests are called Power On Self Test (POST). 1.14. Software Evaluation Software evaluation is the process of checking the software for suitability for the required function. The major steps involved in software evaluation are: Identify clearly the problem or application for which the software is required. Inspect the manual or instructions supplied with the software. o Is the manual clearly written? o Does it explain the main functions of the software? o Does it provide examples? Input/Output Interfaces o Do the input and output of the software meet your requirements? Test the system with your own data sets to see its performance. Reliability o Is the system consistent? - Does it give consistent answers to similar or the same problems?

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals User Friendliness o User interface is easy to use. o Error messages are clear. o Time periods to wait between successive screens are acceptable. Adaptability: To what extent the original problem be has to be modified without affecting the functionality of the software. Information Networks

1.15.

Data Communications Data Communication is the process of moving information from one point to another by means of some transmission system. Network A network is a collection of entities that exchange information or good. Few examples of networks are railway system, nervous system of animals, telephone system. Communications network A communications network is a system of interconnected computers, and communication devices that can communicate with one another and share resources. At the most elementary level, a computer network consists of two computers connected with each other by a cable to allow them to share data. A device connected to a network is called a node. A node may be a device such as a computer, a printer, workstation etc. Advantages of Networks Networks offer several advantages over stand along systems. Some of these advantages are listed below: Sharing of peripheral devices: Expensive resources can be shared by connecting them to the network. Sharing of programs and data: Some programs may be expensive, and it may not be possible to purchase multiple copies. Such programs can be shared over a network. Better communications: Networks can be used to establish communication such as email. Access to databases: Users can access numerous databases by making them available on the network. Common Network Elements The different types of components that you can find in a network are: Servers: Computers that provide shared resources to the network users Clients: Computers that access shared network resources provided by the users Communication Media: The media through which data is being transmitted. Network Operating system: Software that manages the activities of a network Shared resources: Any service or resource made available for use by the members of the network. Modem: used to connect a computer to another computer over phone lines. Hub: A hub can be thought of as a junction box, permitting new computers to be connected to a network as easily as plugging a power cord into an electrical socket. Hubs are commonly available in 4, 8, 16 port sizes, enabling anywhere from 4 to 16 network devices to be plugged into a network. There is no need to connect all the ports

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals of a hub to network devices simultaneously. When no cables are plugged in, the signals bypass the unused ports. Some hubs have an additional interface port that connects to another hub, increasing the size of the network.

Switch: An enhanced version of the hub. Typically a switch can distribute the communication load so all the computers connected to the switch can communicate effectively.

1.16. Network Topologies Networks can be laid out in a number of different ways. The physical layout of a network is called its topology. The basic network topologies are star, ring, and bus. These basic topologies can be combined in a variety of ways to build complex hybrid network topologies. The decision on the best network structure required for an organization depends on its budgetary restrictions, types of resources to be connected and the productivity needs.

Star Topology In a star network all computers and other communications devices are connected to a central point such as a hub, file server or a host computer.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals Ring Topology

In a ring network all communications devices are connected in a continuous ring. Messages are passed around the ring until they reach the right destination. Bus Topology In a bus network communications devices are connected to a common channel. There is no central computer and the communications devices transmit messages to the other devices.

1.17. Communication Media The communication media is the matter or substance that carries the voice or data. Many different types of transmission media are currently in use. All these different media types can be grouped into two categories: guided media and radiated media. The Guided media are those in which the data flows through physical media and the radiated media are those in which the data is broadcast through the air.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals

Guided Media Twisted-pair wire

A twisted-pair wire consists of two insulated copper wires, twisted around each other and covered in another layer of plastic insulation Coaxial cable

A Coaxial cable consists of insulated copper wire wrapped in a metal shield, which is then wrapped in an outer external cover. Often many coaxial cables are bundled together. Fiber-Optical Cable: consists of hundreds of thin glass wires that transmit pulsation beams of light.

Radiated Media Radio Transmission: Radio transmission use the same basic principle as standard radio transmission. When using radio transmission each device/computer on the network should equipped with a radio transmitter/receiver on a specific frequency that does not interfere with commercial radio stations. The transmitters are very low power and are designed typically to transmit a signal to a very short distance, typically up to 500 feet.

Infrared Transmission: Infrared transmission uses low-frequency light wave, below the visible spectrum, to transmit data through the air. Infrared transmitters are seldom used to transmit data to and from portable or handheld computers.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals Microwave Transmission: Microwave is a high-frequency beam with short wave length. Microwave can be transmitted over a direct line-of-sight path between any two points. This transmission medium is typically used for long-distance data/voice transmission. Satellite Transmission: In satellite transmission, singles are transmitted to a satellite 500 to 22,000 miles is space. One disadvantage of satellite transmission is the delay that occurs in transmission, which is known as the propagation delay.

1.18. Data Transmission Types In a network data can be transmitted in two different ways, serial transmission and in parallel transmission. Serial Data Transmission: Bits are transmitted sequentially, one after the other. Parallel Data Transmission: Bits are transmitted through separate channels simultaneously. The standard unit of measure used to specify the speed of the data flow through a network is bits per second (bps). 1.19. Network Interface Card (NIC)

A network Interface Card provides the physical connection between the computer and a network cable and enables access to a network. Most modern computers come with NIC cards pre-installed, and ready to be connected to networks.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals

1.20. Types of Networks There are two primary types of networks. Local Area Networks (LAN): LAN is a communication network that serves users within a confined geographical area. Private parties generally own LANs and their effective range is limited. Wide Area Networks (WAN): WAN is a communications network that has no geographical limit. A WAN may span hundreds or thousands of miles. In general, a WAN is made up of a number of interconnected LANs. WANs can use either analog (telephone lines) or digital signals or a combination of both. WANs may be privately owned by large organizations or may be public.

Types of LAN Local area networks are of two types: client server and peer-to-peer. A Client server LAN consists of devices that provide services called servers, and devices that request services from servers, called clients. Typically servers are the devices that manage shared devices such as printers. In a peer-to-peer LAN there is no server, instead all devices communicate directly with each other. Peer-to-Peer Networks. Peer-to-peer networks are also called workgroups. In a peer-to-peer network there is no hierarchy among the computers. Typically the number of computers in a peer-to-peer network would be less than 10. All the computers in the network are treated equal and are referred to as peers. Each computer may function as a client and a server and there is no central administrator to manage the entire network. The users at each computer determine what data on his computer should be shared with the other peers.

Backbone Network Components A backbone network is a network that connects many networks in a single site. Router: A router is a special device that enables the connection of two or more networks so that the computers in different networks can communicate with each other. A router may be a special device, a computer with several network interface cards or a special network module in a computer or other network device. Routers also allow a network to be segmented into smaller logical networks or subnets. Bridge: A Bridge is an interface that enables similar networks to communicate. Gateway: A Gateway is an interface that enables dissimilar networks to communicate. 1.21. Network Protocols A network protocol is an agreement on how to converse. The four most commonly used network protocols are TCP/IP, IPX/SPX, X.25 and SNA. Each protocol performs essentially the same functions, but each protocol is incompatible with others unless there is a special device to translate between them.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals TPC/IP Network Addressing TCP/IP protocol uses 3 different types of addressing to move data between computers: physical, logical and port addresses. The physical addresses (MAC addresses) are utilized to move data within a single LAN, logical addresses (IP addresses) are used to move data from one LAN to another LAN across the network and the port address is used to transmit data to the intended application. MAC addresses burned into hardware. IP address is a 32-bit value. This means that there are four billion different IP address possibilities. IP addresses may be set in software and are thus flexible. An IP address contains the address of the device itself as well as the address of the network on which the device is located. Therefore, if a device is moved from one network to a different network, the IP address of the device must be changed. IP addresses are hierarchical addresses like phone numbers and zip codes. They provide a better way to organize computer addresses like social security numbers. The International network information centre (InterNIC) assigns to companies blocks of IP addresses based on the size of their networks.

How to Determine your IP Address? Go to the start menu and select Run.... Then type cmd in the box and click OK.

At the C:\> prompt type ipconfig. Then press Enter. Your IP address, subnet mask and default gateway will be printed on the window.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals

If you want more detailed information about your network connection, type ipconfig /all at the prompt. Here you can get additional information about your IP configuration.

1.22. Computer Virus A computer virus is a program or piece of code designed to hide in the background and to perform one or more of the following activities Replicate itself Attach to other programs or instructions Perform unintended actions

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals A program needs not to perform outright damage in order to be called a Virus. In fact some virus programs do not cause any damage to the computer. One of the most costly types of damage that a virus can cause is the modification of the accuracy of data. For example, a virus may replace certain digits in a spreadsheet with other digits. These types of damage are not easy to detect immediately. Another embarrassing effect of some viruses is the disclosure of confidential documents to Internet websites and e-mail users. Until all instances of an affected virus are deleted, the virus maintains the capability of self-replication and the process may start all over again. A virus needs a "host" - the particular hardware and software environment on which it can run. When an infected program is executed, the embedded virus is executed too, thus propagating the "infection" without the knowledge of the user. Computer viruses are designed to attach to many files or disks without being detected and to cause damage to data held on the affected computer. Some viruses also slow down a users system, disable certain functions, or cause erratic system behaviour. Computer viruses often infect many programs on the same system or even parts of the operating system. Users can unknowingly transmit a virus from one system to another by copying infected program files from one machine to another or by using an infected program downloaded from the Internet. Currently there are more than 14,000 known viruses. The first common computer virus, called Brain virus, was written in 1986 by two brothers in Pakistan. The majority of viruses are written by hackers. Some of the known viruses and their effects are given below. SCOLD.A : Send simple e-mails. CAP : One effect of CAP is that all documents are saved in the Word DOC format, regardless of the format you choose. For example, if a document is saved as an RTF file, the extension of the document will become RTF but internally the file is still a DOC. Nimda : Nimda is a complex virus with a mass mailing worm component which spreads itself in attachments named README.EXE. Blaster : Every 17th day of each month, the virus checks for existence of "c:\minny.log" file. If the file does not exist, the virus appends several commands to the end of the "c:\autoexec.bat". These commands attempt to remove everything from "C:", "D:", "E:" and "F:" drives when the system is restarted. Jerusalem : This is one of the oldest and most common viruses around. It will infect both .EXE and .COM files. Jerusalem activates on every Friday the 13th, deleting programs run on that day. 30 minutes after an infected program is run, the virus will also cause a general slowdown of the computer and make a part of the screen scroll up two lines. Arab : The virus counts programs being executed on an infected system. When the counter exceeds 256 the virus makes the hard disk unbootable Bin Laden : This virus does not have a destructive effect. After starting, it sometimes displays a message. Some of the main reasons for writing viruses are; Hacking To prevent copying software Revenge : Employees may plant Time Bombs in programs Fraud : Viruses may allow access to an otherwise secure system

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals Political and terrorist motives Commercial sabotage : Damage the reputation of a competitor Warfare : Incorporate a virus to an enemys computer.

Viruses can be transmitted from one system to another through various media types such as; Floppy disks Tape backups Internet Software Virus Symptoms Some of the symptoms that a computer will show up when infected with a virus are listed below. Programs take long time to load than normal. Computer's hard drive constantly runs out of free space. The floppy disk drive or hard drive runs when you are not using it. New files keep appearing on the system and you don not know where they came from. Strange sounds or beeping noises come from the computer or keyboard. Strange graphics are displayed on your computer monitor. Files have strange names you do not recognize. Unable to access the hard drive when booting from the floppy drive. Program sizes keep changing. Conventional memory is less than it used to be and you cannot explain it. Programs act erratically." Components of a Virus A virus comprises of four general components The replicator (or engine): replicates the virus. The safeguard : prevents the detection and the removal of the virus The trigger monitor : Monitors for a specific condition to deliver payload. These specific conditions may be the arrival of a particular date, time, keyboard stroke, etc. The payload : the action it does apart from propagation. This action may be an amusing action or malicious action resulting in distraction from the current work or destruction of data. 1.23. Main Phases of Virus Activity The main phases a virus generally follows are; Gains access to the system Lies dormant Propagates Virus is triggered by some event Virus Action Main Types of Virus There are three main types of viruses

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals Boot Virus File Virus Macro Virus

Boot Virus Boot virus infects the boot sector of the hard disk and is activated every time the computer is switched on. Once infected, the computer may fail to start properly. Usually boot viruses spread from the boot sectors in floppy diskettes to the boot sector of the hard disk. When you start up the system with an infected diskette in the diskette drive, the virus transfers from the diskette to the boot sector of the hard disk. Once infected, the virus may remain in the main memory and infect other diskettes.

File Virus (Parasitic Virus) File viruses are virus programs attached to executable files. They become active every time the program is executed Macro Virus A macro is a collection of application specific instructions coded to automate some manual process such as formatting a word document. Macro Viruses are either complete macros or macro segments embedded as parts of legitimate macros. They may come straight from the software manufacturers original disks. Once a computer is infected with a macro virus the following actions may result. Unusual messages Unknown macros listed in macros list Save data in unintended formats Lost data 1.24. How to Protect a Computer from Computer Viruses There are many ways of preventing a computer from virus attack. Some of these precautions are listed below. Verbal Warning Use of anti-virus software Avoiding the use of unchecked disks Avoiding the use of unauthorized or unchecked software Write protecting all standard software Use only CD-ROM versions of software whenever possible Using firewalls Anti-virus Software. Anti-virus software contains anti-virus scanners, which look for viruses. These anti-virus scanners work by searching for fingerprints: short patterns, usually 16 bytes, recognized to exist in virus programs. There are two types of virus scanners; On-access scanners: automatically check the hard disk and diskette each time the system starts up.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals On-demand scanners: Executes only on users demand and can be scheduled to run at various times Most commercial anti-virus software provides both types of scanners. It will take some time for an anti-virus software designer to get to know about a new type of virus and to write software to detect it. Therefore anti-virus software gets out of date very often. Firewalls A computer generally has many ports (think of them as doorways), which allow external programs to access the computer. Hackers use programs to automatically detect vulnerabilities in the computer and gain access to the computer by using this weak access points. Firewall protection secures these ports so that no malicious programs can sneak into your machine. Firewall software can also be used to check whether files downloaded from the Internet follow a defined security protocol and free of viruses. Trojan Horse A program that performs unsolicited actions. However, they do not replicate and neither do they attach to other programs. 1.25. Internet The Internet is a network of autonomous computer networks that spans the globe. It provides an infrastructure for global electronic information exchange. Today the Internet is used by millions of people to facilitate various activities such as business, education and plain communication. The Internet grew out of a United States Department of Defense project, the ARPANET (Advanced Research Project Agency Network) started in late 1960s. Its main objective was to provide network links between universities, research organizations and remote computer centers. No person, government or an entity owns or controls the Internet. Instead, a nongovernmental international volunteer organization called the Internet Society (ISOC) controls the standards and the future of the Internet. The following figure shows how the Internet is structured. At the bottom level are the organizations and home uses connected to the Internet. Typically users connect to the Internet through local Internet Service Providers (ISPs). The ISPs are in turn connected to the Internet Backbone through regional networks. Typically ISPs lease high-bandwidth lines that connect into the Internet and rent

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals that bandwidth to Internet users.

ISPs Computer

Typically a home user (client) connects to the Internet via telephone lines. If the telephone network is analog a modem is needed in between the computer and the telephone line to convert digital signals generated by the computer to analog signals that are being transmitted by the telephone network. When a client registers with an ISP for Internet usage he will get an account. To access the Internet by using this account, the client has to dial the ISP and log on to this account. Once logged on, he can access the Internet. On the Internet information is available mainly through three mediums: the World Wide Web (WWW), Usenet News (News) and Electronic Mail (e-mail). The WWW is built on top of the Internet. It can be viewed as a large notice board with posters and printed notices stuck to it. On the WWW Web servers provide information on the Internet. A user can access the information provided by web browsers by using a web browser. Types of resource available on the Internet. Different types of resources are available on the Internet. Some of the common types of information available on the Internet are: Different types of information such as text, sounds, pictures, and short movie clips. Information at all levels -- storybooks and games for children, university course materials, business information, fine art, and lots of things that are just plain fun. Actual business information -- including electronic shopping malls. Games that you can play alone or with other people all over the world. Programs to help you find the information that you want.

1.26. Internet Browsers The information in the WWW is viewed using a Browser such as Netscape Navigator or Microsoft Internet Explorer. A browser will provide several means of navigating or finding your way around the WWW. It will also provide the means of displaying various resources

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals found on the Internet, from HTML hypertext web pages to pictures, sounds and movies. Often the browser requires helper or plug-in programs to display a particular type of resource, such as QuickTime and Shockwave. Microsoft Internet Explorer

The window above can be resized and moved by dragging the edge of the window. Note that the contents re-arrange themselves to fit the new window size. At the top of the window is a toolbar of useful shortcuts such as go back a page, go home, reload a page, print a page or stop loading a page. All of these commands and other less common ones are also available in the menus. Below the toolbar is the address bar telling you where this page is stored, which will be explained in the section on URLs. Scroll bars let you move up and down a page if it will not all fit on the screen at once. The status indicator in the upper right corner animates to show when a transfer is in progress. If the icon is changing, then the system is trying to get something for you -just be patient. The status message field (along the very bottom of the window) shows you information about a targeted page or a transfer in progress. The progress bar (behind the status message field) fills with colours as a file is being transferred. This helps you to tell how much longer you have to wait before you get the entire file.

1.27. What is an URL? To understand how a singe page is kept distinct from millions of other pages available on the web, you should learn to recognize its URL (short for Uniform Resource Locator). Every page on the Web can by uniquely identified by using its URL. An URL is simply a collection of text segments that identifies an item in a computer network. You can retrieve a page by typing its URL in the Location field of the browser and pressing Enter (or by using Open Page... in the File menu). Here is an example of a typical URL:

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals http://www.ucsc.cmb.ac.lk/centre/csc/index.htm Within the URL text are components that specify the protocol (the format that Netscape can expect the information to be in), the server (the computer that holds the item), and the path name of the item. Component Meaning

A colon follows the protocol. Many Internet pages use http (short for HyperText Transfer Protocol). You might also come The protocol across ftp (another way used to transfer files), news (the protocol used by the Usenet news groups), and Gopher (a e.g. http: protocol that was briefly popular, but then supplanted by Netscape-type products). The server identifies the computer system that stores the The server information you see. Each server on the Internet has a unique e.g. address. You can often tell what country the server is in by its //www.ucsc.cmb.ac.lk address. The server name is preceded by two slashes. The path name identifies the location of an item on the server. Each segment of a path name is preceded by a single slash. The path name This path name usually tells you the name of the file e.g. containing the page, as well as the names of the folders and /centre/csc/index.htm sub-folders that store the file. For example, in this URL the index.html page is stored in the csc folder that is stored in the centre folder. Navigation Simply clicking on links to go to a new page and finding what links are on that page can do most of the navigation in the WWW. There are also several useful navigation commands in the Go menu on the toolbar. Following Links You can tell a link by looking at the mouse cursor. When the mouse cursor moves over a link, it turns into a hand. If you click once at this point, the new page will load. Links are normally any highlighted word(s) or picture(s), but can also be an area within a special type of picture called an image map. When you point the cursor (which is now a hand) over a highlighted link, the status field at the bottom of the window displays the location (URL) of the targeted page (i.e. the page that will load when you click the mouse button). History and the address bar If you click on the arrow on the address bar, you will see a list of web page titles. This is a history of the pages that you have recently visited. Your browser maintains this list automatically. To revisit an item on the list, simply choose that item. Note that the title of a page can be very terse and uninformative. This sometimes makes it a challenge to figure out where you have been. Occasionally Web pages will fall off the history list.

The Back command in the Go menu lets you go back down the list to re-visit a page you have looked at before this one. The Forward command moves up the list towards to the most recent page.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals

The Home command will take you back to the "home" page for these machines, i.e. the page that you saw when you first started your browser. Note that there are toolbar shortcuts for Back, Forward and Home. The Stop Loading command is particularly useful. If you have clicked on a link and it's taking too long to load in the new page, then click on Stop to end the transmission.

As you go from one page to another, notice changes in The Location field (showing the network location of the page on screen), The Netscape symbol status indicator (animated when a transfer is in progress), The Status message field at the bottom left of the screen (showing the network location of a page you can bring or the completion status of a transfer), and The Progress bar at the bottom of the screen (illustrating the progress of a transfer). What happens if the page requested is not in there? If you try to go to a page that is not there, or you have typed in an incorrect URL for a page, then you will receive a message saying that the file was missing. This is called "Error 404 File not found" and when you get this error, simply press the Go Back button to take you back to where you came from. If you have typed the name of the server incorrect, or the server machine is not currently working then you will see a different message, possibly like "Error 204 DNS Name Lookup Failure." Again, press the Go Back button to take you back. Try this by clicking on a link to a miss-spelt server, such as http://ww.ucsc.cmb.lk Printing When you print, the Browser rearranges the page to try to fit it on the paper, no matter the size of the window you view the page on the screen. All images on a page are also printed out. To print the contents of the current page, choose Print from the File menu or press the Print button in the toolbar. A Print dialogue box lets you select printing options and begin printing. 1.28. Resources Found on the WWW The following sections explain the different types of resources that you can find on the WWW. Pictures and Graphics There are two standard picture formats used in the Web, JPG and GIF. JPG, or jpeg, files are normally used for pictures and GIF files are normally used for graphics and drawings. Netscape will normally try to load every picture that is in a web page, and if the picture is missing or "broken". When this happens, you will see an icon like .

Retrieving Images You can retrieve inline or external images from a page to insert into a word processor or other application. To retrieve an image, click with the right mouse button on the image. If you want to save the image for later use then you should select Save Image as... and the computer will ask you where you want to save the picture. You could then load the image into Word or PowerPoint, or a graphics program.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals

Sounds The browser can also be used to play various sound clips. These can range from short sound clips of people, sound samples from the movies or TV, or even whole songs. These are just a few, there are many thousands of sound clips available on the Internet if you can find them, and then there are large number of midi files, MP3 files and radio stations that your browser can tune. Movies So far you've seen text, viewed images, and heard sound files. The Internet also contains brief videos that you can see, stored as QuickTime (Macintosh) or AVI (IBM compatible) format movies. They have to be brief, because each movie takes up large amount of storage space. 1.29. Internet Glossary Browser Any computer software, such as Netscape Navigator or Microsoft Internet Explorer that can be used to view documents on the Internet. Web browsers interpret the HTML computer language and display Web text and images. Not all Web browsers interpret HTML the same way. Thus, the exact file may display differently when viewed on different Web browsers. Browsers are often referred to as "client software." Client Any computer linked to Internet and capable of receiving information from a server. Domain The top-level identifier for a particular Internet server (e.g., yahoo.com). Domains are of various types and they are categorized by one or more extensions. Users often can learn much about an Internet site by studying its domain name. Domain Type .com .edu .int .gov .mil .net .org What it Means a commercial business, organization, or company an educational institution an international organization a nonmilitary government entity a military organization a network administration, often Internet-related other organizations: nonprofit, nonacademic

.uk, .au, ca, jp, nz, etc. country codes denoting servers found in other countries FTP The abbreviation for File Transfer Protocol, a method of transferring files from one computer to another via the Internet. Some Internet sites specialize in just this kind of transfer. Users can sign on to this type of server and copy files to their own computers. FTP servers usually require user Ids and passwords, or may allow you to log on via "anonymous ftp." HTML

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals HyperText Markup Language. The computer "language" of the World Wide Web, comprised of the coding, or tags, that indicate how text and images are to be displayed, as well as how documents and files are to be linked. HTML was developed at the European Particle Physics Laboratory in Switzerland, known by its French acronym CERN. HTTP HyperText Transfer Protocol. The basic computer rules and language that allow for the linking and transferring of Web pages and graphics.

HyperText The text and images that enable users to "jump" from one Web site or Web document to another. HyperText usually underlined and displayed in blue, while HyperText a blue border sometimes surrounds images. Modem A modem converts digital signals from your computer into audible tones that can be transmitted over regular analog phone lines. This conversion process is called Modulation. The modem on the other end then transfers those same audible tones back (or Demodulates) into its original digital signals. Proxy Server / Firewall A proxy server is a computer that provides access to the Internet. This computer gets requests from computers and provides those computers with the information from the Internet. The proxy server may also have a firewall, a tool that protects the internal computers from attacks through the Internet.

Search Engine An automated Web Site that uses advanced searching software to locate other Web Sites and Internet files based on search criteria entered by the user is called a Search Engine. Examples of such sites include Alta Vista, HotBot, Infoseek, and Lycos, though there are many others. Search Engines rely on automated programs, known as spiders or robots to index sites on the Internet according to keywords. No human evaluation is conducted to determine the relevancy of sites. Rather, the software relies on Boolean logic to deliver search results based on the occurrence of words or search terms entered by the user.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals Server A computer directly linked to the Internet that holds files ready for downloading by a "client" machine, such as a home PC is called a Server. Downloaded files are either viewed or copied by the client using "client software," such as a Web browser.

URL Uniform Resource Locator. The standard "address" format used by a server and the specific files that make up the document or Web Site. Web Site URLs always start "http://". World Wide Web That part of the Internet operating under the HTTP protocol and using the HTML language. It is usually referred to simply as "the Web." The Web is differentiated from Gopher and other text-only protocols by its "Graphic User Interface" (GUI) that allows the joining of text and images on individual Web pages. However, like the earlier Gopher Protocol, it is a menudriven system for retrieving and accessing information. Electronic Mail (e-mail) It can take days to send a letter across the country and weeks to go around the world. To save time and money, more and more people are using electronic mail. It's fast, easy and much cheaper than the using the post office. Today, e-mail has become the most popular service on the Internet. e-mail is an electronic message sent from one computer to another. Using this facility you can send or receive personal and business-related messages with attachments, such as pictures or formatted documents. You can even send music and computer programs.

Just as a letter makes stops at different postal stations along its way, e-mail passes from one computer, known as a mail server, to another as it travels over the Internet. Once it arrives at the destination mail server, it is stored in an electronic mailbox until the recipient retrieves it. This whole process can take seconds, allowing you to quickly communicate with people around the world at any time of the day or night. Sending and Receiving e-mail Messages To receive e-mail, you must have an account on a mail server. This is similar to having an address where you receive letters. One advantage over regular mail is that you can

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals retrieve your e-mail from anywhere location. Once you connect to your mail server, you download your messages to your computer. To send e-mail, you need a connection to the Internet and access to a mail server that forwards your mail. The standard protocol used for sending Internet e-mail is called SMTP, short for Simple Mail Transfer Protocol. It works in conjunction with POP servers. POP stands for Post Office Protocol. When you send an e-mail message, your computer routes it to an SMTP server. The server looks at the e-mail address (similar to the address on an envelope), then forwards it to the recipient's mail server, where it is stored until the addressee retrieves it. You can send e-mail anywhere in the world to anyone who has an e-mail address. Remember, almost all Internet service providers and all major online services offer at least one e-mail address with every account. E-mail messages are similar to letters, with two main parts: Header Body The header contains the name and address of the recipient, the name and address of anyone who is being copied, and the subject of the message. Some e-mail programs also display your name and address and the date of the message. The body contains the message itself. Just like when sending a letter, you need the correct address. If you use the wrong address or mistype it, your message will bounce back to you. When you receive an e-mail, the header tells you where it came from, how it was sent, and when. It's like an electronic postmark.

Open your e-mail program and launch a new message window by clicking on the appropriate icon. In the TO box, type the name of the recipient. It should take this form: recipient@domain.com. Make sure you enter the address correctly or the message will return to you.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals You can send a message to more than one person by entering multiple addresses. Just put a semicolon (;) between each address. Your return address is automatically sent to the recipient. Type the subject of the e-mail Write your message in the message window. You can also copy text from a word processing program and paste it into the window. Click on the Send icon or select Send from the File menu.

Email Addresses An Internet e-mail address typically has many parts: First there is the user name that refers to the recipient's mailbox Then there is an at sign (@) Next comes the host name also called the domain name. This refers to the mail server, the computer where the recipient has an electronic mailbox. It is usually the name of a company or organization. The end of the domain name consists of a dot (".") followed by three or more letters (such as .com and .gov) that indicate the top-level domain (TLD). This part of the domain name indicates the type of organization or the country where the host server is located.

Example : president@whitehouse.gov

Privacy Unlike a letter, which is sealed in an envelope, e-mail is not as private. It's more like a post card. Messages can be intercepted and read by people who really shouldn't be looking at it. Avoid including any confidential information unless you have a way to encrypt it. Attachments

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals

Sending Attachments You can send formatted documents, photos, sound and video files as attachments with your e-mail messages. The procedure for attaching files varies depending on the type of e-mail program you use. In general, you click on an icon, such as a paper clip, located on the toolbar of the program. You then select the file you want to attach by locating it on your hard drive or on disk. Once you've selected the file, either its name will appear as part of the e-mail header, or as an icon within the body of your message. Most programs allow you to attach multiple files.

Webmail With a Web-based e-mail account, you can read or send mail from any computer connected to the Net, anywhere on earth. Another benefit of Web-based e-mail is that you can keep the same address for life. Once you have an account, even if you change companies or switch Internet service providers, the address remains yours.

Faculty of Information Technology-University of Moratuwa

Computer Fundamentals With Web-based e-mail, to send and receive messages, you access a website, so all you need is Internet access and a web browser. Here's how to access your e-mail:

First, log on to the website by entering your account name and password. Now you can read your messages, send replies, forward messages, and send and view attachments. Most Webmail services offer online address books to store your e-mail addresses and contact information. You can also set up folders to manage your messages. Setting Up an Account Establishing a new e-mail account takes only a few minutes. You'll have to provide information about yourself and choose an account name and password. Your account name or ID becomes part of your e-mail address. If you open a Hotmail account and choose "wiseguy" as your ID, your address becomes "wiseguy@hotmail.com." Account names can use letters and numbers, such as "professor2000," can't contain any spaces, and are limited in length, depending on the service. Hundreds of websites now offer free Web-based e-mail. Few examples of popular Webmail providers are Hotmail, Yahoo. Since there are many Webmail providers how do you decide which one to go with? Think about this: We expect the postal service to deliver our letters reliably every day and we trust it to keep our communications private. As you come to depend more on e-mail for business and personal communications, having reliable, trustworthy access is critical. You will have to evaluate each service on its track record.

Faculty of Information Technology-University of Moratuwa

Mathematics for Computing

Unit 2 Mathematics for Computing


2.1 Number systems

A number system defines a set of values used to represent quantity. We talk about the number of people attending class, the number of modules taken per student, and also use numbers to represent grades achieved by students in tests. Quantifying values and items in relation to each other is helpful for us to make sense of our environment. We do this at an early age; figuring out if we have more toys to play with, more presents and so on. The study of number systems is not just limited to computers. We apply numbers every day, and knowing how numbers work will give us an insight into how a computer manipulates and stores numbers. The Romans devised a number system, which could represent all the numbers from 1 to 1,000,000 using only seven symbols

I=1 V=5 X = 10 L = 50 C = 100 D = 500 M = 1000

The number system in most common use today is the Arabic system. It was first developed by the Hindus and was used as early as the 3rd century BC. The introduction of the symbol 0, used to indicate the positional value of digits was very important. We thus became familiar with the concept of groups of units, tens of units, hundreds of units, thousands of units and so on. In number systems, its often helpful to think of recurring sets , where a set of values is repeated over and over again. Considering the decimal number system, it has a set of values, which range from 0 to 9. This basic set is repeated over and over, creating large numbers.

Faculty of Information Technology - University of Moratuwa

58

Mathematics for Computing

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Figure 2.1

Note how the set of values 0 to 9 is repeated, and for each repeat, the column to the left is incremented (from 0 to 1, then 2). Each increase in value occurs, till the value of the largest number in the set is reached (9), at which stage the next value is the smallest in the set (0) and a new value is generated in the left column (i.e., the next value after 9 is 10).

Vertical Repetition

Basic set 0-9 Horizontal Repetition

09, 10 - 19, 20 - 29, 30 -39 etc We always write the digit with the largest value on the left of the number Base Values The base value of a number system is the number of different values the set has before repeating itself. For example, decimal has a base of ten values, 0 to 9.

Binary = 2 (0, 1) Octal = 8 (0 - 7) Decimal = 10 (0 - 9) Hexadecimal = 16 (0 - 9, A-F)

Faculty of Information Technology - University of Moratuwa

59

Mathematics for Computing

Weighting Factor The weighting factor is the multiplier value applied to each column position of the number. For instance, decimal has a weighting factor of TEN, in that each column to the left indicates a multiplication value increase of 10 over the previous column on the right, i.e.; each column move to the left increases in a multiply factor of 10. 312 = 300 + 10 + 2 = 3 * 100 + 1 * 10 + 2 * 1 = 3 * 102 + 1 * 101 + 2 * 100

Weighting factors 2.2 Decimal system [Base-10]

This number system uses TEN different symbols to represent values. The set values used in decimal are 0123456789 With 0 having the least value and nine having the greatest value. The digit or column on the left has the greatest value, whilst the digit on the right has the least value. When doing a calculation, if the highest digit (9) is exceeded, a carry occurs which is transferred to the next column (to the left). Example of addition and exceeding the base set range 8+4 8 9 +1 10 +2 Note 1: 11 +3 12 +4 Note1: When 9 is exceeded, we go back to the beginning of the set (0), and carry a value of 1 over to the next column on the left. Another example of addition and exceeding the base set range 198 + 4 198 199 +1 200 +2 Note 2: 201 +3 202 +4 Note2: When 9 is exceeded, we go back to the beginning of the set (0), and carry a value of 1 over to the next column on the left. Thus the middle column (9) has 1 added to it, the next value in the set is 0, and we carry 1 (because the set was

Faculty of Information Technology - University of Moratuwa

60

Mathematics for Computing

exceeded) to the next left column. Adding the carry value of 1 to 1 in the left most column gives. Positional Values [Units, Tens, Hundreds, Thousands etc Columns] We probably got taught at school about positional values, in that columns represent powers of 10. This is expressed to us as columns of ones (0 - 9), tens (groups of 10), hundreds (groups of 100) and so on. 237 = (2 groups of 100) + (3 groups of 10) + (7 groups of 1) = (100 + 100) + (10 + 10 + 10) + (1 + 1 + 1 + 1 + 1 + 1 + 1) = (200) + (30) + (7) = 237 Each column move to the left is 10 times the previous value. 2.3 Binary system [Base-2] The binary number system uses TWO values to represent numbers. The values are,

0 1

With 0 having the least value, and 1 having the greatest value. Columns are used in the same way as in the decimal system, in that the left most column is used to represent the greatest value. As we have seen in the decimal system, the values in the set (0 and 1) repeat, in both the vertical and horizontal directions. 00 01 10 11 100 101 110 111 In a computer, a binary bit.

Note: go to value lowest in set, carry to left Note: go to value lowest in set, carry to left Note: go to value lowest in set, carry to left variable capable of storing a binary value (0 or 1) is called a

In the decimal system, columns represented multiplication values of 10. That was because there were 10 values (0 - 9) in the set. In this binary system, there are only two values (0 - 1) in the set, so columns represent multiplication values of 2. 1011 = ---- 1 * 20 = 1 ----- 1 * 21 = 2 ------ 0 * 22 = 0 ------- 1 * 23 = 8 ---11 (in decimal)

Faculty of Information Technology - University of Moratuwa

61

Mathematics for Computing

Using n bits we can represented 2n number of binary values. e.g. If n = 8, then number of different values = 28 = 256

Rules for Binary Addition Operation Result 0+0 0+ 1 1+0 1+1 0 1 1 0 and Carry 1 Table 2.3-1 1011 + 101 = 1011 101 1. Start at the right most column and apply the rules. 2. 1 + 1 is 0 and carry 1 onto the next column on the left 1011 101 -----0 and carry 1 Which really looks like 1011 101 1 -----0 3. Now consider the second column 4. 1 + 0 + 1 = ( 1 + 0 ) + 1 = 1 + 1 = 0, carry 1 onto the next column on the left 1011 101 1 -----00 and carry 1

Faculty of Information Technology - University of Moratuwa

62

Mathematics for Computing

Which really looks like 1011 111 1 -----00 5. Now consider the third column 6. 0 + 1 + 1 = ( 0 + 1 ) + 1 = 1 + 1 = 0, carry 1 onto the next column on the left 1011 111 1 -----000 and carry 1 Which really looks like 1011 111 1 -----000 7. Now consider the last column on the left 8. 1 + 1 is 0 and carry 1 to the left. 1011 101 -----10000

Rules for Binary Subtraction Operation Result 0-0 0-1 1-0 1-1 0 1 and borrow 1 1 0 Table 2.3-2

Faculty of Information Technology - University of Moratuwa

63

Mathematics for Computing

Rules for Binary Multiplication Operation Result 0*0 0*1 1*0 1*1 0 0 0 1

Table 2.3-3

Conversion from Decimal to Binary Example: consider the decimal number 254. Method 1: Divide the number by 2, then divide remainder by 2, and so on until remainder equal zero. Write down the remainder (which is either 0 or 1) at each division stage. Once there are no more divisions, list the remainder values in reverse order. This is the binary equivalent. Example 1 254 / 2 127 / 2 63 / 2 31 / 2 15 / 2 7/2 3/2 1/2

giving 127 with a remainder of 0 giving 63 with a remainder of 1 giving 31 with a remainder of 1 giving 15 with a remainder of 1 giving 7 with a remainder of 1 giving 3 with a remainder of 1 giving 1 with a remainder of 1 giving 0 with a remainder of 1

LSB

MSB

Thus the binary equivalent is 11111110

Example 2 132 / 2 66 / 2 33 / 2 16 / 2 8/2 4/2 2/2 1/2

giving 66 with a remainder of 0 giving 33 with a remainder of 0 giving 16 with a remainder of 1 giving 8 with a remainder of 0 giving 4 with a remainder of 0 giving 2 with a remainder of 0 giving 1 with a remainder of 0 giving 0 with a remainder of 1

thus the binary equivalent is 10000100 Conversion from Decimal to Binary Each column represents a power of 2, so use this as a basis of calculating the number. It is sometimes referred to as the 8:4:2:1 approach.

Faculty of Information Technology - University of Moratuwa

64

Mathematics for Computing

Write down the binary number. Where a 1 appears in the column, add the column value as a power of 2 to a total. Weighting 8 4 2 1 Answer 11

Binary Value 1 0 1 1 Table 2.3-4 Weighting

8 4 2 1 Answer 7

Binary Value 0 1 1 1 Table 2.3-5

Weighting 32 16 8 4 2 1 Answer Binary Value 1 1 1 0 1 1 Table 2.3-6 Weighting 32 16 8 4 2 1 Answer Binary Value 1 0 1 0 1 0 Table 2.3-7 Usually, binary numbers are represented with the suffix 2. e.g.: 1001112 2.4 Octal Number System [Base-8] 42 59

The octal number system uses EIGHT values to represent numbers. The 8 distinct values are, 01234567 With 0 having the least value and seven are having the greatest value. Columns are used in the same way as in the decimal system, in that the left most column is used to represent the greatest value. As we have seen in the decimal system, the values in the set (0 and 1) repeat, in both the vertical and horizontal directions. 0 - 7, 10 -17, 20 - 27, 30 - 37 ...... Octal numbers are represented with a suffix 8 e.g.: 1768

Faculty of Information Technology - University of Moratuwa

65

Mathematics for Computing

Conversion from Octal to Decimal: Problem: Convert 1768 to decimal. Each column represents a power of 8, 176 = 1 * 82 + 7 * 81 + 6 * 80 = 1 * 64 + 7 * 8 + 6 * 1 = 64 + 56 + 6 = 126 Conversion from binary to Octal: Problem: Convert 10110111 to octal. Each octal digit is represented by 3 binary bits. Split the binary number into groups of 3 bits, starting from the right. 10 =2 110 111 =6 =7 =267 in octal

Conversion from decimal to octal: Problem: Convert 300 decimal to octal. Use the same method used earlier to divide decimal to binary, but divide by 8. 00 / 8 = 37 with a remainder of 4 37 / 8 = 4 with a remainder of 5 = 4548 2.5 Hexadecimal Number System [Base-16]

The hexadecimal number system uses SIXTEEN values to represent Numbers. The 16 distinct values are, 0 1 2 3 4 5 6 7 8 9 A B C D E F, where A = 10, B = 11, .., F = 15. With 0 having the least value and F having the greatest value. Columns are used in the same way as in the decimal system, in that the left most column is used to represent the greatest value. As we have seen in the decimal system, the values in the set repeat, in both the vertical and horizontal directions. 0 -- F 10 --1F 20 --2F 30 --3F Hexadecimal is often used to represent memory addresses in computer systems.

Faculty of Information Technology - University of Moratuwa

66

Mathematics for Computing

Decimal Binary Hexadecimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Table 2.5-1 Hexadecimal numbers are represented with the suffix 16. e.g.: 17616, A8C16,

0 1 2 3 4 5 6 7 8 9 A B C D E F

Conversion from hexadecimal to decimal: Problem: Convert 17616 in hexadecimal to decimal. Each column represents a power of 16, 176 = 1 * 162 + 7 * 161 + 6 * 160 = 1 * 256 + 7 * 16 + 6 * 1 = 256 + 112 + 6 = 374 Conversion from binary to hexadecimal: Problem: Convert 10110 to hexadecimal. Each hexadecimal digit represents 4 binary bits. Split the binary number into groups of 4 bits, starting from the right.

Faculty of Information Technology - University of Moratuwa

67

Mathematics for Computing

1 0110 =1 =6 =16 in hexadecimal

Conversion from decimal to hexadecimal: Convert 232 decimal to hexadecimal. Use the same method used earlier to divide decimal to binary, but divide by 16.

232 / 16 = 14 with a remainder of 8 14 / 16 = 0 with a remainder of E (14 decimal = E) = E816 2.6 Data Structures

Bits, Bytes, Nibbles and Word Length Bit A bit is the smallest element of information used by a computer? A bit holds ONE of TWO possible values, Value Meaning 0 1 OFF ON

Table 2.6-1 A bit which is OFF is also considered to be FALSE or NOT SET; a bit which is ON is also considered to be TRUE or SET. Because a single bit can only store two values, bits are combined together into large units in order to hold a greater range of values. Nibble A nibble is a group of FOUR bits. This gives a maximum number of 16 possible different values. 2 4 = 16 (2 to the power of the number of bits) It is useful, when dealing with groups of bits, to determine which bit of the group has the least value, and which bit has the most or greatest value. The Least Significant Bit AND The Most Significant BitThis is deemed to be bit 0, and is always drawn at the extreme right. The Most significant bit is always shown on the extreme left, and is the bit with the greatest value. The diagram below shows a NIBBLE, and each bits position and decimal weight value (for more information, consult the module on Number Systems).

Faculty of Information Technology - University of Moratuwa

68

Mathematics for Computing

2 1 0 Bit Number +---+---+---+---+ | | | | | +---+---+---+---+ 8 4 2 1 Decimal Weighting Value MSB LSB

Bytes Bytes are a grouping of 8 bits. This comprises TWO nibbles, as shown below. 7 6 5 4 3 2 1 0 Bit Number +---+---+---+---+---+---+---+---+ | | | | | | | | | +---+---+---+---+---+---+---+---+ 128 64 32 16 8 4 2 1 Decimal Weighting Value MSB LSB Bytes are often used to store CHARACTERS. They can also be used to store numeric values, 0 to 255 or +127 to -128 Words () 2.7 ASCII, BCD and EBCDIC Codes

ASCII (The American Standard Code for Information Interchange) ASCII is a computer code which uses 128 different encoding combinations of a group of seven bits (27 = 128) to represent,

characters A to Z, both upper and lower case special characters, < . ? : etc numbers 0 to 9 special control codes used for device control

Faculty of Information Technology - University of Moratuwa

69

Mathematics for Computing

Lets now look at the encoding method. The table below shows the bit combinations required for each character.

Table 2.7-1 A computer usually stores information in eight bits. The eighth bit is unused in ASCII, thus is normally set to 0. Some systems may use the eight bit to implement graphics or different language symbols, i.e., Greek characters. Control codes are used in communications and printers. They may be generated from an ASCII keyboard by holding down the CTRL (control) key and pressing another key (A to Z, plus {, \, ], ^, <- ). Example Code the text string 'Hello.' in ASCII using hexadecimal digits. H = 48 e = 65 l = 6C l = 6C o = 6F . = 2E

Faculty of Information Technology - University of Moratuwa

70

Mathematics for Computing

thus the string is represented by the byte sequence 48 65 6C 6C 6F 2E 2.8 BCD (Binary Coded Decimal)

In this code structure, each of the decimal digits (0-9) is represented by a four-bit binary code as illustrated in Table 2.8-1. Recall that with 4 bits the number of unique representations is 24=16. Thus there are 6 invalid four-bit combinations for the BDC code. Decimal 0 1 2 3 4 5 6 7 8 9 BCD 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 Invalid Combinations 1010 1011 1100 1101 1110 1111 Table 2.8-1

Converting decimal to BCD:

Faculty of Information Technology - University of Moratuwa

71

Mathematics for Computing

A) 546 10 B) 23.8 10 C) 5139 10

A) 5 = 0101, 4 = 0100, 6=0110 thus 546 = (010101000110) BCD B) 23.8 = (00100011.1000) BCD C) 5139 = (0101000100111001) BCD Converting BCD codes to decimal: To convert BCD codes to decimal, break the binary digits into groups of four starting from the binary point and convert each group into its appropriate BCD digit. A) 001110000111 B) 01100111.0100 A) (001110000111) BCD = 0011 1000 0111 = (387) 10 B) (01100111.0100) BCD = 0110 0111. 0100 =(67.4) 10 2.9 EBCDIC (Extended Binary Coded Decimal Interchange Code)

Alphanumeric characters are stored in a computer using a character-encoding system known as a collating sequence, where one or two bytes represents a given character. The two single-byte character-encoding systems that are most widely used in data processing are ASCII and EBCDIC. IBM mainframe computers use the EBCDIC system. The EBCDIC system can be used to represent 256 different characters. Each character is assigned a unique hexadecimal value between 00 and FF. EBCDIC Code: Commonly Used Characters Hex '40'x '4B' '4E' '60' '81' '82' Character Hex Character Hex Character Hex Character space . + a b '95' '96' '97' '98' '99' 'A2' n o p q r s 'C4' 'C5' 'C6' 'C7' 'C8' 'C9' D E F G H I 'E3' 'E4' 'E5' 'E6' 'E7' 'E8' T U V W X Y

Faculty of Information Technology - University of Moratuwa

72

Mathematics for Computing

'83' '84' '85' '86' '87' '88' '89' '91' '92' '93' '94'

c d e f g h i j k l m

'A3' 'A4' 'A5' 'A6' 'A7' 'A8' 'A9' 'C0' 'C1' 'C2' 'C3'

t u v w x y z { A B C

'D0' 'D1' 'D2' 'D3' 'D4' 'D5' 'D6' 'D7' 'D8' 'D9' 'E2'

} J K L M N O P Q R S

'E9' 'F0' 'F1' 'F2' 'F3' 'F4' 'F5' 'F6' 'F7' 'F8' 'F9'

Z 0 1 2 3 4 5 6 7 8 9

Table 2.9-1

2.10 Boolean Algebra The most obvious way to simplify Boolean expressions is to manipulate them in the same way as normal algebraic expressions are manipulated. With regards to logic relations in digital forms, a set of rules for symbolic manipulation is needed in order to solve for the unknowns. A set of rules formulated by the English mathematician George Boole describe certain propositions whose outcome would be either true or false. With regard to digital logic, these rules are used to describe circuits whose state can be either, 1 (true) or 0 (false). In order to fully understand this, the relation between the AND gate, OR gate and NOT gate operations should be appreciated. OR operation: The OR operation says if any input is on, the output will be on. It's easy to see all of the combinations by using what are called truth tables, illustrated below. Input 1 0 0 1 1 AND operation: Input 2 0 1 0 1 Output 0 1 1 1

Faculty of Information Technology - University of Moratuwa

73

Mathematics for Computing

The AND operation says if and only if all inputs are on, the output will be on. The output will be off if any of the inputs are off. Input 1 0 0 1 1 NOT operation: The inverter or NOT operation, says that the output will be opposite in state to the input. It obviously has only one input and one output. Note that it will change an AND to a NAND, an OR to a NOR and an XOR to a NXOR if connected to their outputs. It simply changes 1s to 0s and 0s to 1s. Input 1 0 1 Output 1 0 Input 2 0 1 0 1 Output 0 0 0 1

2.11 Basic Laws and Axioms of Boolean algebra Note that every law has two expressions, (a) and (b). This is known as duality. These are obtained by changing every AND (.) to OR (+), every OR (+) to AND (.) and all 1's to 0's and vice-versa. It has become conventional to drop the. (AND symbol) i.e. A.B is written as AB. T1 : Commutative Law (a) A + B = B + A (b) A B = B A T2 : Associate Law (a) (A + B) + C = A + (B + C) (b) (A B) C = A (B C) T3 : Distributive Law (a) A (B + C) = A B + A C (b) A + (B C) = (A + B) (A + C) T4 : Identity Law (a) A + A = A (b) A A = A T5 : (a) (b) T6 : Redundancy Law

Faculty of Information Technology - University of Moratuwa

74

Mathematics for Computing

(a) A + A B = A (b) A (A + B) = A T7 : (a) 0 + A = A (b) 0 A = 0 T8 : (a) 1 + A = 1 (b) 1 A = A T9 : (a) (b) T10 : (a) (b) T11 : De Morgan's Theorem (a) (b)

2.12 Truth Tables A truth table shows how a logic circuit's output responds to various combinations of the inputs, using logic 1 for true and logic 0 for false. All permutations of the inputs are listed on the left, and the output of the circuit is listed on the right. The desired output can be achieved by a combination of logic gates. A truth table for two inputs is shown, but it can be extended to any number of inputs. The input columns are usually constructed in the order of binary counting with a number of bits equal to the number of inputs. Truth Table for AND Gate X 0 0 1 1 Y 0 1 0 1 Output 0 0 0 1

AND OR NOT Operations .. (Insert from previous document) Boolean Expressions (Insert from previous document)

Faculty of Information Technology - University of Moratuwa

75

Mathematics for Computing

2.13 Logic Gates and Circuits Gates and simple circuits The term Gate is used to describe the members of a set of basic electronic components which, when combined with each other, are able to perform complex logical and arithmetic operations. 'Gates' are the physical realization of the simple Boolean expressions. Electronic circuits which combine digital signals according to the Boolean algebra are referred to as logic gates; gates because they control the flow of information.

Example logic circuits


Gate Symbol Truth Table

Faculty of Information Technology - University of Moratuwa

76

Mathematics for Computing

Design logic circuit for Boolean expression A B + CD = F In this example A,B,C,D are inputs and F is out put
B Can be represent with A B expression having AND logic, we can take A B = P

CD expression also having AND logic, we can take CD = Q

Then final expression would be in form of P+Q = F, This has OR logic

Therefore we can design final circuit for the Boolean expression A B + CD = F as

Faculty of Information Technology - University of Moratuwa

77

Mathematics for Computing

2.14 Exercises Decimal to Binary Conversion:


I. II. III. IV. V. VI. VII. VIII.

254 127 8 10 13 20 1 64

Answers:
I. II. III. IV. V. VI. VII. VIII.

11111110 1111111 1000 1010 1101 10100 0001 1000000

Binary to Decimal Conversion :


I. II. III. IV. V. VI. VII. VIII.

0011 00101 0111 11111 0101 0000 01001 101000

Answers:
I. II. III. IV. V. VI. VII. VIII.

3 5 7 31 5 0 9 40

Binary Addition, Subtraction and Multiplication :

Faculty of Information Technology - University of Moratuwa

78

Mathematics for Computing


I. II. III. IV. V. VI. VII. VIII. IX. X. XI. XII.

1011 + 100 010 + 1010 11 + 1001 101 + 1 100 - 11 11001 - 100 1110 - 10 10111 111 111 * 11 101001 * 101 100 * 11 1100 * 010

Answers:
I. II. III. IV. V. VI. VII. VIII. IX. X. XI. XII.

1111 1100 1100 110 01 10101 1100 10000 10101 11001101 1100 11000

Octal to Decimal Conversion :


I. II. III. IV.

74 123 2510 10101010

Answers:
I. II. III. IV.

60 83 1352 2130440

Decimal to Octal Conversion :


I. II. III. IV.

100 2546 24 986

Faculty of Information Technology - University of Moratuwa

79

Mathematics for Computing

Answers:
I. II. III. IV.

144 4762 30 1732

Binary to Octal Conversion :


V. VI. VII. VIII.

1111111111 10001 1010101 10111111000001

Answers:
V. VI. VII. VIII.

1777 21 125 27701

Hexadecimal to Decimal Conversion :


IX. X. XI. XII. XIII. XIV. XV. XVI.

A4 123 EDB 25F0 A0E5 10101010 12346 0111000

Answers:
IX. X. XI. XII. XIII. XIV. XV. XVI.

164 291 3803 9712 41189 269488144 74566 78

Binary to Hexadecimal Conversion :


I. 10010110 II. 100001101101 III. 101001111101011101010001101100

Faculty of Information Technology - University of Moratuwa

80

Mathematics for Computing


IV. 1111000

Answers:
I. II. III. IV.

96 86D 29F5D46C 78

Hexadecimal to Binary Conversion :


I. II. III. IV.

2F A45 12346 B60

Answers:
I. II. III. IV.

101111 101001000101 10010001101000110 101101100000

Decimal to Hexadecimal Conversion :


I. II. III. IV.

2000 75 382 11873

Answers:
I. II. III. IV.

7D0 4B 17E 2E61

ASCII i. Represent the statement X=25/Y in ASCII code

Answers: i. (88)(61)(50)(53)(47)(89) numbers are in decimal format.

Faculty of Information Technology - University of Moratuwa

81

Mathematics for Computing

Logic Gates

Answer: (i) A .B + A.B A 0 0 1 1 B 0 1 0 1 Out 1 0 0 1

(ii) A .B + A.B A 0 0 1 1 B 0 1 0 1 Out 1 0 1 0

Boolean Logic

Faculty of Information Technology - University of Moratuwa

82

Mathematics for Computing

Construct Logic circuits for the following Boolean expressions (i) A .B + A.B (ii) A. B + A.B .C Answer: (i)

(ii)

Faculty of Information Technology - University of Moratuwa

83

Information Systems

Unit 3:Information Systems

3.1.

What is a System?

A system is a collection of interrelated components that work together to perform a specific task. In a system the different components are connected with each other and they are interdependent. Each component is a subsystem of the original system and carries out part of the system task. For example, the human body represents a complete natural system. Our human bodies contain complex muscle, bone, digestive, and circulatory subsystems. A business organization is another example. This system has manufacturing, marketing, and administrative departments or subsystems and they coordinate with other subsystems to promote the business. Subsystems are important because they can help to handle systems complexity and thus improve the understanding of a system. 3.2. Elements of a System A system interacts with the external world or the environment. The system boundary separates the system from its environment. Basically there are three major components in every system, namely, input, processing and output. Input Processing Figure 3.1 Input Processing and Output A system receives inputs from its environment and return outputs to the environment after processing the inputs within the system to form outputs. Since components are connected within a system, output of one subsystem may be an input to another. A good system will be made up of highly independent subsystems with minimal flows between them. Output

Faculty of Information Technology - University of Moratuwa

84

Information Systems

3.3.

Information Systems

Data versus Information Data are raw facts about the organization and its business transactions. Information is data that has been refined and organized by processing and purposeful intelligence.

What is an Information System? An information system is an arrangement of people, data, processes, interfaces, networks and technology that are integrated for the purpose of supporting and improving the day-to-day operations in a business, as well as fulfilling the problem-solving and decision-making information needs of business managers. An information system can be a manual information system or a computer based information system. Manual Information Systems of a File storage devices, manual procedures and papers are the vital components manual information system. The advantages of a manual information system are The manual information system is flexible. In a manual information system, the judgments and decisions can be taken easily with the help of the guidance of human beings. The disadvantages of a manual information system are Human beings are unreliable. The human mind is slow in performing arithmetic operations The humans are subjected to fatigue and boredom. Computer-based Information Systems Computer-based information systems can replace manual information systems. In this text, our primary concern is on computer-based information systems. A computer-based information system involves six interdependent components: hardware (machines), software (instructions or programs), people (programmers, managers, or users), procedures (rules), data and information.

Faculty of Information Technology - University of Moratuwa

85

Information Systems

3.4.

Types of Information Systems

Levels of Management There are number of types of information systems corresponding to various levels of management. The three traditional levels of management are 1) Lower or Operational Management 2) Middle or Tactical Management 3) Upper or Top or Strategic Management Each level of management can be distinguished by the types of decisions made, the time frame considered in the decisions, and the types of report information needed to make decisions. Figure 3.2 shows the levels of management in an organization.

Strategic Tactical

Set Goals Arrange Resources Carry out Tasks

Operational

Figure 3.2 - Levels of Management Lower Management Level The detailed tasks defined by the middle management are carried out by the people at the operational level. Most decisions at this level require easily defined information that relates to the current status and activities within the basic business functions. This information is generally given to lower management in detail reports. Detail reports contain specific information about routine activities. Managers at this level typically make structured decisions. A structured decision, also called an operational decision, is a predictable decision that can be made by following a well-defined set of routine procedures. Middle Management Level The middle or tactical management level must acquire and arrange the resources to meet the goals, and define the detailed tasks to be carried out at the operational level. These resources are the people, machines, buildings and computers needed to accomplish the goals.

Faculty of Information Technology - University of Moratuwa

86

Information Systems

The information that middle managers need involves review, summarization, and analysis of data to help plan and control operations and implement policy that has been formulated by upper management. This information is usually given to middle managers in the form of summary reports and exception reports. Managers at the middle level generally deal with semi-structured decisions. A semistructured decision or a tactical decision is a decision that must be made without a base of clearly defined informational procedures. In most cases, a semi-structured decision is complex, requiring detailed analysis and extensive computations. . Upper Management Level The people at the upper or top or strategic management level decide on the broad objectives for an organization. Upper management typically makes unstructured decisions. An unstructured decision, or strategic decision is the most complex type of decision that managers are faced with. Because these decisions are rarely based on predetermined routine procedures, they involve the subjective judgment of the decision maker. Types of Information Systems 1) 2) 3) 4) 5) Management uses several basic types of information systems: Transaction Processing Systems (TPS) Management Information Systems (MIS) Decision Support Systems (DSS) Executive Information Systems (EIS) Expert Systems (ES)

Transaction Processing Systems (TPS) Transaction processing systems are information system applications that capture and process data about (or for) business transaction. They are some time called Data Processing Systems (DPS). A TPS is focused at the operational level of a business. The management information produced by transaction processing systems usually consists of detail reports of daily transactions or future transactions. The reports generated by a TPS are useful only to lower level managers. A TPS usually operates only within one functional area of a business. As an xample, in an organization each department, marketing, accounting and finance, production, and research and development has its own TPS. Management Information Systems (MIS) A Management Information System is an information system application that provides middle management with reports that summarize and categorize information derived from all the company databases, usually in a predetermined fixed format.

Faculty of Information Technology - University of Moratuwa

87

Information Systems

Management information systems supplement transaction processing systems. MIS can present detailed information, summary information and exception information. MIS produce information based on accepted management or mathematical/statistical models. Decision Support Systems (DSS) A decision support system is an information system application that provides its users with decision-oriented information whenever a decision-making situation arises. A DSS does not typically make decision or solve problems. Decision support systems are concerned with providing useful information to support the decision process. A DSS analyze the information already been captured by a TPSs and MISs in order to support unstructured decisions making at top management level. (TPSs and MISs do not analyze the information they produce.). Unstructured decisions are those decision making situations that cannot be predicted in advance. Executive Information Systems (EIS) An executive information system is a DSS made especially for top managers and specifically supports strategic decision making. An EIS is also called an Executive Support System (ESS). It draws on data not only from systems internal to the organization but also from those outside, such as news services and market-research databases. Expert Systems (ES) An expert system is an information system captures the knowledge and expertise of a problem solver or decision maker and then simulates the thinking of that expert for those who have less expertise. Expert systems imitate the logic and reasoning of the experts within their respective fields. Expert systems have emerged from the field of artificial intelligence, which is a branch of Computer Science that is attempting to create computer systems that simulate human reasoning and sensation.

3.5.

Systems Development Life Cycle (SDLC)

Introduction Every system has a life cycle, like that the human beings, plants or a product. A System Development Life Cycle (SDLC) is an organizational process of developing an information system to solve business problems and needs.

Faculty of Information Technology - University of Moratuwa

88

Information Systems

SDLC means combination of various activities. In other words we can say that various activities put together are referred as SDLC. These various activities are called phases of the SDLC. Following are the different phases of the SDLC: 1. 2. 3. 4. 5. 6. 7. 8. Problem Definition Feasibility Study System Analysis System Design Software Development Testing Implementation Maintenance

SDLC is also known as Classic Life Cycle Model, Linear Sequential Model or Water Fall Model.

Systems Analyst Systems Analyst is the person who facilitates the development of information systems and computer applications. Analyst must have the ability to listen; assess situations and draw conclusions; possess a strong general business orientation; speak and write effectively; prepare clear, concise reports; and work well with others to gain their respect and confidence. 3.6. Phases of the SDLC

Phase 1: Problem Definition This phase provides a broad statement of user requirements, in user world terms - or what the user expect the system do - and thus sets the direction for the whole project. This phase also sets the project bounds, which define what part of the system can be changed by the project and what parts are to remain the same. The resources to be made available to the system are also specified in this phase. Phase 2: Feasibility Study After committee conduct a economically a problem has been defined in the problem phase, the selection of the organization requests the information system department to a feasibility study to determine whether a project is technically and feasible.

Faculty of Information Technology - University of Moratuwa

89

Information Systems

The feasibility study determines the best method of achieve the objectives of new information system that would solve the problems. The outcome of the feasibility study is the recommendation of a new system proposal. This new information system proposal is to be sanctioned by the higher management in consultation with department managers. Phase 3: System Analysis In this phase, the systems analysts study the existing system in detail, leading to specifications of a new system. This study is carried out by gathering data using following tools: 1) 2) 3) 4) by inspecting written documents by conducting interviews, by questionnaires on site observations

Gathered data must be then analyzed and documented in the form of data flow diagrams (DFD), data dictionary (list of terms and their definitions), logical data structures and miniature specifications. System analysis also includes sub-division of the entire system into smaller sub-processes. When all the systems requirements have been identified, the systems analyst produce a detailed report on the specifications of the new system. Phase 4: System Design This phase produces a logical design specification for the new system. During this phase, the analyst schedules design activities, works with the user to determine the various data inputs to the system, plan how data will flow through the system, designs required outputs, and writes program specifications. During this phase, analysts employ a variety of tools such as data flow diagrams, data dictionaries, and the Gantt chart (a graph depicting design events, personnel assignments, and time schedules). During design, the analyst: Draws a model of the new system, using data flow diagrams (DFD) and entity-relationship (ER) diagrams. Devises formats for all the reports that the system will generate. Develops a method for collecting and/or inputting data. Defines the detailed data requirements with a data dictionary. Writes program specifications. Specifies control techniques for the systems outputs, database, and inputs.

Faculty of Information Technology - University of Moratuwa

90

Information Systems

Identifies and orders any hardware or software that the system will need.

By the end of the logical design phase, the analyst has prepared complete systems specifications in the form of a detailed report, with step-by-step instructions that describes the proposed system. Phase 5: Software Development The design specifications are converted into source code of a programming language. The programmers are responsible for carrying out activity. The software, which is to be developed, is divided in to many modules according the sub-divisions in phase 3. The modules can be developed independently and then are to be tested individually. This type of testing is called unit testing. The test data are framed in such a manner as would ensure the entire modules be tested.

to

can

Phase 6: Testing Before actually implementing the new system into operation, developed system is to be test in order to remove all the bugs. Two types of tests are conducted. These are as follows: 1) Integration Testing After completion of unit tests of all the modules, the modules are to be combined and be tested. At this stage the test is done on actual data. 2) Acceptance Testing Acceptance criteria is the agreement made between the user and the system developer. The acceptance criteria contains a list of important requirements that the system has to satisfy. The tests conducted to check the acceptance criteria are called acceptance testing. Phase 7: Implementation After having the user acceptance of the new system developed, the implementation phase begins. This stage also involves two activities as follows: The user training The users are to be given training for operating a new information system. Main topics of such type of training are: 2. How to execute the package How to enter the data How to process the data (processing details) How to take out the reports 1.

The conversion

Faculty of Information Technology - University of Moratuwa

91

Information Systems

The process of replacing an existing system with a new system is called conversion. Conversion of the system may proceeds in four ways: o Direct implementation: The entire system is replaced with the new system in one go. o Parallel implementation: Both systems, i.e., the new and the old systems are executed in parallel for a certain defined period of time. This strategy is helpful because of the following:

Results of the old system can be compared with the results of the new system. Failure of the new system at the early stage, does not affect the working of the organization, because the old system continues to work, as it used to do.

o Phased implementation: The new system is introduced in phased manner. o Pilot implementation: In this implementation, the new system is installed in parts. Some part of the new system is installed first and executed successfully for considerable time period. When the results are found satisfactory then only other parts are implemented. This strategy builds the confidence and the errors are traced easily. Phase 8: Maintenance Maintenance is necessary to eliminate errors in the system during its working life and to tune the system to any variations in its working environment. It has been seen that there are always some errors found in the system that must be noted and corrected. It also means the review of the system from time to time. The review of the system is done for:

knowing the full capabilities of the system knowing the required changes or the additional requirements studying the performance

to life

If a major change to a system is needed, a new project may have to be set up carry out the change. The new project will then proceed through all the above cycle phases.

Problems in Systems Development The following are generally recognized as possible problems in systems development: Estimating cost and time Selecting a project team Capturing user requirements Using standards Choosing design approaches Coding programs

Faculty of Information Technology - University of Moratuwa

92

Information Systems

Testing programs Maintaining systems

References 1. Whitten, J. L. and Bentley, L. D., Systems Analysis and Design Methods, 5th Edition, 2000, McGrew-Hill. Edwards, P., Systems Analysis and Design, 1993, McGrew-Hill.

2.

3. Hawryszkiewycz,. I., Systems Analysis and Design, 4th Edition, 2000, PrenticeHall of India Private Limited.

Faculty of Information Technology - University of Moratuwa

93

Introduction to Programming Language

Unit 4. Introduction to Programming Languages


Many tools exist for building a house; likewise many tools are available for creating or writing software. Those tools include different types of programming languages used to write detailed set of instructions to the computer. Programming Languages provide the basic building blocks for all systems and applications software. Programming Languages allow people to tell computers what to do and are the means by which software systems developed. There are many different programming languages, just like there are many languages spoken in the world. Like human languages all have verbs, nouns and adjectives, programming languages too, have similarities like variables, and subroutines. It is these building blocks that are basic to computer programming in any language that it is important to learn. Unlike human languages, with computer languages, once you learn one, it is much easier to learn the next and the next. This chapter will teach you the basics of computer programming. You will learn to write programs that do calculations, programs that store names and addresses and programs that are fun! 4.1. Generations of Programming Languages

People have been writing computer programs since general-purpose computers were first developed in the late 1940s. Programs are written in programming languages, of which Visual Basic, COBOL, and Java are common examples. The programming languages are said to be lower when they are closer in form Figure 4.1 to the language the computer itself usesthe binary system of 1s and 0s. They are called high level when they are closer to the language people use. The languages in each of the successive five generations represent an improvement over those of the prior generation. Languages of latter generations are easier to learn than the earlier ones. The early generation computer languages (first, second and third) require the use of more complex vocabulary and syntax to write programs. The term syntax refers to the precise rules and patterns required for the formation of the programming language sentences, or enclosed statements, that tell the computer to do and how to do it. It is convenient to group all the different programming languages (there are several hundred different languages in use around the world) into five distinct generations: 1. 2. 3. 4. 5. First generation programming languages Second generation programming languages Third generation programming languages Fourth generation programming languages Fifth generation programming languages

Faculty of Information Technology University of Moratuwa

94

Introduction to Programming Language

First generation languages: First generation programming languages were the machine languages used in the 1950s; programmers wishing to make a computer do something useful would code their instructions in binary ones and zeroes. The programs written in machine language are not needed to be translated before they can be run on the computer. The computer programs written in high level languages must be converted into machine language before they can be run on the computer. Machine language programs are considered machine dependant because machine-language instructions vary according to computer architecture. Second generation languages: Second-generation languages are the successor to machine language; they are generally known as assembly languages or assembler. Second generation languages are low-level languages in the sense that the programmer has to write one statement for each machine instruction. Assembly languages use symbol as abbreviations for major instructions instead of long combinations of binary digits. Thus, while programmer might conceptually think in terms of the statement X = Y + Z, programmer would have to translate the following statements into assembly language:

CLEAR ACCUMULATOR LOAD Y INTO ACCUMULATOR ADD Z TO CONTENTS OF ACCUMULATOR STORE ACCUMULATOR IN X Even this tiny example shows the major disadvantage of assembly language. Rather than being able to think in terms of the problem programmer wants to solve, the programmer must think in terms of the machine. Starting around 1960, more powerful languages began to be introduced; most programmers have long since abandoned assembly language. However, there are still a few situations where such languages are needed. Most of them involve very small, low-powered microprocessors (which can be manufactured very cheaply and which are small enough to fit, say, into a digital watch), for which the memory and CPU constraints are so severe that the programmer cannot afford the overhead usually associated with third generation languages.

Third generation languages: Third generation languages include COBOL, C, FORTRAN, Ada, and many others; we may also include some of the familiar object-oriented programming languages (OOPL's) such as C++ and Smalltalk in this category. They are high-level in the sense that a single statement (such as MOVE A TO B in COBOL) usually represents five or ten assembly language statements (and sometimes as many as a hundred statements); they are high-level in the more important sense that they allow the programmer to express thoughts in a form that is somewhat more compatible with the problem area in which she is working. However, they are low-level in some important respects. They require the programmer to become intimately involved in the tedious business of formatting the layout of computer reports, as well as editing and validating the input to the program. Many of the third generation languages are also characterized as procedural languages because the program instructions comprise lists of steps, or

Faculty of Information Technology University of Moratuwa

95

Introduction to Programming Language

procedures, that tell the computer not only what to do but how to do it. They require the programmer to think carefully about the sequence of computations, or the procedure, necessary to accomplish some action. High level language statements generate, when translated, a comparatively greater number of assembly-language instructions and even more machine-language instructions. In a scientific application, for example, the programmer may know that he wants to add array A to array B; however, he may be forced to write the detailed procedural steps to add each of the elements of the two arrays, rather than simply saying, Add these two arrays without having to worry about the procedural steps. Since a computer can execute programs only in machine language, a language translator is needed to convert programs written in any other type of language. A language processor, or language translator, is required to convert a high-level language program (source code) into machine language (object code), so that the program will work on the computer. Programs use three types of language processors: assemblers, compilers and interpreters. An assembler is a program that translates an assembly language program into machine language. A compiler is a language processor that translates an entire high-level language program into machine language version of the program in a single process. If no programming errors exist in the source code, the program becomes operative. An interpreter is a language processor that translates and executes high-level language instructions one instruction statement at a time. If an error is detected in the source code, the interpreter displays immediate feedback on the screen. There are over 700 languages in use today. Following is a list of the most commonly used high-level programming languages: Ada

FORTRAN COBOL PL/1 BASIC RPG C Pascal Modula-2

Fourth generation languages: Fourth generation languages (4GLs) are as yet difficult to define in general, because they are defined differently by different vendors. Basically 4GLs are easier for programmers and users to handle than third generation languages. 4GLs are nonprocedural languages and they allow programmers and users to specify what the computer is supposed to do without having to specify how the computer is supposed to do it. Fourth generation languages, or 4GLs, became extremely popular in the late 1980s and early 1990s. Examples of 4GLs are FOCUS, IDEAL, MARK IV, RAMIS, MANTIS, MAPPER, dBASE-III Plus, and Rbase-5000. Most of these languages introduced structured programming features that the older third generation languages lacked, but they have other features, too. In particular, 96

Faculty of Information Technology University of Moratuwa

Introduction to Programming Language

most of the tedious programming details associated with getting data into the computer (via a terminal) are hidden from the programmer; with one simple command, the programmer can specify that the computer should accept a specified kind of data from the keyboard, validate it, and store it in a designated data element. The same job might require 10 or 20 statements in a third generation programming language or 100 to 200 statements in a second generation programming language. Similarly, many of the tedious programming details associated with producing an output report (e.g., an inventory listing, paychecks, invoices, or a summary of the day's orders) are handled automatically by the fourth generation languages. If the precise placement of information on the computer printout is relatively unimportant (as is often the case), the programmer does not even have to specify it; otherwise (as in the case of a computer-produced paycheck, where dollar amounts must be printed in a precise location), the details are easily specified in a few 4GL instructions. In this same context, many of the popular OOPLs have evolved into legitimate 4GL's, because they have developed class libraries that take care of these same tedious details of input, editing, formatting, and output. What makes a programming language like Smalltalk so powerful in the hands of an experienced programmer is not so much the object-oriented syntax of the language, but rather the existence of nearly a thousand well-designed components within the standard class library, which can be invoked to take care of all the housekeeping details.

Fifth generation languages: the visual development environments: Fifth generation languages began appearing in the early 1990s, when powerful PC's and user-friendly graphical user interfaces (GUI's) started becoming widely available. The first such language was Visual Basic, introduced by Microsoft; but other proprietary languages, such as PowerBuilder and Delphi, quickly became popular. By the mid-1990s, with GUIs and powerful workstations, almost universally available, the "visual development environment" paradigm was extended to almost all of the traditional programming languages as well. Thus, there are versions of Visual COBOL, and Visual C++; and most of the vendor-supplied versions of Java, Smalltalk, and other programming languages are also visual in nature. In addition to providing easy access to the high-level components that made 4GLs so popular, the visual development environments provide the programmer with a "window" broken into several "panes" that can be used to create different parts of the program at the same time. A point-and-click approach eliminates the need for most of the tedious typing that was required with earlier generations of languages; instant syntaxchecking and incremental compilation gives the programmer quick feedback for eliminating simple errors, and also being able to run quick tests.

Faculty of Information Technology University of Moratuwa

97

Introduction to Programming Language

4.2.

Pascal Programming

Introduction Niklaus Wirth completed development of the original Pascal programming language in 1970. The Pascal language was named for Blaise Pascal, a French mathematician who was a pioneer in computer development history. Niklaus based it upon the block structured style of the Algol programming language. There were two original goals for Pascal. According to the Pascal Standard (ISO 7185), these goals were to a) make available a language suitable for teaching programming as a systematic discipline based on fundamental concepts clearly and naturally reflected by the language, and b) to define a language whose implementations could be both reliable and efficient on then-available computers. 4.3. Pascal Programming Basics

In a program, you must always obey the rules of the language, in our case, the Pascal language. As you go along the lessons, you must note what you can do and what you cannot do in writing a Pascal program. A very simple program is shown below: Program Program1; Begin Write('Hello World. Prepare to learn PASCAL!!'); Readln; End. This simple program illustrate how to compile and execute a Pascal program. First create a file named Program1 with the code above. Once the file is created and is on your disk, you can run the compile the program with the command PASCAL filename, or in this case: PASCAL Program1 To run the program, enter LOAD filename (START. In this case command would be LOAD Program1 (START Any error messages during compiling will be saved in a file called Program1 LISTING. The program is written only to display the message : 'Hello World. Prepare to learn PASCAL!!'. This is simply shown on the screen. So, to display any message on the screen, you should use 'write' (or 'writeln'). The 'readln' statement, here is used as to 'stop' the program and wait until the user presses enter. If the 'readln' statement is missing in this program, then the message is displayed on the screen without giving any chance for the user to read it! Try running this program with and without the

Faculty of Information Technology University of Moratuwa

98

Introduction to Programming Language

'readln' statement and notice the difference. I suggest you see it!! Now, look at this: Program Program2;begin Write('Hello World. Prepare to learn PASCAL!!');Readln;End. This program also runs perfectly as the previous one. The only difference is: neatness and friendliness. A program in Pascal always starts by the reserved word 'Program' following the title of the program. There are various restrictions on how to write this statement. Below is a simple example of a small program. (Remember: you can copy and paste the program onto your own compiler. Then you may run it.) The computer must prompt the user to enter a number, then the latter is added to the second number input by the user. 4.4. The Structure of a Pascal Program

Every Pascal program must follow a basic structure. Below is the basic structure that every Pascal program must follow. PROGRAM ProgramName;

VAR VariableName : VariableType; VariableName : VariableType; ...

PROCEDURE ProcedureName; variables here if necessary BEGIN Some Code; END; FUNCTION FunctionName(variableList): VariableType; variables here if necessary BEGIN Some Code if necessary; FunctionName := some expression More Code if necessary; END;

Faculty of Information Technology University of Moratuwa

99

Introduction to Programming Language

more functions and procedures if necessary ...

BEGIN the main program block. It should be small and all work should be delegated to the procedures and functions. It often consists of a WHILE loop that calls in turn procedures and functions in the appropriate order. END. Note: The functions and procedures can appear in any order. The only requirement is that if one procedure or function uses another one, that latter one must have been defined already. The elements of a program must be in the correct order, though some may be omitted if not needed. Here's a program that does nothing, but has all the REQUIRED elements: program DoNothing; begin end. Pascal comments start with a (* and end with a *) . You can't nest comments: (* (* *) *) will yield an error because the compiler matches the first (* with the first *) , ignoring everything in between. The second *) is left without its matching (* . Commenting has two purposes: first, it makes your code easier to understand. If you write your code without comments, you may come back to it a year later and have a lot of difficulty figuring out what you've done or why you did it that way. Another use of commenting is to figure out errors in your program. When you don't know what is causing an error in your code, you can comment out any suspect code segments. Remember the earlier restriction on nesting comments? It just so happens that braces {} supersede parenthesis-stars (* *). You will NOT get an error if you do this: { (* Comment *) } All spaces and end-of-lines are ignored by the Pascal compiler unless they are inside a string. However, to make your program readable by human beings, you should indent your statements and put separate statements on separate lines. 4.5. Pascal Identifiers

Faculty of Information Technology University of Moratuwa

100

Introduction to Programming Language

Identifiers are names that allow you to reference stored values, such as variables and constants. Also, every program must be identified (hence the name) by an identifier. Rules for identifiers:

Must begin with a letter from the English alphabet. Can be followed by alphanumeric characters (alphabetic characters and numerals) and possibly the underscore (_). May not contain certain special characters. Examples of special characters: ~!@#$%^&*()_+`-={}[]:";'<>?,./|\

Pascal implementations may differ in their rules on special characters, especially the underscore. Several identifiers are reserved in Pascal -- you cannot use them as your own identifiers. They are: and else in procedure until array end label program var begin file mod record while case for nil repeat with const forward not set div function of then do goto or to downto if packed type

Also, Pascal has several pre-defined identifiers. You can replace them with your own definitions, but then you would remove part of the functionality of Pascal. abs arctan boolean char cos dispose eof eoln exp false input integer ln maxint new odd ord output pack page pred read readln real reset rewrite round sin sqr sqrt succ text true trunc write writeln Pascal is not case sensitive! MyProgram, MYPROGRAM , and mYpRoGrAm are equivalent. But for readability purposes, it is a good idea to use meaningful capitalization! Because C, C++, and Java, the dominant programming languages of today, are casesensitive, future Pascal implementations may become case-sensitive. Identifiers can be any length, but some Pascal compilers will only look at the first several characters. Supposing this number is 32. Then,
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFAlphaBeta ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGammaDelta

would be equivalent. One usually does not push the rules with extremely long identifiers or loads of special characters, since it does not confer much benefit on the program's functionality. Also, staying well within the bounds of identifier rules will aid cross-platform compatibility. Most programmers make do with just alphanumeric characters.

Faculty of Information Technology University of Moratuwa

101

Introduction to Programming Language

4.6.

Constants

Constants are referenced by identifiers, and can be assigned one value at the beginning of the program. The value stored in a constant cannot be changed. Constants are defined in the constant section: const Identifier1 = value; Identifier2 = value; Identifier3 = value; Example: const Name = 'Tao Yue'; FirstLetter = 'a'; Year = 1997; pi = 3.1415926535897932; UsingNetscapeNavigator = TRUE; The example has shown the main data types allowed in Pascal: strings, characters, integers, reals, and Booleans. Those data types will be further explained in the next section. Note that in Pascal, characters are enclosed in single quotes, or apostrophes (')! Constants are useful when you want to use a number in your programs that you know will change in the future. If you are writing a program for the Parliament and want to display the name of the prime minister, you wouldn't want to hard-code the name every time you display it. It would be too time-consuming to find all the instances and change them later on. Instead, you would:
const PrimeMinister = 'name1';

and later change it to:


const PrimeMinister = 'name2';

That way, the rest of your code can remain unchanged because they refer to the constant. Just the constant's value needs to be modified. There's also a thing called typed constants. For example, const a : real = 12; would yield an identifier a which contains a real value 12.0 instead of the integer value 12. 4.7. Variables and Data Types

There are five basic variable types in Pascal: INTEGER, REAL, CHAR, BOOLEAN, and STRING. They are defined as follows:

Faculty of Information Technology University of Moratuwa

102

Introduction to Programming Language

A positive or negative integer between a smallest (negative) and a largest number. In general the smallest and largest number possible depends on the machine; for IBM PC and Turbo Pascal they are: smallest Integer: -32766 largest Integer: 32767 Can contain a real number in scientific or decimal notation. REAL There is a limit on the size and accuracy of the real number that will be covered later. Valid real numbers are, for example: Decimal Notation: 1.234 or -34.5507 Scientific Notation: 5.0E-3 or -7.443E3 Any key on the keyboard is considered a valid character. CHAR Characters are usually enclosed in single quotes. For example: '1' is a character, while 1 is an integer. BOOLEAN We will deal with boolean variables later A string is a collection of up to 255 characters enclosed in STRING single quotes. For example: 'Bert' is a string of 4 characters. More details about strings will follow later. INTEGER

Assigning Values to Variables Variables are simply a name for a block of memory cells in main memory. If a value is assigned to a variable, that value must be of the same type as the variable, and will be stored in the memory address designated by the variable name. The assignment statement is the semicolon-equal :=. Variables must be declared at the beginning of the program, a procedure, or a function Variables must be initialized before they can be used. Variables can be reused as often as necessary. Their old value is simply overwritten by a new assignment. Example: PROGRAM Test; VAR x : REAL; i : INTEGER: c : CHAR; s : STRING; BEGIN { variable name is x, type is real { variable name is i, type is integer { variable name is c, type is character { variable name is s, type is string

Faculty of Information Technology University of Moratuwa

103

Introduction to Programming Language

x := -34.55; { valid real number assigned to variable x } x := -3.9E-3; { valid real number assigned to variable x } WRITELN(x); i := 10; i := i * i; i := 9933; { x contains the value -3.9E-3 }

{ valid integer number assigned to variable i } { valid (!) - i will be 100 now } { valid integer number assigned to variable i }

i := -99999; { invalid integer - too small } i := 999.44; c := '1'; c := 1; { invalid assignment - types do not match } { valid character assigned to variable c } { invalid assignment - types do not match }

c := 'Bert'; { invalid assignment - types do not match } c := 'd'; { valid character assigned to variable c } { c contains the value 'd' }

WRITELN(c); d := 'c';

{ unknown variable - the variable d is not declared } { invalid reference - s has undefined value }

WRITELN(s); END. 4.8. Operation

Arithmetic operatorsThe arithmetic operators in Pascal are: Operator + * / div mod Operation Subtraction negative Multiplication Real division Integer division Modulus division) (remainder or unary Operands Result real or integer real or integer real or integer real integer integer

Addition or unary positive real or integer real or integer real or integer real or integer integer integer

div and mod only work on integers. / works on both reals and integers but will always yield a real answer. The other operations work on both reals and integers. For operators that accept both reals and integers, the resulting data type will be integer only if all the operands are integer. It will be real if any of the operands are real. Therefore,
3857 + 68348 * 38 div 56834

Faculty of Information Technology University of Moratuwa

104

Introduction to Programming Language


will be integer, but 38573 div 34739 mod 372 + 35730 - 38834 + 1.1

will be real because 1.1 is a real value. Each variable can only be assigned a value that is of the same data type. Thus, you cannot assign a real value to an integer variable. However, certain data types are compatible with others. In these cases, you can assign a value of a lower data type to a variable of a higher data type. This is most often done when assigning integer values to real variables. Suppose you had this variable declaration section: var some_int : integer; some_real : real; When the following block of statements executes, some_int := 375; some_real := some_int; some_real will have a value of 375.0, or 3.75e2. In Pascal, the minus sign can be used to make a value negative. The plus sign can also be used to make a value positive. This, however, is unnecessary because values default to being positive. Do not attempt to use two operators side by side!
some_real := 37.5 * -2;

This may make perfect sense to you, since you're trying to multiply by negative-2. However, Pascal will be confused -- it won't know whether to multiply or subtract. You can avoid this by using parentheses:
some_real := 37.5 * (-2);

to make it clearer. The computer follows an order of operations similar to the one that you follow when you do arithmetic:
* / div mod + -

The computer looks at each expression according to these rules: 1. Evaluate all expressions in parentheses, starting from the innermost set of parentheses and proceeding to the outermost. 2. Evaluate all multiplication and division from left to right. 3. Evaluate all addition and subtraction from left to right. The value of
3.5 * (2 + 3) will be 17.5.

Pascal cannot perform standard arithmetic operations on Booleans. There is a special set of Boolean operations. Also, you should not perform standard operations on characters because the results may vary from compiler to compiler.

Faculty of Information Technology University of Moratuwa

105

Introduction to Programming Language

Boolean operators Boolean expressions are used to compare two values. The simplest form of Boolean expression looks like this:
value1 relational_operator value2

The following relational operators are used: < > = <= >= <> less than greater than equal to less than or equal to greater than or equal to not equal to

You can assign Boolean expressions to Boolean variables:


some_bool := 3 < 5;

Of course, the value of some_bool becomes TRUE. Complex Boolean expressions are formed by using the Boolean operators:
not and or xor

negation (~) conjunction (^) disjunction (v) exclusive-OR

NOT is a unary operator - it is applied to only one value and inverts it: not true = false not false = true AND yields TRUE only if both expressions are TRUE. TRUE and FALSE = FALSE TRUE and TRUE = TRUE OR yields TRUE if either expression is TRUE, or if both are. The following are TRUE:

TRUE or TRUE TRUE or FALSE FALSE or TRUE


XOR yields TRUE if one expression is TRUE and the other is FALSE. Thus,

TRUE xor TRUE = FALSE TRUE xor FALSE = TRUE FALSE xor TRUE = TRUE FALSE xor FALSE = FALSE

Faculty of Information Technology University of Moratuwa

106

Introduction to Programming Language

When combining two Boolean expressions using relational and Boolean operators, be careful to use parentheses.
(3>5) or (650<1)

This is because the Boolean operators are higher on the order of operations than the relational operators: not * / div mod and + - or < > <= >= = <> This way,
3 > 5 or 650 < 1

becomes evaluated as
3 > (5 or 650) < 1

which makes no sense, because the Boolean operator or only works on Boolean values, not on integers. The Boolean operators (AND, OR, NOT, XOR) can be used on Boolean variables just as easily as they are used on Boolean expressions. Whenever possible, don't compare two real values with the equals sign. Small roundoff errors may cause two equivalent expressions to differ. 4.9. Formatted Input and Output

Reading Information Input means to read data into memory, either from the keyboard, the mouse, or a file on disk. The basic format for reading in data is:
read (Variable_List);

Variable_List is a series of variable identifiers separated by commas.


read , however, does not go to the next line. This can be a problem with character

input, because the end-of-line character is read as a space. To read data and then go on to the next line, use
readln (Variable_List);

Suppose you had this input from the user, and a, b, c, and d were all integers.
45 97 3 1 2 3

This would be the result of various statements: Statement(s)


read (a); read (b); readln (a); read (b); read (a, b, c, d); readln (a, b); readln (c, d);

a 45 45 45 45

b 97 1 97 97

3 1

1 2

Faculty of Information Technology University of Moratuwa

107

Introduction to Programming Language

To read information from the keyboard, the command READLN is used in the following example: PROGRAM Test; VAR x : REAL; i : INTEGER; c : CHAR; BEGIN READLN(x); { user can type a real number, followed by the return key. The value will be stored in the variable x. If the user input is not a real (or integer) number, a runtime error (invalid assignment) will occur. } READLN(i); { user can type a integer, followed by the return key. The value will be stored in the variable i. If the user input is not an integer, a runtime error (invalid assignment) will occur. } READLN(c); { user can type any character, followed by the return key. The value will be stored in the variable c and will be a character. If a user enters 1, c will be the character '1' not the integer 1. } READLN; END. { user can type a single return. } { x is declared to be real } { i is declared to be an integer } { c is declared to be a character }

Writing Information To write information on the screen, you can use the WRITE or WRITELN command. You can write the content of variables or simple text. There are several variations: Writing Text
WRITE('any text');

writes any text enclosed in simple quotes on the screen

Writing

WRITE(I);

I is an integer variable

Faculty of Information Technology University of Moratuwa

108

Introduction to Programming Language

integers unformatted Writing integers formatted


WRITE(I:num); I

is an integer and num

indicates the total positions to be used. If the value contained in the variable I needs more digits, num is ignored.

Writing reals unformatted


WRITELN(x);

x is a real variable. Will

always write the real number in scientific notation and is almost never what you want.

Writing reals formatted


WRITELN(X:num1:num2);

X is a real variable, num1 is the

total amount of digits to use (including sign and period) and num2 is the number of digits after the period.

Note: The same rules apply for the command WRITELN but this command also positions the cursor to the first position of the next line. You can combine writing text and more than one variable by separating the individual components by a comma. Here is an example: PROGRAM Test; VAR x : REAL; i : INTEGER; j : INTEGER; BEGIN x := 12.449; i := 10; j := -300; WRITE('This is some text'); WRITELN('Unformatted integer ',i); WRITELN('Unformatted integer computation ',i*i);

Faculty of Information Technology University of Moratuwa

109

Introduction to Programming Language

WRITELN('formatted integer',i:4); WRITELN('formatted integer',j:4); WRITELN('Unformatted real ',x); WRITE('Formatted real'); WRITE(x:8:2); WRITELN('all in one line'); END. which will produce the following output: This is some textUnformatted integer 10 Unformatted integer computation 100 formatted integer 10 formatted integer-300 Unformatted real 1.24490000000E+01 Formatted real 12.45all in one line 4.10. Sequential Control In real worlds, several activities are initiated (sequenced), or repeated based on some decisions. Such activities can be programmed by specifying the order in which computation are carried out. Sequential control is the way a program causes the flow of execution to advance and branch based on changes in the data state. if statement The IF statement allows you to branch based on the result of a Boolean operation. The one-way branch format is:
if BooleanExpression then StatementIfTrue;

If the Boolean expression evaluates to true, the statement executes. Otherwise, it is skipped. The IF statement accepts only one statement. If you would like to branch to a compound statement, you must use a begin-end to enclose the statements:
if BooleanExpression then begin Statement1; Statement2 end;

There is also a two-way selection:


if BooleanExpression then StatementIfTrue else StatementIfFalse;

Faculty of Information Technology University of Moratuwa

110

Introduction to Programming Language

If the Boolean expression evaluates to FALSE , the statement following the else will be performed. Note that you may NOT use a semicolon after the statement preceding the else. That causes the computer to treat it as a one-way selection, leaving it to wonder where the else came from. If you need multi-way selection, simply nest if statements: if Condition1 then Statement1 else if Condition2 then Statement2 else Statement3; Be careful with nesting. Sometimes the computer won't do what you want it to do: if Condition1 then if Condition2 then Statement2 else Statement1; The else is always matched with the most recent if, so the computer interprets the preceding block of code as: if Condition1 then if Condition2 then Statement2 else Statement1; which is absolutely not what you wanted. You can get by with a null statement: if Condition1 then if Condition2 then Statement2 else else Statement1; or you could use a begin-end block. But the best way to clean up the code would be to rewrite the condition. if not Condition1 then Statement1 else if Condition2 then Statement2; This example illustrates where the not operator comes in very handy. If Condition1 had been a Boolean like: (not(a < b) or (c + 3 > 6)) and greversing the expression would be much more difficult than NOTting it.

Faculty of Information Technology University of Moratuwa

111

Introduction to Programming Language

CASE Suppose you wanted to branch one way if b is 1, 7, 2037, or 5; and another way if otherwise. You could do it by: if (b = 1) or (b = 7) or (b = 2037) or (b = 5) then Statement1 else Statement2; But in this case, it would be simpler to list the numbers for which you want Statement1 to execute. You would do this with a case statement: case b of 1,7,2037,5: Statement1; otherwise Statement2 end; The general form of the case statement is:
case selector of List1: Statement1; List2: Statement2; ... Listn: Statementn; otherwise Statement end;

The otherwise part is optional. When available, it differs from compiler to compiler. In many compilers, you use the word else instead of otherwise. selector is any variable of an ordinal data type. You may not use reals! Note that the lists must consist of literal values. That is, you must use constants or hard-coded values -- you cannot use variables. FOR..DO Loop Looping means repeating a statement or compound statement over and over until some condition is met. There are three types of loops:

fixed repetition - only repeats a fixed number of times pretest - tests a Boolean expression, then goes into the loop if TRUE posttest - executes the loop, then tests the Boolean expression

In Pascal, the fixed repetition loop is the for loop. The general form is:
for index := StartingLow to EndingHigh do statement;

The index variable must be of an ordinal data type. You can use the index in calculations within the body of the loop, but you should not change the value of the index. An example of using the index is: sum := 0;

Faculty of Information Technology University of Moratuwa

112

Introduction to Programming Language

for count := 1 to 100 do sum := sum + count; The computer would do the sum the long way and still finish it in far less time than it took the mathematician Gauss to do the sum the short way (1+100 = 101. 2+99 = 101. See a pattern? There are 100 numbers, so the pattern repeats 50 times. 101*50 = 5050). In the for-to-do loop, the starting value MUST be lower than the ending value, or the loop will never execute! If you want to count down, you should use the for-downtodo loop:
for index := StartingHigh downto EndingLow do statement;

In Pascal, the for loop can only count in increments (steps) of 1. WHILE..DO LOOP The pretest loop has the following format:
while BooleanExpression do statement;

The loop continues to execute until the Boolean expression becomes FALSE. In the body of the loop, you must somehow affect the Boolean expression by changing one of the variables used in it. Otherwise, an infinite loop will result: a := 5; while a < 6 do writeln (a); Remedy this situation by changing the variable's value: a := 5; while a < 6 do begin writeln (a); a := a + 1 end; The WHILE ... DO lop is called a pretest loop because the condition is tested before the body of the loop executes. So if the condition starts out as FALSE, the body of the while loop never executes. REPEAT..UNTIL Loop The posttest loop has the following format:
repeat statement1; statement2 until BooleanExpression;

In a repeat loop, compound statements are built-in -- you don't need to use begin end.

Faculty of Information Technology University of Moratuwa

113

Introduction to Programming Language

Also, the loop continues until the Boolean expression is TRUE, whereas the while loop continues until the Boolean expression is FALSE . This loop is called a posttest loop because the condition is tested AFTER the body of the loop executes. The REPEAT loop is useful when you want the loop to execute at least once, no matter what the starting value of the Boolean expression is.

4.11. Procedures and Functions Procedures A procedure is a subprogram. Subprograms help reduce the amount of redundancy in a program. Statements that are executed over and over again but not contained in a loop are often put into subprograms. Subprograms also facilitate top-down design. Top-down design is the tackling of a program from the most general to the most specific. For example, top down design for going from one room to another starts out as: I. Get out of first room II. Go to second room III. Go into second room Then it is refined to I. Get out of first room A. Go to door B. Open the door C. Get out of door D. Close door Just going to the door can be refined further: A. Go to door 1. Get out of seat 2. Turn towards door 4. Walk until you almost bump into it This, of course, can be further refined. This may seem to be too detailed, but for computer programming, this is, in effect what you have to do. The computer can't understand general statements -- you must be specific. Main tasks should be contained in procedures, so in the main program, you don't have to worry about the details. This also makes for reusable code. You can just keep your procedures in one file and link that into your program. A procedure has the same basic format as a program:

Faculty of Information Technology University of Moratuwa

114

Introduction to Programming Language

procedure Name;

const (* Constants *)

var (* Variables *)

begin (* Statements *) end;

There is a semicolon (not a period) at the end. To call the procedure from the main program, just use the name, like you would writeln.
Name;

Procedures are very often used to output data. Parameters A parameter list can be included as part of the procedure heading. The parameter list allows variable values to be transferred from the main program to the procedure. The new procedure heading is:
procedure Name (formal_parameter_list);

The parameter list consists of several parameter groups, separated by semicolons:


param_group_1; param_group2; ... ; param_groupn

Each parameter group has the form:


identifier_1, identifier_2, ... , identifier_n : data_type

The procedure is called by passing arguments (called the actual paremeter list) of the same number and type as the formal paremeter list. An example is: procedure Name (a, b : integer; c, d : real); begin a := 10; b := 2; writeln (a, b, c, d) end;

Faculty of Information Technology University of Moratuwa

115

Introduction to Programming Language

Suppose you called the procedure from the main program: alpha := 30; Name (alpha, 3, 4, 5); When you return to the main program, what is the value of alpha ? 30. Yet, alpha was passed to a, which was assigned a value of 10. What actually happened was that a and alpha are totally distinct. The value in the main program was not affected by what happened in the procedure. This is called call-by-value. This passes the value of a variable to a procedure. Another way of passing parameters is call-by-reference. This creates a link between the formal parameter and the actual parameter. When the formal parameter is modified in the procedure, the actual parameter is likewise modified. Call-byreference is activated by preceding the parameter group with a VAR:
VAR identifier1, identifier2, ..., identifiern : datatype;

In this case, constants and literals are not allowed to be used as actual parameters because they might be changed in the procedure. Example procedure: procedure Name (a, b : integer; VAR c, d : integer); begin c := 3; a := 5 end. Example part of main program: alpha := 1; gamma := 50; delta := 30; Name (alpha, 2, gamma, delta); After the procedure has run gamma has the value 3 because c was a reference parameter, but alpha still is 1 because a was a value parameter. This is a bit confusing. Think of call-by-value as copying a variable, then giving the copy to the procedure. The procedure works on the copy and discards it when it is done. The original variable is unchanged. Call-by-reference is giving the actual variable to the procedure. The procedure works directly on the variable and returns it to the main program. Functions Functions work the same way as procedures, but they always return a value to the main program separate from the variables passed to the function:
function Name (parameter_list) : return_type;

Functions are called in the main program by using them in expressions:


a := Name (5) + 3;

Faculty of Information Technology University of Moratuwa

116

Introduction to Programming Language

Be careful not to use the name of the function on the right side of any equation inside the function. That is: function Name : integer; begin Name := 2; Name := Name + 1 end. is a no-no. Instead of returning the value 3, as might be expected, this sets up an infinite recursive loop. Name will call Name, which will call Name, which will call Name, etc. The return value is set by assigning a value to the function identifier.
Name := 5;

It is generally bad programming form to make use of VAR parameters in functions -functions should return only one value. You certainly don't want the sin function to change your pi radians to 0 radians because they're equivalent -- you just want the answer 0. Functions provide a flexible method to apply one formula many times to possibly different values. They are comparable to procedures but functions are of always of a certain type functions usually have one or more input variable(s) the function name must appear at least once inside the definition The general form of the function statement looks like this: FUNCTION FunctionName(ParameterName: ParameterType): ReturnType; BEGIN some code, if necessary; FunctionName := some computation; more code if necessary; END; Note that every function must contain the function name at least twice: once in the definition of the function, and once to assign the result of a computation to the function. Functions can be used similar to variables. You can assign the result of a function to a new variable, you can print the result of a function using WRITE or WRITELN, or you can use the result of a function in another computation or test. Here is an example:

Faculty of Information Technology University of Moratuwa

117

Introduction to Programming Language

PROGRAM Test; VAR radius: REAL;

FUNCTION CircleArea(r : REAL): REAL; BEGIN CircleArea := 3.1415 * r * r; END;

BEGIN WRITE('Area of circle with radius 2.0: '); WRITELN(CircleArea(2.0):6:1); WRITE('Area of circle with radius 5.0: '); WRITELN(CircleArea(5.0):6:1); WRITE('Enter your own radius: '); READLN(radius); WRITE('Area of circle with radius ', radius:3:1,': '); WRITELN(CircleArea(radius)); real } radius := 5.0; radius := CircleArea(radius); WRITELN(radius); END. 4.12. Enumerated Types You can declare your own ordinal data types. You do this in the type section of your program:
type datatypeidentifier = typespecification;

{ ugly - formatting missing for

{ can you guess the output ? }

One way to do it is by creating an enumerated type. An enumerated type specification has the syntax:
(identifier1, identifier2, ... identifiern)

For example, if you wanted to declare the months of the year, you would do a type:

Faculty of Information Technology University of Moratuwa

118

Introduction to Programming Language

type MonthType = (January, February, March, April, May, June, July, August, September, October, November, December); You can then declare a variable: var Month : MonthType; You can assign any enumerated value to the variable: Month := January; All the ordinal functions are valid on the enumerated type. ord(January) = 0 , and ord(December) = 11 . A few restrictions apply, though: enumerated types are internal to a program -- they can neither be read from nor written to a text file. You must read data in and convert it to an enumerated type. Also, the idenfier used in the type (such as January) cannot be used in another type. The main purpose of an enumerated type is to allow you, the programmer, to refer to meaningful names for data. Sometimes, when the built in data types don't suffice, it is easier to use an enumerated type than to keep the inputted data as a string. 4.13. 1-dimensional Arrays An array is a group logically related data items of the same data-type addressed by a common name, and all the items are stored in contiguous (physically adjacent) memory locations. Suppose you wanted to read in 5000 integers and do something with them. How would you store the integers? You could use 5000 variables, lapsing into:
aa, ab, ac, ad, ... aaa, aab, ... aba, ...

or you could use an array. An array contains several storage spaces, all the same type. You refer to each storage space with the array name and with a subscript. The type definition is:
type typename = array [enumerated_type] of another_data_type;

The data type can be anything, even another array. Any enumerated type will do. You can specify the enumerated type inside the brackets, or use a predefined enumerated type. In other words,
type enum_type = 1..50; arraytype = array [enum_type] of integer;

is equivalent to
type arraytype = array [1..50] of integer;

Faculty of Information Technology University of Moratuwa

119

Introduction to Programming Language

This is how strings are actually managed. You declare: type String = packed array [0..255] of char; and use some kind of terminating character to signify the end of the string. Most of the time it's the null-character (ordinal number 0, or ord(0) ). The packed specifier means that the array will be squeezed to take up the smallest amount of memory. This makes it possible to print out the entire array all at once rather than one-character at a time. In Turbo/Borland Pascal, there's a built-in string data type. Arrays are useful if you want to store large quantities of data for later use in the program. They work especially well with for loops, because the index can be used as the subscript. To read in 50 numbers, assuming
type arraytype = array[1..50] of integer;

and
var myarray : arraytype;

you use for count := 1 to 50 do read (myarray[count]); Brackets [] enclose the subscript when referring to arrays.
myarray[5] := 6;

Review Questions 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. How do you distinguish five generation of programming languages? How do third generation languages differ from first-and second generation languages? What are the main types of fourth generation language tools? What were the reasons behind the development of high-level programming languages? What are variables? List Pascal rules for variable naming. What are keywords? List keywords specific to Pascal. Can these keywords be used as variables? List categories of operators supported by Pascal. Write a Pascal program to add any given two numbers. Write a Pascal program to find the largest of two numbers. Write a Pascal program to multiply and divide a given number by 2 without using * and / operators. Discuss the need of control flow statements in Pascal. Write a Pascal program to print a given integer in the reverse order. Write a Pascal program to find the average of given 5 numbers. What are arrays? Write a Pascal program to find the age of the eldest person using an array. Visit the computer laboratory at your school. a. Identify which high-level languages are available. b. Determine if each language processor identified is a compiler or an interpreter. c. Determine if the language processors are available for microcomputers, larger computers, or both.

Faculty of Information Technology University of Moratuwa

120

Introduction to Programming Language

References 1. 2. 3. 4. 5. Abolrous, Sam A. Learn Pascal in Three Days (2nd Ed.), Wordware Pub: 1997. ISBN: 1-55622-567-9. Dale, Nell & Weems, Chip. Interduction to Pascal and Structured Design (4th Ed), Jones and Bartlett Publishers: 1997. ISBN: 0-7637-0397-4. Gottfried, Byron S.Schaums Outline of Programming With Pascal, McGrawHill Publishing: 1994. ISBN: 007023924X. Savitch, Walter. Pascal. Benjamin/Cummings Pub Co: 1995. ISBN: 0-80537458-2. Pascal Programming v2.2, Copyright Brian Brown/Peter Henry, 1988-2000, http://goforit.unk.edu/pascal

Faculty of Information Technology University of Moratuwa

121

Word Processing

Unit 5- Office Applications and Internet


Unit 5.1: Word Processing

5.1.1. Introduction to Word Word-processing software lets you create, edit, format, store, retrieve and print a document. Microsoft Word is a sophisticated package that includes many desktop publishing type features, such as graphics package and draw package etc. 5.1.2. Method 1

Starting Microsoft Word

Double click on the Microsoft Word icon on the desktop.

Method 2

Click on Start Programs Microsoft Word

Faculty of Information Technology University of Moratuwa

122

Word Processing

5.1.3.

A typical Word screen

Menu bar

Title Tool bars

Workspace

Scroll Bars Status bar Word automatically starts a new document for you; this document is called Document1 until you Save it (permanently record it onto disk). You will then be prompted to enter a name, which you can later use to retrieve the document. The Word workplace is what you see on your screen -- the text area as well as the title bar, menu bar, toolbars, and status bar. The Word workplace also includes elements such as menu commands, dialog boxes, and windows. Depending on the view you use, different screen elements will be available. You can also display or hide some screen elements.

5.1.4. Selecting Text It is very important to know how to select text. You must select all the text you wish to format prior to applying character formatting. Additionally you need to select text before you can copy or cut it to the clipboard, and before you can use drag and-drop editing. You can select text using either the mouse or the keyboard. To select a Single Word To select a Single sentence Double Click on the word Hold down the Ctrl key and click on the sentence Move the mouse cursor to the left side of paragraphs starting word and click on it.

To select a Paragraph

Faculty of Information Technology University of Moratuwa

123

Word Processing

Hold on Shift Key and move the mouse cursor to the right side of the paragraphs ending word and click. To select a segment of a Paragraph Hold on Alt Key + Shift Key and also hold on the left mouse button and drag on the paragraph. Move the mouse cursor into the left margin until it turns into an arrow then triple click.

To select the whole document

When editing text you can use the arrow keys to move between texts. To erase a mistake you can use the backspace or delete keys. You can also use the Undo option (Edit Undo) to undo the last action/task you have done. 5.1.5. Viewing the Toolbars The toolbars in Microsoft Word provide easy access and functionality to the user. There are many shortcuts that can be taken by using the toolbar. First, make sure that the proper toolbars are visible on the screen. 1. Click View, Select Toolbars 2. Select Standard, Formatting, and Drawing 3. Other toolbars can be selected if you wish

Faculty of Information Technology University of Moratuwa

124

Word Processing

Name New Blank Document Open (File menu) Save (File menu) Print (File menu) Print Preview (File menu)

Icon

Description Creates a new, blank file based on the default template. Opens or finds a file. Saves the active file with its current file name, location, and file format. Prints the active file or selected items. To select print options, on the File menu, click Print. Shows how a file will look when you print it. Checks the active document for possible spelling, grammar, and writing style errors, and displays suggestions for correcting them. To set spelling and grammar checking options, click Options on the Tools menu, and then click the Spelling and Grammar tab. Removes the selection from the active document and places it on the Clipboard. Copies the selection to the Clipboard. Inserts the contents of the Clipboard at the insertion point, and replaces any selection. This command is available only if you have cut or copied an object, text, or contents of a cell. Copies the format from a selected object or text and applies it to the object or text you click. To copy the formatting to more than one item, doubleclick , and then click each item you want to format. When you are finished, press ESC or click again to turn off the Format Painter. Reverses the last command or deletes the last entry you typed. Reverses the action of the Undo command. Inserts a new hyperlink or edits the selected hyperlink. Displays the Tables and Borders toolbar, which contains tools for creating, editing, and sorting a table and for adding or changing borders to selected text, paragraphs, cells, or objects. Enter a magnification between 10 and 400 percent to reduce or enlarge the display of the active document. The Office Assistant provides Help topics and tips to help you accomplish your tasks.

Spelling and Grammar (Tools menu)

Cut (Edit menu) Copy (Edit menu) Paste (Edit menu)

Format Painter (Standard toolbar)

Undo (Edit menu) Redo (Edit menu) Hyperlink

Tables and Borders

Zoom Office Assistant

Faculty of Information Technology University of Moratuwa

125

Word Processing

5.1.6.

Spell Checker

Word checks the spelling and grammar as you type. If you see a red squiggly line under a word this means that the word has been spelt incorrectly; if the line is green then the grammar may be incorrect. You can also do a full check by pressing the Spelling and Grammar button on the Standard toolbar. 1. Type the following misspell sentence:
howe mamy speling andother misstakes is their on thsi sentance.

2. Note that as you type the sentence, Word will/can automatically correct certain mistakes:

it will capitalize the first word in a sentence (Howe) it will correct certain misspellings (eg thsi to this and sentance to sentence) (Provided the AutoCorrect feature is activated Tools AutoCorrect Replace as You Type). Correcting

5.1.7.

1. Select the sentence - you can select an area to spell-check 2. Click on the Spelling and Grammar button on the Standard Toolbar 3. If you are asked whether you want to create a custom dictionary, click on Yes

4. Highlight the correct spelling of How in the Suggestions: box then click on [Change]

Faculty of Information Technology University of Moratuwa

126

Word Processing

5. Continue in the same manner with the other corrections 6. Always check whether the correction is what you want - with others you have to edit the sentence in the Not in Dictionary: box (press left arrow to move the insertion point and add a Space) Note that if a spelling is correct, you can either choose to Ignore a suggested correction or Add the word to your own dictionary. Choose Ignore All if you don't want to be asked about the same spelling again and again (similarly Change All will change all occurrences of a misspelt word). You can also Cancel the check at any time. 5.1.8. Page Setup

The Page Setup is used to set various aspects of how a document is set up. This is usually done prior to printing and can be altered for various reasons. The Page Setup is activated from the File Menu Option. The Page Setup has four main sections we will at first look at two only: Margins This allows you to set the top, bottom, left and right margins. Also the gutter margin (an extra margin on the left) for binding purposes. You can also set mirror margins here (margins that are equal on both sides). You can apply these changes to the Whole Document or just This Point Forward i.e. change the margins for just one section. This is useful for setting different line ups for different parts of a document without having to put these different orientations in a separate document or keep to a setup that is not ideal. Paper Size This section allows you to change the size of the paper for the document you are creating e.g. A4, Legal, Executive, Letter and various envelope, label and card sizes. You can also change the orientation of the paper here i.e. the direction of the page, from Portrait (standard version of the page, length is greater than the width) to

Faculty of Information Technology University of Moratuwa

127

Word Processing

Landscape (width of the page is greater than the length). You can also apply these chages to the Whole Document or just This Point Forward. 5.1.9. Saving Documents

1. Select File from the Menu Bar 2. Click on Save Icon.

The first time you save a document, Word prompts you for a file name and subdirectory to which to save the file using the Save As dialog box shown above. 5.1.10. Creating a New Document

1. Click on File 2. Select New To create a blank document, simply select Blank Document. To create a document based on one of the templates provided in Microsoft Word, select which one you would like to create and select OK

5.1.11. Formatting Typing a document into Word is not enough. You must make that document look attractive. We will examine three types of formatting: page, paragraph, and character. 1. Highlight the text that you want to format by dragging your mouse over while holding down the left mouse button 2. Change the text to your desire

Faculty of Information Technology University of Moratuwa

128

Word Processing

Text Formatting When formatting text, there are three major things you usually change: the typeface, the size of the font, and its attributes. All three of these can be changed from the Formatting toolbar. There are other, less important changes you can make to your fonts, but these are available only through a dialog box. 1. Select the text 2. Select Format from the Menu Bar 3. Select the required formatting

Paragraph Formatting Paragraph formatting controls how a particular paragraph appears on the page. You can control the spacing of the paragraph (single, double, and so on), its justification, if its left and right sides are indented from the margin, if the first line is indented etc. 1. Select the paragraph which is to be formatted 2. Select Format from the Menu Bar

Faculty of Information Technology University of Moratuwa

129

Word Processing

3. Select Paragraph

5.1.12.

Indenting

Indenting refers to the space that is left between the margin and the beginning of the sentence. Hanging Indenting First line Indenting

Text with a hanging indent. Hanging indents are frequently used for glossary terms, resumes, and bulleted and numbered lists. To alter the indenting for a paragraph. 1. Select Format 2. Select Paragraph

Text with a first-line indent.

Faculty of Information Technology University of Moratuwa

130

Word Processing

3. Type in the value for the indentation.

5.1.13.

Line Spacing

Line spacing refers to the space between the bottom of one line and the bottom of the next line. Normally text is typed in single spacing i.e. line spacing is one. Word automatically adjusts the line height to accommodate the size of the font you are using.To alter the line spacing in the document. 1. Select Format 2. Select Paragraph

Three types of spacing that are more commonly used are listed below. Single 1.5 Lines Double Single spacing that Word can increase depending on the size of the font. One-and-a-half line spacing that Word can increase. Double spacing that Word can increase.

5.1.14.

Bullets & Numbering or Numbered List button on the formatting

Click the Bulleted List button toolbar.

Faculty of Information Technology University of Moratuwa

131

Word Processing

1. Type the first entry and press ENTER. This will create a new bullet or number on the next line. If you want to start a new line without adding another bullet or number, hold down the SHIFT key while pressing ENTER. 2. Continue to type entries and press ENTER twice when you are finished typing to end the list. Use the Increase Indent and Decrease Indent toolbar to create lists of multiple levels. buttons on the formatting

You can also type the text first, highlight the section, and press the Bulleted List or Numbered List buttons to add the bullets or numbers. Outlined Number
To create a Outlined Number such as a numbered list inside of a bulleted list, follow these steps:

Type the list and increase the indentation of the items that will make up the outline numbered by clicking the Increase Indent button for each item. Highlight the items and click the Numbered List button on the formatting toolbar.

Formatting Lists Using the Bullets and Numbering dialog box can change the bullet image and numbering format. 1. Highlight the entire list to change all the bullets or numbers, or Place the cursor on one line within the list to change a single bullet. 2. Access the dialog box by selecting FormatBullets and Numbering from the menu bar or by right-clicking within the list and selecting Bullets and

Faculty of Information Technology University of Moratuwa

132

Word Processing

Numbering from the shortcut menu.

3. Select the list style from one of the seven choices given, or click the Picture... button to choose a different icon. Click the Numbered tab to choose a numbered list style. 4. Click OK when finished.

Faculty of Information Technology University of Moratuwa

133

Word Processing

5.1.15.

Borders and Shading

In a Word document, you can add a border to any or all sides of a table, a paragraph, or selected text in a document. You can add a border, including a picture border (such as a row of trees), to any or all sides of each page in a document.You can also add a border or line to a drawing object including a text box, an AutoShape, or a picture.

Applying Borders and Shadings 1. Select the table, paragraph or text for which you want to apply the border or shading. 2. On the Format menu, click Borders and Shading Click on the Borders tab if you want to apply borders; Click on the Page Border tab if you want to apply a border to the whole page; Or Click on the Shading tab if you want to apply shading.

3. Select the options you want, and make sure the correct option is selected under Apply to. 4. To specify that only particular sides get borders, click Custom under Setting. Under Preview, click the diagram's sides, or use the buttons to apply and remove borders. 5. To specify the exact position of the border relative to the text, click Options, and then select the options you want.

5.1.16. Searching For Text The ability to search through a document and find a particular section of text or string, and if required replace it with another, is an extremely useful feature. There are varied uses for Find and Find and Replace. Finding text 1. On the Edit menu, click Find.

Faculty of Information Technology University of Moratuwa

134

Word Processing

2. In the Find what box, enter the text you want to search for.

3. Click Find Next.

5.1.17.

Replace text

1. On the Edit menu, click Replace. 2. In the Find what box, enter the text you want to search for. 3. In the Replace with box, enter the replacement text. 4. Click Find Next, Replace, or Replace All. Note: To cancel a search in progress, press ESC.

The More button displays advanced search and replace criteria. This button changes to Less while these advanced criteria are displayed. Click Less to hide the advanced criteria . 5.1.18. Header & Footer

There are usually areas set aside on a document at the top and bottom of every page that many people do not use. They are reserved for putting document headings, section headings, chapter headings, dates, author name & other author information,

Faculty of Information Technology University of Moratuwa

135

Word Processing

page numbers, references, and various other information that the author wishes to include about the document. You can increase or decrease the size of these areas from the Page Setup option on the File Menu. To bring up the Header & Footer, you activate it from the View Menu Option and then type in the text or insert from the various buttons on it. The Header

The above diagram shows the area where the Header appears.

Using the options on the Header and Footer toolbar, you have buttons for Insert Page Number, Insert Number of Pages, Format Page Number, Insert Date, Insert Time, etc. The area for the Header and Footer works on the same principle as the main document area of your documents i.e. it uses the same Horizontal Ruler, so you can set tabs, change alignments, etc., here as you do with your main text.

The Footer

Faculty of Information Technology University of Moratuwa

136

Word Processing

5.1.19.

Page Breaks

Page breaks are inserted to keep two pages separately from each other.

To add a page break 1. Position the Cursor at the place where the page break is to occur and 2. Either 3. Or 5.1.20. Press <Ctrl> & Enter Inserting Special Symbols Select Insert from the menu Click on break

You can insert special symbols such as those shown below by using the following command. 1. Select the Insert menu. 2. Click on Symbol. 3. The Symbol dialog box appears, displaying all the characters of a particular font, click the list button to the right of the Font indicator, click on Wingdings or Symbol. 4. Click on the symbol or character you require, click Insert; the special character is inserted into your text. 5. Click on the Close button to remove the dialog from your screen.

$&D</(]<
5.1.21. Inserting Clip Art into a Word document

Word comes with a clip art gallery that allows users to insert clip art pictures into documents. Depending on how Word was installed, the size and type of clip art may differ from machine to machine. This lesson will demonstrate how to insert clip art into a Word document, how to resize the clip art, how to move the clip art image, and how to crop the clip art as well. 1. Clicking Insert on the menu bar. A drop-down list appears. 2. Select Picture. A fly-out menu appears.

Faculty of Information Technology University of Moratuwa

137

Word Processing

3. Select Clip Art. The Microsoft Clip Art Gallery launches. A group image of the Microsoft Clip Art Gallery is shown below.

4. When the clip art gallery opens, you will notice a list of categories click on the category and select the picture and click to Insert.

5.1.22.

Resizing a clip art image

1. Once a clip art image has been inserted into a Word document, resizing it is a snap. Simply select the clip art image by clicking on it. 2. Once a clip art image is selected, sizing handles will appear on all four corners and all four sides like the image shown below.

Faculty of Information Technology University of Moratuwa

138

Word Processing

3. Place the mouse pointer over the sizing handles until the mouse pointer looks like a double-pointing arrow. Then drag to resize, and release the mouse pointer when finished. 4. To constrain/restrain the dimensions of the clip art image drag the corner sizing handles. Moving a clip art image

To move a clip art image once it is inserted into a document, click on the image, hold down the mouse button, and drag it to a new location.

Cropping a clip art image 1. To crop a clip art image, click on the image to select it. The picture toolbar should also appear. If it doesn't, click View on the menubar, a drop-down list will appear; select Toolbars, and then select Picture. The picture toolbar should display. An image of the picture tool bar is shown below.

2. Select the crop tool by clicking on it

3. Now, simply position the crop tool over the sizing handles, and drag the handles to a new position to crop the picture 5.1.23. WordArt Microsoft WordArt is an application that let's users add special effects to text. The program launches from within Word. 1. From within Word, click Insert on the menu bar. 2. Select Picture.

Select WordArt. The WordArt Gallery opens. A images of the WordArt Gallery

Faculty of Information Technology University of Moratuwa

139

Word Processing

is shown below. 3. Select a text modification style, and click OK. The Edit WordArt Text dialog box opens. A image of the Edit WordArt Text dialog box is shown below.

4. Type the text you want to add effect to in the area that reads, Text. 5. Click OK. The WordArt Text is inserted into your document 5.1.24. Inserting Page Numbers

1. On the Insert menu, click Page Numbers. 2. In the Position box, specify whether to print page numbers in the header at the top of the page or in the footer at the bottom of the page. 3. Select any other options you want. 4. Click where you want to insert the date or time. 5. On the Insert menu, click Date and Time. 6. To specify the format of the date or time, click a format in the Available formats box.

Faculty of Information Technology University of Moratuwa

140

Word Processing

To automatically update the date or time when you print the document, select the Update automatically check box. Otherwise, the document will always print with the original date or time. Tabulators In Word, the default setting for the tab key is at a half inch. This means that if you want a tab set to a quarter inch or at any other fraction of an inch, you've got a bit of a problem if you are not familiar with how to set and adjust tab settings in Word. Now, most can get by without knowing how to set tabs in Word, by simply striking the Tab key repeatedly until the cursor is at or close to where they want it, but if they need to adjust something later, all those tab markers can pose somewhat of a problem, because once a tab marker is changed, the alignment of the whole document can be thrown off. Also, when many users decide to type up a form that contains lines on which a client fills in personal information, they usually hold down the Shift key and strike the Underscore key repeatedly in order to create the lines. The problem with this technique is that the lines will not line up on the right-hand edge. This is because fonts such as Times New Roman are proportional type faces. With proportional type faces, each character has a different width. Therefore, if a form looks like the one below which has words typed in before the line, the right side of the lines will not be uniform. What does this have to do with tabs? Well, uniform lines in forms are created by adjusting the tab settings, and then adding what is known as a tab leader. This documentation will not only address this problem, but will also show the user how to customize the tab settings in Word. Example Name:________________________ Address:_____________________ Telephone:___________________ Below is an image of the Ruler in Word. If the ruler is not visible in Word, click View on the Menu bar, and select Ruler. The Ruler is very important, for it is used a great deal with regard to tab settings.

Located in the left-hand corner of the Word Ruler is the Tab Alignment Button. When you click on this button, it toggles between the different types of tab stops. Below is a series of images as well as the corresponding descriptions of the different types of tab stops. Keep in mind that the default is a left-aligned tab stop. Symbol Type Description When you set up a tab of this tab and jump to the point where this tab is positioned, all subsequent text you type in will be insert from LEFT to RIGHT.

Left Tab

Faculty of Information Technology University of Moratuwa

141

Word Processing

Centre Tab

When you jump to a position with a centre tab, any text you insert will move out equidistantly to both the LEFT and RIGHT hand sides of that point simultaneously i.e. the text will be CENTRED at this particular point. When a right tab is encountered, all subsequent text is inputted from RIGHT to LEFT i.e. "BACKWARDS". The decimal centre tab is used for columns of numbers. At the tab stop position with this type of tab set, all the numbers inserted here will have their whole numbers (before the decimal point) travel RIGHT to LEFT, while their decimal value (after the decimal point) travel LEFT to RIGHT, thus centring the numbers under one another about the decimal point. Inserts a vertical line at the tab stop.

Right Tab

Decimal Centre Tab

Bar Tab

5.1.25.

Setting a tab stop in Word

1. Strike the Tab key on the keyboard. Note make sure that the Show/Hide paragraph feature is on. The Show/hide paragraph feature is turned on by clicking on the Show/Hide paragraph button which is shown below and located on the Standard Toolbar. When the Show/Hide paragraph feature is on, all non-printing elements are shown such as, space markers, tab markers, and hard return markers.

2. Next, click on the Ruler in the white area anywhere you want the tab to be. Now, a tab marker is visible on the Ruler. If you want to change the placement of the tab, simply drag and drop the tab marker on the Ruler anywhere you wish and the tab setting will be changed to where the marker was left. 5.1.26. Formatting tabs by adding a Leader

1. Begin by clicking on Format on the Menu Bar, and then select Tabs. The Tabs dialog box appears. An image of the Tabs dialog box is shown below.

Faculty of Information Technology University of Moratuwa

142

Word Processing

2. On the left-hand side of the Tabs dialog box is a section that reads Tab Stop Position and a window underneath it that lists all the tab stops there on the line where the cursor is. Select the tab you wish to format with a leader. 3. Over in the right-hand-hand side of the Tabs dialog box there is a section that reads Leader. Select the type of tab leader you want by clicking on the radio button next to it. 4. Click OK, and a leader is added to your tab stop. 5.1.27. Columns

Creating Columns: Dialog Box Option

1.

Select the text to be formatted into columns OR Place cursor within text in document

2.

From the Format menu, select Columns... The Columns dialog box will appear.

Faculty of Information Technology University of Moratuwa

143

Word Processing

3.

To select the number of columns, in the Number of columns text box type the appropriate number OR Under Presets, select the appropriate option

4.

From the Apply to pull-down list, select the desired option of having columns applied to

5.

Click OK

Creating Columns: Toolbar Option 1. Place your cursor in the document where you want the columns OR Select the text to be placed in columns 2. From the Standard toolbar, click Columns A submenu appears. 3. To select the number of columns, drag across the number desired

4. Click on desired number of columns

Faculty of Information Technology University of Moratuwa

144

Word Processing

5.1.28.

Tables

Tables are an easy way to arrange and adjust columns of text and numbers, and are much more flexible than tabs. A table can be inserted at any point in your text. A table is made up of rows and columns of cells that you can fill with text and graphics. You can use tables to align numbers in columns and then sort and perform calculations on them. You can also use tables to arrange text and graphics, such as side-by-side paragraphs in a rsum. To create a simple blank table, click Insert Table, and then drag to select the number of rows and columns you want.

Create a simple table 1. Click where you want to create a table. 2. Click Insert Table. 3. Drag to select the number of rows and columns you want. Add shading to a table, a paragraph, or selected text You can use shading to fill in the background of a table, a paragraph, or selected text. 1. To add shading to a table, click anywhere in the table. To add shading to specific cells, select only those cells, including the end-of-cell marks.

To add shading to a paragraph, click anywhere in the paragraph. To add shading to specific text, such as a word, select the text. 2. On the Format menu, click Borders and Shading, and then click the Shading tab. 3. Select the options you want. 4. Under Apply to, click the part of the document you want to apply shading to. For example, if you clicked a cell without selecting it in step 1, click Cell. Otherwise, Word applies the shading to the entire table.
Faculty of Information Technology University of Moratuwa

145

Word Processing

You can use the Table AutoFormat command to add borders and shading to a table automatically. Sort a list or table 1. Select what you want to sort. 2. On the Table menu, click Sort (for a table) or Sort Text (for a list). 3. Select the options for your sort. Delete a table and its contents 1. Select the table by clicking it. 2. On the Table menu, click Delete and select Table. Merge cells into one cell in a table You can combine two or more cells in the same row or column into a single cell. For example, you can merge several cells horizontally to create a table heading that spans several columns. 1. Click Tables and Borders 2. Click Eraser want to remove. 3. A quick way to merge multiple cells is to select them and then click Merge Cells to display the Tables and Borders toolbar.

, and then click and drag the eraser over the cell dividers you

5.1.29. Sum a row or column of numbers 1. Click the cell in which you want the sum to appear. 2. On the Table menu, click Formula. If the cell you selected is at the bottom of a column of numbers, Word proposes the formula =SUM(ABOVE). Click OK if this is correct. If the cell you selected is at the right end of a row of numbers, Word proposes the formula =SUM(LEFT). Click OK if this is correct. Note: If there are any symbols or special characters this function cannot be carried out properly so make sure that there are only numbers entered. 5.1.30. Printing

You will normally print a document when it is open and being displayed on the screen. You should always view your document in Print Preview before printing, in order to check the general layout of the page.

Faculty of Information Technology University of Moratuwa

146

Word Processing

Print Preview Before you take a printout it is always a good practice to preview the printable area by clicking on the print preview icon.

1. To view multiple pages, click on Multiple pages button 2. Click on the page to Zoom in and Zoom out 3. Also you can shrink page by clicking the Shrink icon To print a whole document 1. Select the File menu. 2. Click on Print.

To change the settings of the printer click on Properties. To print more than one copy, type the number in the Copies box. To print only specific pages, give the page numbers in the Print Range box. To print only a selected text, Select the text that you want to print and click on the Selection option button.

Faculty of Information Technology University of Moratuwa

147

MS Word-Tutorial

Microsoft Word Tutorial 1 Start the Word Processor. Type in the simple letter given below. Make any necessary running corrections. Press ENTER only when starting a new paragraph and to break a sentence (For paragraphs use Word Wrapping) Chelmer Leisure and Recreation Centre Park View road Chelmer Cheshire CE9 IJS Universal gym (Europe) Ltd Hutton Brentwood Essex CM13 1XA 17 October 1997 Dear Sir Health and Fitness Centre for Chelmer Leisure and Recreation Centre. As part of my studies for my BA in business Studies, Sport and Recreation, I am conduction a project on behalf of Chelmer Leisure and Recreation Centre. Chelmer Leisure and Recreation Centre wishes to investigate the options for the enhancement of their health and fitness facilities. Currently I am approaching a number of potential suppliers with a view to collecting information on the range of equipment available in the marketplace. I would therefore be grateful if you would supply me with appropriate publicity literature and equipment specifications, together with price lists. Thank you Yours faithfully Ms S Leveridge.

Save the document as Letter1. Click on File-Save.

Faculty of Information Technology-University of Moratuwa

148

MS Word-Tutorial

Tutorial 2

Enter Letter1 in the File name box. Click on Save. Close the document, Letter1 , using File-Close. Exit from the Word Processor, by choosing File-Exit.

Start the Word Processor. Open the document called Letter1, using File-Open and selecting this file from the list displayed. Insert two blank lines before Thank You. Add the following paragraph at the end of the text of the letter, before Thank you. I shall contact you again within a few weeks for more detailed discussions if the Leisure and Recreation Centre Manager feels that your equipment might meet our requirements.

To make the document more meaningful.. Justify the paragraph areas only Increase the Font size to 15, Embolden and Underline the Heading respectively. Change the typeface to Arial Size 10 only for the paragraph areas. Delete the existing Date and Insert the Date by selecting Insert-Date and Time. Right Align the date that was inserted newly in Letter 1. Change the Line Spacing to 1.5, only for the Second paragraph using FormatParagraph-Indents and Spacing. Use Left Indentation from Format-Paragraph-indents and Spacing to move the conclusion of the letter 4cm towards the Right side of the document. Save the new file using File-Save As, but this time using the file name Letter2.doc Close the document Letter2.doc. You should now have two files, Letter1, and Letter2. Using File-Open again check that time is so. Click on Cancel to close the dialog box. Tutorial 3 Start a new document to create a front page for the report. Select Arial point size 15 for the name of the institution. For the title, select Centre Alignment by clicking on the appropriate icon. Key in the words Environment & Project using Times New Roman, Embolden, Italic, 15pts. Press ENTER. For the man title use Times New Roman, Bold, 16pts. Select Right Alignment. Using Arial, Italic, and 14pts key in the author, tutor, course and date. Insert a picture for the front page by clicking on Insert-Picture-Clipart. Select the clipart you require and click on Insert.

Faculty of Information Technology-University of Moratuwa

149

MS Word-Tutorial

Correct the size of the picture using the double headed Arrow handles at each Corner Change it to a Watermark using Image Control in the Picture toolbar. Add the necessary formatting to adjust the Picture to fit the report cover using FormatObject Change the print orientation to Landscape on (A4 Size paper) Using Print-Page SetupPaper size. Click on File-Print and print the document Save this document as Front.

the Manchester Metropolitan university Crewe + Lasager Faculty Environment & Enterprise Project
The Refurbishment of the Multi-Gym into a fitness Suite at Chelmer Leisure and Recreation Centre A Feasibility Study

By: Sarah Leveridge Tutor: R. S. Symmond Course: HND Business and Finance Date: 1st February 1996
Tutorial 4 After tying heading click on Formats-Bullets & Numbering. Select the Bullets tab and select the appropriate bullet and click on OK.

FINDINGS FROM MARKET RESEARCH Information has been collected from the returned questionnaires resulting in: A consensus of opinion that present facilities are inadequate and that attendance is poor The numbers of users, particularly female, would increase if the facility was refurbished The majority of users are car owners, so promotion ins wider area could attract new clients

Faculty of Information Technology-University of Moratuwa

150

MS Word-Tutorial

Nearly two thirds of the people surveyed had never used the existing multi-gym Aerobic activities were popular Entertainment, such as satellite television, would be an attraction in the new fitness suite Save the document as Bullets.doc Make a copy of the above information to a New Document by clicking on File-New Change the bullets of the copied document into Numbering by clicking on FormatBullets & Numbering. Save the new document as Numbering.doc.

Tutorial 5 Open a new document. Type in the heading below. Create a table either by using Table-Insert Table command or the TABLE button, with three columns and one row (1x3). Enter the text into columns, moving between columns using the TAB button. Also use the columns do so by dragging the column boundary. Save the document as Fatlim. How much fat is the limit? Type of fat Saturated 12.5st(80kg) man Inactive 28g Quite active 35g Very Active 42g 9.5st (61kg) woman Inactive 22g Quite Active 27g Very Active 31g

Other fats 68g 82g 97g 51g 63g 74g

Tutorial 6 With a new document open: type in the following text, working on one line at a time and using the TAB key to move between one column and the next. Opening Times Health Suite Monday Tuesday Wednesday Thursday

9.00am 9.00am 9.00am 9.00am 1.00pm

9.00pm 9.00pm 9.00pm 1.00pm 9.00pm

Ladies Only Mixed Mixed Ladies Only Mixed

Save the document as Times. 151

Faculty of Information Technology-University of Moratuwa

MS Word-Tutorial

Move the pointer tot e end of the existing text and set the tabulator as indicated below: A left tab as 1.00 (2.5cm) A centre tab at 2.50 (6.5cm) A right tab at 4.00 (10.25cm) Click on the TAB button on the ruler and choose the appropriate tab type. Point to where you wish to place the tab on the ruler and click to place the tab stop at that point. Type in the text, sing the Tab key to move between tab stops. Health Suite Passcards Gold Passcard. Use all our facilities Suite, Fitness Suite, Pool and Oasis. 3 Month Gold Pass 6 Month Gold Pass 12 Month Gold Pass

including the health $85.00 $150.00 $275.00

Tutorial 7 Open a new document and try setting up and using the following Auto Correct entries. Using Tools-AutoCorrect. Replace Am w u With Americans women un-married

Cleanliness Americans put a great deal of emphasis on personal cleanliness. Most Americans are very sensitive to the smells and odors of the human body --- sometimes their own, but especially someone elses. For this reason, most Americans bathe once a day and sometimes more during hot weather or after strenuous exercise. Americans are also very concerned about having clean hair and fresh breath. Friendship & Dating Americans are generally considered open and warm people who make new acquaintances easily. Americans often have many casual and informal relationships and few lasting friendships. However, in spite of this, many Americans are quite capable and more than willing to take the extra step to establish an enduring friendship. Americans women have more personal freedom than women from some other countries and are not usually shy with Americans or foreigners. It s not unusual for un-married women in the US to live by themselves, share living quarters with other un-married women, or go to public places without a male companion.
Faculty of Information Technology-University of Moratuwa

152

MS Word-Tutorial

Using the replace facility Click on Edit-Replace to find all occurrences of the following words and replace them with alternative words as shown below. Eg. Replace the - (Hypen) with a (space) for the text un-married.

Find What Replace With Americans French women Men unmarried Married Insert a Header using View-Headers and Footers with the text European Relationships Save the document as Americans.doc. Tutorial 8 Open the file Americans.doc using File-Open. Copy the contents starting with Cleanliness to a new document. Remove Existing borders (if any) using Format-Borders and Shading and insert the Heading Relationships using Font Size 26, Embolden, Italics and Typeface as Times New Roman on the upper left corner of the document. Highlight the contents starting with Cleanliness.. (Note : Make sure to highlight only the text area) and convert the existing text to columns using Format-Columns(Use three columns) Delete the existing header and insert a new Header using View-Header and Footers with the text shown below in the Header area. Do the necessary character formatting to the header area as shown below. Click on Close using the Headers & Footers Toolbar. Insert a clipart after heading Friendship & Dating, use an appropriate wrapping technique to adjust the picture. Use Drop Cap for the very first letter for the paragraph using Format-Drop Cap. Create the below shown table using Table-Insert Table on the same page of the document. Center the table suing Table-Cell Height and Width. Insert a page break between the table and the paragraph using Insert -Page break. Using a Footer, number the pages using Insert-Page numbers , select Right Alignment and change Number Format to Roman Numbers (Eg I, II, IV) using the Format tab. Embolden the page numbers which was inserted in the Footer. Change the case of the selections of the columns to Title Case using Format-Change case. Spell check the document using Tools-Spelling & Grammar. Save the new document as Relaionships.doc.

Faculty of Information Technology-University of Moratuwa

153

MS Word-Tutorial

TIMES Edition 45 Vol. 9 Relationships..


Cleanliness Rench Put A Great Deal Of Emphasis On Personal Cleanliness. Most French Are Very Sensitive To The Smells And Odors Of The Human Body --Sometimes Their Own, But Especially Someone Elses. For This Reason, Most French Bathe Once A Day And Sometimes More During Hot Weather Or After Strenuous Exercise. French Are Also Very Concerned About Having Clean Hair And Fresh Breath. Friendship & Dating French Are Generally Considered Open And Warm People Who Make New Acquaintances Easily. French Often Have Many Casual And Informal Relationships And Few Lasting Friendships. However, In Spite Of This, Many French Are Quite Capable And More Than Willing To Take The Extra Step To Establish An Enduring Friendship. French Men Have More Personal Freedom Than Men From Some Other Countries And Are Not Usually Shy With French Or Foreigners. It S Not Unusual For Married Men In The US To Live By Themselves, Share Living Quarters With Other Married Men, Or Go To Public Places Without A Male Companion. Continued Next Week ..

Countries

Americans

Japanese

German

Subjects of Evaluation
Cleanliness Friendship Dating Marriage Divorce

L M H L H

M M H M H

H H H H L

L L H H H

L L L H M

L L H H H

Faculty of Information Technology-University of Moratuwa

African

French

Indian

154

MS Word-Tutorial

Key L- Low rate M Medium rate H High rate

Faculty of Information Technology-University of Moratuwa

155

Spreadsheets

Unit 5.2 Spreadsheets


5.2.1 Introduction to Excel Microsoft Excel is a powerful spreadsheet package, which is used for a wide variety of accounting purposes. Excel is packed with features that will make your work easier and faster to do. With new innovations in charting, list management, data analysis, application development & other areas, even the most complex tasks seems effortless. Some examples of spreadsheets are:

Cash flow analysis Budgeting Cost estimating Financial reporting Starting Microsoft Excel

5.2.2 Method 1

Double click on the Microsoft Excel icon on the desktop.

Method 2

Faculty of Information Technology University of Moratuwa

156

Spreadsheets

Click on Start Program Microsoft Excel

An Excel document is referred to as a workbook and is made up of individual worksheets. When you create a new workbook, Excel calls it Book1, Book2, etc. until you name the workbook by saving it with the Save As command (just as Word named new documents Document1, Document2, etc.). By default, a new workbook contains 3 blank worksheets when you create it, named Sheet1, Sheet2, and Sheet3; however, you can add or delete worksheets and rename them to something meaningful.

Nam

Formula

Standard tool Formatting tool

Columns

Rows

Office Assistant (help)

Work Sheets

Formula and Function

Drawing Tool bar

Formula Bar

Displays the contents of the active cell. 157

Faculty of Information Technology University of Moratuwa

Spreadsheets

Name Box

Appears to the left of the formula bar and displays the cell reference for the active cell. The rectangular area where a column and a row intersect. Identifies a cell by its column and row. (B6, A2, H7, etc.) The currently selected cell. A bold border outlining the cell identifies the active cell, and its name (cell reference) is displayed in the Name Box.

Cell Cell Reference Active Cell

Each worksheet has a sheet tab that identifies the worksheet and allows you to select it and make it the active sheet. If you have more worksheet tabs than will fit on the viewable window, you may use the sheet tab scroll buttons located to the left of the sheet tabs to scroll through the worksheet tabs.

5.2.3

Order of Operations Excel Uses

Precedence 1 2 2 3 3 4 5 5 5

Operation Exponentiation Multiplication Division Addition Subtraction Concatenation (putting 2 strings together, like Jenn & ifer) Equal To Greater Than Less Than

Operator ^ * / + & = > <

5.2.4

Moving around the worksheet: Using the Keyboard

1. Arrow keys move the active cell one cell left, right, up, or down 2. PgUp moves the active cell up one screen-full 3. PgDn moves the active cell down one screen-full 4. Home moves the active cell to the cell in column A of the current row 5. Ctrl+Home moves the active cell to A1

5.2.5 Selecting a range 1. Click in the first cell of the range and drag across the entire range while holding down the left mouse button.
Faculty of Information Technology University of Moratuwa

158

Spreadsheets

2. Click on the extreme top left most buttons. Cell Contents A cell can contain one of three types of content: Text: Any combination of letters, numbers, symbols, and spaces, used to label and define the worksheets data. Text is typically used for the worksheets title, and to label its rows and columns. Values: Numbers, dates, and times that can be used for calculations. Note that a number in a cell can be either a value or text; the key difference is that text is not used for calculations, and values are. So if the number 2002 is used to label a column containing budget projections for the year 2002, it is text. But if that same number 2002 is the number of students in a colleges 1st year class, it is a value. Formulas: Arithmetic expressions used to perform calculations; the result of the calculation is displayed in the cell containing the formula. Excel formulas begin with an equal sign and can contain any or all of the following components: o Numbers o Arithmetic Operators (+, -, *, /, etc.) o Cell References or Ranges (A5, C7, D5:D9) o Functionspredefined or built-in formulas used as shortcuts for commonly used calculations. For example, =SUM(F11:F15) would be a shortcut for the formula =F11+F12+F13+F14+F15. A function includes a keyword (such as SUM, MAX, or MIN) followed by one or more arguments enclosed in parentheses. In the example above, the argument is the cell range F11:F15. Correcting Mistakes

5.2.6

To correct a mistake when typing, you may use the backspace key. If you want to change the value in a cell: 1. Select the cell 2. Retype the contents or Edit the cell To edit a cell: 1. Make the desired cell the active cell. 2. Double click and perform edits or perform the edits in the formula bar. The F2 key may be used as opposed to the double click to send the cell into edit mode. To clear cell contents 1. Select the cell and press the delete key, or use the Clear Contents command on the Edit menu.

Faculty of Information Technology University of Moratuwa

159

Spreadsheets

Changing Column Width and Row Height 1. Select the column(s) or Row(s) that need to be resized by clicking on any cell in the column(s) or Row(s) 2. Select Format on the Menu Bar, then find and select Column or Rows. 3. If you desire to Autofit the column or Row, select Autofit selection. Or, if you desire to specify the column width or row height do as follows:

4. After the above step, in the new submenu select Width or Height. 5. In the column width or row height dialog box, enter the new column width and row height. 6. You can Autofit a column contents by double clicking the border of the column letter. Inserting Rows and Columns 1. Select the cell(s) close to which you want to insert a Row or Column. Remember that Rows will be inserted above that point and Columns will be inserted to the left of it. 2. Select Insert on the Menu Bar, and then select Rows or Columns depending on what you need. Deleting Rows and Columns 1. Select the Row(s) or Columns, which you want to delete. 2. Select Edit on the Menu Bar, and then select Delete. 3. Select Entire Column or Entire row 5.2.7 Autosum Automatically gives the sum(total) of a range of cells which contain numeric values. 1. To put the sum immediately next to the range of cells, select the range of cells of which you want the sum or keep the cursor where you want the sum
Faculty of Information Technology University of Moratuwa

160

Spreadsheets

2. Click Autosum icon

from the Tool bar or Press Alt + = from the keyboard.

5.2.8

Copying and Pasting Formulas

You can copy a formula from one cell to another using Copy and Paste, just as you can copy text in Word. When you select a cell and click the Copy button, the formula in the cell is placed on the Clipboard. When you then select another cell and click the Paste button, the formula in pasted from the Clipboard into this new cell. 5.2.9 Using the Fill Handle to Fill a Series of Cells

When you select a cell (or range of cells), a small black square appears at the bottomright corner of the cell (or range); this black square is called the fill handle. (When you move your mouse pointer over the fill handle, the pointer will become a large black plus (+) shape.) If you click and drag the fill handle over a range of cells, the cells in that range will be filled. What they are filled with depends on the contents of the cell (or range) you selected before performing the fill: 5.2.10 Relative Cell References in Copying a Formula

1. Consider for example that, the contents in cell A3 are a result of application of the formula =A1+A2. 2. Click the left mouse button on the cell A3. 3. Notice the formula bar. The formula =A1+A2 appears there. 4. Using one of the copy commands copy the contents in cell A3 to B4 (in this case you are copying the formula). 5. Then click on cell B3. Notice the formula bar. The formula that appears in the formula bar shows =B1+B2. 6. Thus it is clear that Excel has adjusted the cell references to suit the new locations. Absolute Reference 1. To make a cell reference absolute, you need to place the dollar sign before the coordinates of the "pointed" cells. 2. You can obtain this result by typing the dollar signs in the appropriate position while you are typing the formula. 3. An alternative way is to highlight the cell reference and press the F4 key on the keyboard. 4. To confirm the function press the Enter key.

Faculty of Information Technology University of Moratuwa

161

Spreadsheets

5.2.11 Formatting Cells Formatting Numbers 1. Select the cell(s) that contain the number(s) to be formatted. 2. Select Format on the Menu Bar, then Cells. 3. Select the Number tab. 4. Select the desired formatting options (e.g. Currency option / Select the desired currency) 5. Click the OK button to apply the format.

Using Borders 1. Select the cells to be bordered. 2. Select Format on the Menu Bar. 3. Select Cells. 4. Click on the Border tab.

Faculty of Information Technology University of Moratuwa

162

Spreadsheets

5. Choose the Style and Coluor that you desire. 6. Click OK. OR 1. Highlight the cells to be bordered. 2. On the Toolbar, click the arrow on the Borders button. 3. Select the border style that you desire. 4. Click the required borders in the border box given on left. 5. Click OK Aligning Cell Contents 1. Select the cells you want to format. 2. From the Format menu, choose Cells. 3. Select the Alignment tab. 4. Select the alignment options you want. 5. Choose the OK button. 6. Click any cell to deselect the range and view the aligned cells.

For Simple horizontal alignment 1. Select the cells you want to format. 2. Click the Align Left , Center , or Right button. 3. Click any cell to deselect the range and view the aligned cells. Formatting font 1. Select the cells you want to format. 2. From the Format menu, choose Cells.

Faculty of Information Technology University of Moratuwa

163

Spreadsheets

3. Select the font tab. 4. Select the font / font style / size / underline etc. 5. Click OK to apply

For simple formatting 1. Select the required cells to format 2. Use font, size in formatting toolbar Centering text across Columns 1. Select a range of cells (including the one with the information that you need to center) across which you want to center the data. 2. From the Format menu, choose Cells. 3. Select the Alignment tab. 4. Under Horizontal, select the Center across Selection option button and click OK button 5. Click any cell to deselect the range. OR 1. Select a range of cells (including the one with the information that you need to center) across which you want to center the data. 2. Click the Center across Columns button Patterns 1. Select the cells you want to format. 2. From the Format menu, choose cells. 3. Select the patterns tab. 4. Select the colour . 5. Click OK to apply
Faculty of Information Technology University of Moratuwa

164

Spreadsheets

AutoFormat Several formats which are already available in excel can be applied automatically using autoformat. 1. Select the required cell range. 2. To select the cells to be formatted, click on the upper-left corner of the range of cells and hold the button down while dragging the pointer to the lower right corner of the range and release it. 3. Click Format on the Menu Bar, go down to AutoFormat. 4. Select a format style from the pop-up list. A sample of the selected style will appear in an adjacent box.

5. Click Options button to apply further settings 6. Click the OK button to apply the format.

Faculty of Information Technology University of Moratuwa

165

Spreadsheets

5.2.12 Formula and Functions What's the difference between a formula and function? A formula is an algebraic expression using numbers, math operators and cell addresses. E.g. In cell A4 we could enter the formula =A1+A2+A3 this would, obviously, add up all the numbers in the first three cells and enters the total in cell A4.

A function, on the other hand, is a ready-made formula that performs a series of operations on a specific range of cells. Taking the above situation, instead of using the Excel formula we could use the SUM function instead. This is entered as =SUM (B1:B3), which, in plain English, says, adds up the values in the cell range B1 through to B3. Function If you are familiar with the function you wish to use then simply type the function into the cell where you want the result displayed. For example, you wanted to use the SUM function to add up the values in cells C1, C2 and C3 and display the result in C4. Here's what you do. 1. Select cell C4 by clicking in it. 2. Type =SUM (C1:C3) 3. Press Enter Or 1. Select cell C4 by clicking in it. 2. Click AutoSum con on the toolbar. 3. Select the range 4. Press Enter. Paste Function 1. Select cell C4 by clicking in it. 2. Click on the Paste Function button.

3. When the Paste Function dialogue box appears select "Math and Trig" on the left hand side or all functions. 4. On the right hand side select SUM.

Faculty of Information Technology University of Moratuwa

166

Spreadsheets

5. Click OK.
6.

Notice that in the dialog box that C1:C3 has been selected automatically or Select the range.

7. To complete this action just click on OK. The result is displayed in cell C4.

5.2.13 Charts Charts allow you to present data entered into the worksheet in a visual format using a variety of graph types. Before you can make a chart you must first enter data into a worksheet. This page explains how you can create simple charts from the data Creating A Chart
Faculty of Information Technology University of Moratuwa

167

Spreadsheets

1. Click on the Chart Wizard button or Inset Chart menu.

2. Select the type of chart you want from the Chart type list at the Standard tab

3. Select the sub type and click on the Next button. 4. Select the data range from Chart Source data by placing the cursor in the data range textbox 5. Click on the Next button.

Faculty of Information Technology University of Moratuwa

168

Spreadsheets

6. In the chart option: set options at the various tabs or Update the Chart Options Titles: of chart and axes.

Axes: whether the X and/or Y axis are shown. Gridlines: whether major and minor gridlines, horizontal and vertical, are shown. Legend: where is is placed, if anywhere. Data Labels: what labels, if any, are attached to bars, for example. Data Table (if present): whether to show also a table of the data values.

7. Then, click on the Next button. 8. Select whether you want the chart to appear on a separate worksheet or on the same worksheet. Then, click on the Finish button.

Note Make any further adjustments to parts of the chart by clicking on them. You can delete a selected element, such as the legend, by pressing the "Delete" key. To change the text of a selected element, click on it again to enter text editing mode. Right clicking on an element brings up a menu that allows you to make other changes to it.
Faculty of Information Technology University of Moratuwa

169

Spreadsheets

To print out a chart, first click on it to select it (you should see "handles" at the four corners of the chart). Then, select FilePrint. Filters

5.2.14

Filtering is a quick and easy way to find and work with a subset of data in a list. A filtered list displays only the rows that meet the criteria you specify for a column. Microsoft Excel provides two commands to filter lists: AutoFilter, which includes filter by selection, for simple criteria. Advanced Filter, for more complex criteria unlike sorting, filtering does not rearrange a list. Filtering temporarily hides rows you do not want displayed. When Excel filters rows, you can edit, format, chart, and print your list subset without rearranging or moving it. Display a subset of rows in a list by using filters 1. Click a cell in the list you want to filter. 2. On the Data menu, point to Filter, and then click Auto-Filter.

3. To display only the rows that contain a specific value, click the arrow in the column that contains the data you want to display. 4. Click the value. 5. To apply an additional condition based on a value in another column, repeat steps 3 and 4 in the other column. To filter the list by two values in the same column, or to apply comparison operators other than Equals, click the arrow in the column, and then click Custom.

Faculty of Information Technology University of Moratuwa

170

Spreadsheets

6. 7.

Select the condition Click OK.

5.2.15

Sorting

Since keeping track of records is a common use of spreadsheets -- like records of expenditures, student grades, attendance information, and data from research studies - it is not unusual to want to change the order of the information (or records There are two ways to sort in Excel -- using the "Sort" buttons and using Data, Sort. The method you use will depend on the layout of your data and how many criteria (columns) you want to sort by. Before sorting, it is a good idea to save a current copy of your spreadsheet as a precaution. Sorting Using The Sort Dialog Box You can use the "Sort" dialog box if you want to sort by multiple criteria (up to three columns), or if you have rows that you want ignored in the sort. To select only some cells in a contiguous block, 1. Highlight the cells to be sorted (this would include all the columns but not necessarily all the rows). 2. Click on Data on the menu bar, and select Sort.

Faculty of Information Technology University of Moratuwa

171

Spreadsheets

3. The resulting "Sort" dialog box has a radio button at the bottom to indicate whether or not your list has a header row. Check whichever is appropriate. There are three dropdown menus for indicating the sort criteria. Clicking on the down arrow in each of these windows shows a list of the column headings. You can pick one and select the radio button of Ascending or Descending. Note: If you do not highlight cells before bringing up this dialog box, Excel will sort the entire contiguous block in which your active cell is located. The "Sort" dialog box option would be most useful in larger files with many columns, since the "Sort" buttons only let you pick one column to sort by.

Faculty of Information Technology University of Moratuwa

172

Spreadsheets

Microsoft Excel
Tutorial 1 The worksheet is based on a students income and expenditure for a term. Enter the data exactly as shown below.

Using the Spell Checker through Tools-Spelling and Grammar correct the spelling for the text Accomodation Alter the text in cell A5 from Loan to Bank Loan. (You could achieve this by moving the cursor on the text and pressing the F2 key or by clicking twice on the text which is to be altered) Alter the text in cell A11 from Food to Food and Travel Change the column width of column A to 15 using Format-ColumnsWidth. Change the Row Height of Row 1 to 15 using Format-Row-Height. Calculate the Total Income in cell C7 using the SUM function (The result should be 1200) Calculate the Total Expenditure in C14 using the SUM function (The result should be 185). In cell A16 enter the text CLOSING BALS. In cell C16 enter the formula to deduct the Total Expenditure from Total Income (The result should be 015)

Formulae: Closing Bals = Total income Total expenditure The worksheet should appear as shown below.

Faculty of Information Technology University of Moratuwa

173

Spreadsheets

Save the workbook as TERMS.xls Using the Fill method copy the contents of C2:C16 to COLUMN D. Delete the values from D4 to D6 because these incomes vary every week. Carry the Closing Bals. From Week 1 to the Opening Bals. in Week2 by typing =C16 in cell D3. Make the following amendments to Week2 Food and Travel 35 Books 15 Using Week 3 as the model, use the Fill method to make the worksheet for the following three weeks up to Week 5. The Closing Bals at the end of Week 5 should be 495.

Save the workbook again and exit Excel.

Tutorial 2 Open the workbook you created in the last tutorial. Select the entire rows 1&2 and make them Embolden. Select column A and make the labels Embolden. Select column a again and change the Font size to 8. Select the range C3: C16 and center the values. Select the range C3: C16 again and format them to the Currency. Delete column B and Format the decimal places in the currency Section to Zero decimal places. 174

Faculty of Information Technology University of Moratuwa

Spreadsheets

Insert a new row between Row 1 and Row2 Select the range A1 : F1 and center the heading across the columns.

Switch off the gridlines using Tools Options. Apply a bottom border for Row 9 and Row 16. Apply a Right border for Column A. Freeze the columns on the left and the rows on top of cell B4. Insert drawing objects (text boxes) and apply formatting as show below.

Tutorial 3 Prepare the worksheet given below and calculate the Total & Average Marks (XXX represents the calculation) Using the functions you have leant find the Maximum, Minimum and Number of Students (Using Max, Min, Count functions)

Faculty of Information Technology University of Moratuwa

175

Spreadsheets

Format the Average column to Two decimal Places. Give the heading as Grade for column G. using the If function find the Grade fro each student using their Average following the condition given below. If the student Average is greater than 50 the Grade is awarded as Pass & the student Average is less than 50 the Grade is awarded as Fail

Save the worksheet as Students

Tutorial 4 Create the following worksheet as shown. Format it as shown, i.e. data centered in columns, column widths adjusted, and headings and labels in Embolden. Total the first column in cell B12. Copy the formula to the other cells.

Calculate the totals across in a similar way. As a check the Grand total for all the holidays should be 3573. If not check your data! Save the workbook as EURO SALES.xls Create the following chart. Set the chart and Axis titles as shown. Switch off the legend. Insert the chart as a new sheet and name the sheet as Qtr 1 Bar.

Faculty of Information Technology University of Moratuwa

176

Spreadsheets

1st Quarter Holiday Sales


200 Number Sold 150 100 50 0 Italy Spain Portugal Country Greece France

Make a copy of the chart in a new sheet and name it as Qtr 1 Pie. Change the chart type to a Pie Chart. Switch on the legend. Explode the slice for Greece. Insert Data Labels as percentage values.
1st Quarter Holiday Sales

12%

14% Italy Spain

29%

25%

Portugal Greece France

20%

Insert a line chart to compare the sales for Italy and France for the 4 quarters as shown.

Faculty of Information Technology University of Moratuwa

177

Spreadsheets

300 250 200 150 100 50 0 1st 2nd 3rd 4th Quarter Quarter Quarter Quarter Italy France

Change the marker styles to circles and triangles as shown.

Insert a 3D bar chart as shown below for the countries & and the four quarters.

400 350 300 250 200 150 100 50 0


Italy Spain Portugal Greece France

1st Quarter 2nd Quarter 3rd Quarter 4th Quarter

Faculty of Information Technology University of Moratuwa

178

Presentation

Unit 5.3 - Microsoft PowerPoint


5.3.1 Introduction to presentation Microsoft PowerPoint is a powerful tool to create professional looking presentations and slide shows. PowerPoint allows you to construct presentations from scratch or by using the easy to use wizard, which can help you in creating presentations quickly and easily. The display of Information is a very important aspect of any presentation. Most speakers use slides for displaying information. In addition to slides you may also require; Handouts A set of notes and an outline of your presentation

These can be made using the slides you created for the presentation. In order to make the presentation effective you need to: Know your audience Keep the content simple Start with the familiar visuals Make each slide independent Use space effectively Use text and colour effectively

5.3.2

Starting Microsoft PowerPoint

Method 1

Double click on the Microsoft PowerPoint icon on the desktop.

Method 2 Click on Start Programs Microsoft PowerPoint

Faculty of Information Technology University of Moratuwa

179

Presentation

5.3.3

Creating a New Presentation

After you open up Microsoft PowerPoint, a screen pops up asking if you would like to create a New Presentation or Open An Existing Presentation

You can select either of the following options, AutoContent Wizard Creates a new presentation by prompting you for information about content, purpose, style, handouts, and output. The new presentation contains sample text that you can replace with your own information. Template Creates a new presentation based on one of the PowerPoint design templates supplied by Microsoft. Blank Presentation Creates a new, blank presentation using the default settings for text and colors. Opening a existing presentation You can open an existing presentation and edit or show it.

Faculty of Information Technology University of Moratuwa

180

Presentation

5.3.4

Creating a Blank Presentation

After you select Blank Presentation a window pops up asking you to select the layout of the first slide.

Pre-Designed Slide Layouts (Left to Right) Title Slide Bulleted List Two Column Text Table Text & Chart Chart & Text Organizational Chart Chart Text & Clip Art Clip Art & Text Title Only Blank Slide

Faculty of Information Technology University of Moratuwa

181

Presentation

5.3.5

Auto Layout

This is an Auto Layout of a presentation slide. The boxes inside are called Placeholders. To enter Text, Picture, and Chart etc. inside them, clicks inside then they will be activated.

Placeholders

5.3.6

Slide Manipulation

Inserting Text and Pictures Text Boxes

By using Text Boxes you can add text to any place of your slide. (With no need for an existing Placeholder.)

Click the Text box button on the Drawing toolbar. The mouse pointer will turn into a cross hair. Click where you want the paragraph to start and drag and draw the box to the size you want. Enter your text inside, click outside it when you are finished.

5.3.7

Inserting Clipart or Pictures

1. Display the slide you want to add a picture to. Click Insert at the top of the screen
Faculty of Information Technology University of Moratuwa

182

Presentation

2. Select Picture, Select Clip Art

3. Click the category you want, click the picture you want 4. Click Insert Clip on the shortcut menu When you are finished using the Clip Gallery, click the Close button on the Clip Gallery title bar Steps 1-4 are very similar when inserting other Pictures, Objects, Movies, Sounds, and Charts

5.3.8

Formatting Text

You can format text in PowerPoint using a variety of fonts, font sizes, emphasis (bold, Italic, underline, shadow, colour, bullets, and line spacing). You can easily apply formatting to selected text using the buttons on the Formatting toolbar.

5.3.9

Inserting A New Slide

1. Click Insert at top of screen 2. Select New Slide . 5.3.10 Formatting A Slide Background

You can format your slide to make it to your need, whether it be a background color, picture, or a design template built into Microsoft PowerPoint. The next step will show you how to apply a Design Template, and the other items mentioned above can be accomplished the same way. 1. Click Format menu.

Faculty of Information Technology University of Moratuwa

183

Presentation

2. Select Apply Design Template

3. Select the Design you wish to apply

4. Click on Apply Button.

Faculty of Information Technology University of Moratuwa

184

Presentation

Colour Scheme A set of eight balanced colors you can apply to all slides, an individual slide, notes pages, or audience handouts. A color scheme consists of a background color, a color for lines and text, and six other colors designed to make slides easy to read.
Create a colour scheme

1. On the Format menu, click Slide Color Scheme, and then click the Standard tab. 2. In the Standard color palette, click the color you want, and then click OK. 3. To apply the new color to only the current slide, click Apply. 4. To apply it to all slides in the presentation, click Apply to All.

5.3.11

PowerPoint Views

There are different views within Microsoft PowerPoint that allow you to look at your presentation from different perspectives. Normal view Slide sorter view Notes pages view Slide show view Outline view

You can switch between them by using view buttons at the left of the Horizontal scroll bar or by View menu in the menu bar.

Faculty of Information Technology University of Moratuwa

185

Presentation

Views Normal View

Icon

Outline View

Description Switches to normal view, where you can work on one slide at a time or organize the structure of all the slides in your presentation Switches to outline view, where you can work with the structure of your file in outline form. Work in outline view when you need to organize the structure of your file. Switches to slide view, where you can work on one slide at a time Displays miniature versions of all slides in a presentation, complete with text and graphics. In slide sorter view, you can reorder slides, add transitions, and animation effects. You can also set the timings for electronic slide shows. Runs your slide show in a full screen, beginning with the current slide if you are in slide view or the selected slide if you are in slide sorter view. If you simply want to view your show from the first slide: 1. Click Slide Show at the top of the screen 2. Select View Show

Slide View

Slide Sorter View

Slide Show View

Faculty of Information Technology University of Moratuwa

186

Presentation

5.3.12

Changing the Layout of a Slide

When you are developing your presentation perhaps you might want to change the layout of a slide or slides. To change the layout of the current slide in Slide View or Slide Sorter View, click the Slide Layout button on the common task toolbar and choose the layout you want and click Apply. Then PowerPoint will add all the elements on the current layout to the new one. Things may be a mess, with elements overlapping each other. Drag them to suitable positions or resize them. Rearranging your Slides 1. If you want to change the order of appearance of your slides you can use the Slide Sorter view. 2. To select, click button shown here which is on the Horizontal scroll bar or select View. To rearrange slides, click on the slide you want to move and drag it to the left/right of the slide, where it should appear.

Faculty of Information Technology University of Moratuwa

187

Presentation

5.3.13

Notes Page

Creating Notes Pages

PowerPoint allows you to add speakers notes to your presentation to elaborate more on your idea. It will help you to deliver the information in your slide more effectively. Click the Note Pages button or select View Note Pages

1) In Note Pages view you will see the current slide at the top of a page with space underneath. 2) Enter your speakers notes in that space. 3) Use the Previous slide and Next slide buttons to move between slides. Previewing the Slide Show 1. Click the Slide button. 2. It will show your slides one by one taking the full screen 3. Press N for the next slide, P for the previous slide.

5.3.14

Inserting Objects in a Presentation

Graph or Chart You can do it in two methods. Use Microsoft Graph window to create a graph from scratch. OR Create it in Excel and paste it in your slide.

Creating a Graph from Scratch To create a graph from scratch on the current slide 1. If the slide has a graph placeholder double clicks it. Otherwise click the Insert Graph button on the standard toolbar. PowerPoint will display the Graph sample datasheet and graph. 2. Drag through the rows in the datasheet that contains the sample data and delete it by pressing Delete or right clicking and choosing Clear Contents from the context menu. 3. Enter your own data in the datasheet just as you would in an Excel spreadsheet. The graph window will graph your data as you enter it. 4. Format your graph using the menus and the toolbars. Graph works like a stripped down version of Excel. 5. Close the datasheet by clicking its close button. To return to the slide, click elsewhere in it.
Faculty of Information Technology University of Moratuwa

188

Presentation

Inserting an Organization Chart Double click on the Organization Chart placeholder or choose Insert Object and choose MS Organization Chart and click OK. Create your chart in the Organization Chart applet.

1) Select File, Update Presentation. 2) Choose File, Exit to add the chart to the slide.

Faculty of Information Technology University of Moratuwa

189

Presentation

5.3.15

Animating an Object

1) Select the object. 2) To set Preset Animations, choose Slide ShowPreset Animations. 3) Select the type of animation from the sub menu and click OK. 4) To set Custom Animations right click on the object and choose Custom Animations from the context menu. 5) Select the type of animation you want and click OK.

5.3.16

Transitions

Transitions are visual effects that animate the changeover from one slide to the next, you can accompany them with sounds, and you can run many of them at varying speeds. You can also assign timings to slides, so that PowerPoint automatically advances the presentation after the selected number of seconds, leaving you free to roam in the room and give your accompanying speech.

Assigning a Transition to a Slide 1) Switch to Slide Sorter View. 2) Right click on the slide you want. 3) Select Slide Transitions from the context menu. OR 4) Select a Slide 5) Click on Slide Show menu 6) Select Slide Transition 7) You will see this dialog box.

Faculty of Information Technology University of Moratuwa

190

Presentation

Assign the transitions and click Apply to apply to the current slide or Apply All to apply to all the slides of your presentation.

5.3.17

Saving the Presentation

1. Saving the existing presentation by clicking on save button or File Save as.

2. Key in the name of the file in the file name text box. 3. Select the location to save 4. Click Save.

Faculty of Information Technology University of Moratuwa

191

Presentation

5.3.18

Arranging slides for Printing

1) Select File, Page Setup you will see this dialog box. 2) Make your choices and click OK.

5.3.19

Printing

1) Choose File, Print.

2) Select the Printer and Print range 3) Select the other options such as copies/collate/ handouts etc you want. 4) Click OK.

Faculty of Information Technology University of Moratuwa

192

Presentation

Tutorial 1 Task 1 is: You are given a THREE page presentation for a school. Insert the Current Date on the bottom right hand corner of all the pages. Type the different departments/sections in your school(use bullets on each department) in the first slide. In the second slide type a general description about your own school. In slide three type the heading <<It is the Key fro the next Millennium>> insert a suitable clipart under the heading. Using slide show, sow the presentation on the screen.

Tutorial 2 Insert an appropriate background. Use appropriate font style and size for the presentation. Save the presentation file as <<Internet>>. Make the title font size to size 32 in all the three slides.

Slide 1 Text Title << Mission Statement >> Body << A clear statement of your companys long-term mission. Try to use words that will help direct the growth of your company, but be as concise as possible. >> Slide 2 Text Title << Body <<

The Team >> *List CEO and key management *Include previous accomplishments to show these are people with a Record of success. *Summarize number of years of experience in this field. >>

Slide 3 Text Title << Body <<

Market Summary >> Market : past, present, & future: Review those changes in market share, leadership, players, market shifts, costs, pricing, or competition that provide the opportunity fro your companys success. >>

Using slide show, show the presentation on overhead screen. Print the presentation o the available printer or save the presentation onto a file.

Tutorial 3 Your task is to make a 3-page presentation for the Chelmer Leisure and Recreation Centre.

Faculty of Information Technology University of Moratuwa

193

Presentation

Find an appropriate template(Background) for the three pages and use it. Use Times New Roman font in all three pages. Insert an appropriate picture from clip art as logo, for the first page. Type the following title, copy it to all three pages. << CHELMER LEISURE AND RECREATION CENTRE EROBICS OPEN DAY >> Type the following text in the first page << Step One of the best ways to start your fitness program. Our fitness demonstrators will be on hand to advise you on a suitable fitness program. >> Type the following text in the second page << Cycle tones up those flabby thighs and strengthens those backs. Our cycles simulate real cycling conditions, which can be individually tailored to your fitness program. >> Type the following text in the third page << Row fancy yourself in the boat race? Try your hand at our computercontrolled rowing machine. >> Change all three slides orientation to portrait. Using slide show, show the presentation on screen. Save the presentation as Chelmer.

Tutorial 4 Using appropriate Format to design the (below shown) slides using Format-Apply Design. Type your name and insert the current date and time on the first page. Animate the slides using Custom Animation. Add a slide transition use your own effect. Print the presentation on the available printer or save the presentation on a file.

Faculty of Information Technology University of Moratuwa

194

Presentation

Faculty of Information Technology University of Moratuwa

195

Relational Database

Unit 5.4 - Databases


A database is a collection of information related to a particular subject, entity or event. The data needs to be organized in a particular structure within a database. There is special software called Database Management System (DBMS) on top of the database to maintain and retrieve information from the database. 5.4.1 Introduction to Access

Microsoft Access is a powerful program to create and manage your databases. It has many built-in features to assist you in constructing and viewing your information. Access is much more involved and is a more genuine database application than other programs such as Microsoft Works. Database This is your main file that encompasses the entire database and that is saved to your harddrive or floppy disk. Example StudentDatabase.mdb Table A table is a collection of data about a specific topic. There can be multiple tables in a database. Example #1) Students Example #2) Teachers Field Fields are the different categories within a Table. Tables usually contain multiple fields. Example #1) Student LastName Example #2) Student FirstName Datatypes Datatypes are the properties of each field. A field only has 1 datatype. FieldName, Student LastName Datatype, Text

5.4.2

Starting Microsoft Access Method 1

Double click on the Microsoft Access icon on the desktop.

Faculty of Information Technology-University of Moratuwa

196

Relational Database

Method 2 Click on Start Programs Microsoft Access

5.4.3

Steps in designing a database

1. Determine the purpose of your database. 2. Determine the tables you need in the database. 3. Determine the fields you need in the tables. 5.4.4 Creating New, and Opening Existing Databases

Create a New Database from scratch Use the wizard to create a New Database Open an existing database

Faculty of Information Technology-University of Moratuwa

197

Relational Database

Note: The white box gives you the most recent databases you have used. If you do not see the one you had created, choose the More Files option and hit OK. Otherwise choose the database you had previously used and click OK. 5.4.5 Create a Blank database

When Microsoft Access first starts up, a dialog box is automatically displayed with options to create a new database or open an existing one. If this dialog box is displayed, 1. Click Blank Access Database, 2. Click OK.

If you have already opened a database or closed the dialog box that displays when Microsoft Access starts up, 1. Click New Database on the toolbar 2. Double-click the Blank Database icon on the General tab 3. Click ok 4. Specify a name and location for the database and click Create.

Faculty of Information Technology-University of Moratuwa

198

Relational Database

5.4.6

Create a database using the Database Wizard

1. When Microsoft Access first starts up, a dialog box is automatically displayed with options to create a new database or open an existing one. If this dialog box is displayed, click Access Database Wizards, pages, and projects and then click OK. If you have already opened a database or closed the dialog box that displays when Microsoft Access starts up, click New Database on the toolbar. 2. On the Databases tab, double-click the icon for the kind of database you want to create. 3. Specify a name and location for the database. 4. Click Create to start defining your new database 5.4.7 Access Databases Access is a database management system, which provides the means of storing and managing data or information. Microsoft refers to Access as a relational database product. Since it allows you to relate data from several different sets or tables. There are four main components of an Access database, which will be considered at this introductory level. These are: Tables Queries Reports Screen Forms Tables Access stores data in tables that are organized in rows and columns. The basic requirement of having a database is that you have at least one table. The columns in
Faculty of Information Technology-University of Moratuwa

199

Relational Database

the table represent specific details. The rows, which contain the collection of specific details, are known as records. Queries A query is used to retrieve a set of records from your database. This type of query is known as select query, although access provides other type of queries, this is the most commonly used type Reports Reports are used to print information. This may be based on all the data, from a table or query. A set of selected records can be used to output or to print from the query. In addition to data from records, they may show summary information relating to the data in the records displayed. Forms Screen forms are used to customize the way in which the data from records in tables or queries are displayed on screen. Their main purpose is to provide a user-friendly interface for the entry of new records or for editing existing records. Tables A table is a collection of data about a specific topic, such as students or contacts. Using a separate table for each topic means that you store that data only once, which makes your database more efficient, and reduces data-entry errors. Creating a table In table Design view, you can add or delete fields, or customize fields by setting properties. To create a table in Design view: 1. Go to the Database window 2. Click the Tables tab

3. Click on the New button.

Faculty of Information Technology-University of Moratuwa

200

Relational Database

4. Select Design View and click on OK to display the Table Design.

5.4.8

Defining the fields in a table

Adding a new field Add a field to a table by entering the field name and data type in the upper portion of Design view. Rename a field by changing its name in the Field Name column. Setting a field's data type The data type defines what kind of values you can enter into a For example, you can not enter text into a Currency field. By

field.

Faculty of Information Technology-University of Moratuwa

201

Relational Database

choosing an appropriate data type, you can ensure that data is entered in the correct form for sorting, performing calculations, and other operations. To set or change a field's data type: 1. Click in the Data Type column 2. Click the Arrow 3. Select the data type from the list. The following table shows you the data types available in Access Data Type Description Text Text and numbers. By default Access will make a text field 50 alphanumeric characters long, i.e. you can enter up to 50 letters and numbers. If you know the length of the longest piece of data to be entered in to the field then you can specify this as anything from 1 to 255 characters. Examples of text type fields: names and addresses. Number Numerical data on which you intend to perform mathematical calculations, except calculations involving money. You will see later that there are different Number data types that you can choose, which define the size of number you wish to store and whether the data is whole numbers or decimal numbers. Examples of numeric field: Student marks or Number of items in stock. Auto Sequential whole numbers are automatically inserted by Access so Number you dont need to enter the data in the field. This data type is used primarily to give uniqueness to each record, for example, a membership number or a product identification number. Date/Time Dates and times. A variety of display formats are available, or you can create your own. Example: Date of joining Currency Money. Don't use the Number data type for currency values because numbers to the right of the decimal may be rounded during calculations. The Currency data type maintains a fixed number of digits to the right of the decimal. Example : Membership fee. Yes/No Yes/No, True/False, On / Off. Example: Smoker/Non-smoker. Memo Lengthy text and numbers. A Memo field can contain upto 32,000 characters. For example, about a hotel in a travel company's database.

Setting a field property Each field in a table is defined by a set of properties. These properties determine the size of the field, how it is formatted, and what it is called, among other things. You can view or change field properties in Design view

Faculty of Information Technology-University of Moratuwa

202

Relational Database

. Property Field size Format Input Mask Caption Default Value Validation Rule Validation Text Required Allow Zero Length Indexed Description Maximum length of the text field or type of number How data is displayed; use predefined formats or customize your own. Data entry pattern Default field label in a form or report Values entered in the field when records are created Expression that defines data entry rules Text for invalid data Whether or not an entry must be made Allows you to store a zero length string ("") to indicate data that exists but is unknown Single-field index to speed searches

Example of setting field properties 1. Open the table in Design view. 2. Select the field for which you want to set properties. 3. Click the General tab in the Field Properties window. 4. Click the property you want to modify and type the appropriate text. Do one or more of the following: Type a number in the Field Size box to indicate the maximum number of characters that field can hold. Select Y or N in the Required box to indicate whether data must be entered in this field for every record. Type the caption you want for a field in the Caption box. This caption appears on the tables and forms. If you do not enter a caption, the field name appears as the caption.

5. After you have set the field properties, save and close your table.

Faculty of Information Technology-University of Moratuwa

203

Relational Database

5.4.9

Primary Key

You use a unique tag called a primary key to identify each record in your table. Just as a license plate number identifies a car, the primary key uniquely identifies a record. A table's primary key is used to refer to a table's records in other tables. For example, the Student Number from the Student table is used to refer to Student information so that it can be viewed or printed with order information from the Class and Class Details tables. To set the primary key: 1. Click the field you want to use as the primary key 2. Click Primary Key on the toolbar.

5.4.10

Combo box

Selecting a value from a dropdown box with a set of values that you assign to it. This saves you from typing it in each time Example Choosing a city that is either Auburn, Bay City, Flint, Midland, or Saginaw 1. 2. 3. 4. 5. 6. Switch to Design View Select the field you want to alter (City) At the bottom select the Lookup Tab In the Display Control box, select Combo Box Under Row Source Type, select Value List Under Row Source, enter the values how you want them displayed, separated by a column. (Auburn, Bay City, Flint, Midland, Saginaw)

7. Select in the datasheet view and you should see the change when you go to the city field.

Faculty of Information Technology-University of Moratuwa

204

Relational Database

5.4.11

Saving a Table

After you have finished defining the fields, 1. Click the Save button on the toolbar or 2. Choose Save from the file menu to save the table that you have designed or click on the Close button at the top right corner to save the design table. 5.4.12

Switching Views

To switch views form the datasheet (spreadsheet view) and the design view, simply click the button in the top-left hand corner of the Access program. Datasheet View Design View

Displays the view, which allows you to enter raw data into your database table. 5.4.13

Displays the view, which allows you to enter fields, data-types, and descriptions into your database table.

Entering Data Click on the Datasheet View and simply start "chugging" away by entering the data into each field.

NOTE: Before starting a new record, the Employee No # field must have something in it, because it is the Primary Key. If you did not set a Primary Key then it is OK.

5.4.14

Manipulating Data

Adding a new row : Simply drop down to a new line and enter the information Updating a record : Simply select the record and field you want to update, and change its data with what you want Deleting a record : Simply select the entire row and hit the Delete Key on the keyboard

Faculty of Information Technology-University of Moratuwa

205

Relational Database

5.4.15

Queries

Queries are great for getting information from a database. With a query, you can filter the data that you view in a table. You establish a set of criteria when you create the query. Then when you run the query, Access 2000 returns only those fields or records that are of interest to you. The results appear in a table in Datasheet view. 5.4.16 Select queries

A select query is the most common type of query. It retrieves data from one or more tables and displays the results in a datasheet where you can update the records (with some restrictions). You can also use a select query to group records and calculate sums, counts, averages, and other types of totals.

5.4.17

Creating a Query

1. In the Database window, click the Queries tab, and then click New. 2. In the New Query dialog box, click Design View. 3. Click OK. 2.1.1 OR 1. Select Create Query in Design view 2. Click Design

Faculty of Information Technology-University of Moratuwa

206

Relational Database

3. Click the name of the table or query you want to base your query.

4. Select the fields of which you want to retrieve data 5. Click an additional table or query if desired, and then select the fields you want to use from it. Repeat this step until you have all the fields you need. OR 6. Double click on the title bar on the table and draw and drop it in the query. 5.4.18 Multiple criteria in a query

You can use more than one criterion to retrieve a set of records from a table. Some of the examples are given below OR Operator

Faculty of Information Technology-University of Moratuwa

207

Relational Database

AND operator

Combining the AND and OR operators

5.4.19

To run a query

1. Click Queries in the database window. 2. Double-click the query you want to run. Access 2000 runs the query and displays the results in Datasheet view. 5.4.20 Sorting a Table

A sequencing principle used to order data, alphabetically or numerically. The sort order can be either ascending or descending. When you specify a sort order in Design view or Datasheet view, you can perform simple sorts, which means you can sort all records in ascending or descending order (not both). When you specify a sort order in query Design view or in the Advanced Filter/Sort window, you can perform complex sorts. This means you can sort records in ascending order by some fields and in descending order by others.

Faculty of Information Technology-University of Moratuwa

208

Relational Database

To sort records 1. In Datasheet view, click the header of the field to sort by so that the whole column is selected. 2. Click the Sort Ascending button Datasheet toolbar. 3. Save and close the file. Note: You can use the sort feature for query results also. or the Sort Descending button on the

Forms

A form is nothing more than a graphical representation of a table. You can add, update, and delete records in your table by using a form. NOTE: Although a form can be named different from a table, they both still manipulate the same information and the same exact data. Hence, if you change a record in a form, it will be changed in the table also. A form is very good to use when you have numerous fields in a table. This way you can see all the fields in one screen, whereas if you were in the table view (datasheet) you would have to keep scrolling to get the field you desire. 5.4.21 Create a Form using the Wizard

It is a very good idea to create a form using the wizard, unless you are an advanced user and know what you are doing. Microsoft Access does a very good job of creating a form using the wizard. The following steps are needed to create a basic form: 1. Switch to the Database Window. You can do this by pressing F11 on the keyboard. 2. Click on the Forms button under Objects on the left side of screen 3. Double click on Create Form Using Wizard

Faculty of Information Technology-University of Moratuwa

209

Relational Database

4. On the next screen select the fields you want to view on your form. Most of the time you would select all of them. 5. Click Next 6. Select the layout you wish.

7. Click Next. 8. Select the style you desire.

Faculty of Information Technology-University of Moratuwa

210

Relational Database

Note: if you plan on printing your form, I suggest you use a light background to save on printer toner and ink 9. Click Next 10. Give you form a name, and select Open the Form and enter information

11. Select Finish to complete the form.

Faculty of Information Technology-University of Moratuwa

211

Relational Database

12. You should see your form. To adjust the design of your form, simply hit the design button (same as with the tables), and adjust your form accordingly

5.4.22

Reports

A report is an effective way to present your data in a printed format. Because you have control over the size and appearance of everything on a report, you can display the information the way you want to see it.

5.4.23

Create a Report using the Wizard

As with the Form, it is a very good idea to create a report using the wizard, unless you are an advanced user. Microsoft Access does a very good job using the wizard to create reports. 1. Switch to the Database Window. You can do this by pressing F11 on the keyboard. 2. Click on the Reports button under Objects on the left side of screen 3. Double click on Create Report Using Wizard

Faculty of Information Technology-University of Moratuwa

212

Relational Database

4. On the next screen select the fields you want to view on your form. Most of the time you would select all of them. 5. Click Next 6. Select if you would like to group your files. Keep repeating this step for as many groupings as you would like.

7. Click Next. 8. Select any Sorting if required 9. Click Summary Option for sub totaling and grand total.

Sorting by a field

Click

10. Select the layout and the paper orientation you desire

Faculty of Information Technology-University of Moratuwa

213

Relational Database

11. Click Next 12. Select the style you desire

Note: if you plan on printing your report, I suggest you use a light background to save on printer toner and ink 13. Click Next 14. Give you report a name, and select Preview the Report

Faculty of Information Technology-University of Moratuwa

214

Relational Database

15. Select Finish 16. You should see your report. To adjust the design of your report, simply hit the design button (same as with the tables), and adjust your report accordingly

5.4.24

Grouping

By grouping records that share a common value, you can calculate subtotals and make a report easier to read. In this report, orders shipped on the same date are grouped together. 2.1.2 Grouping records in a report You can group on up to 10 fields or expressions in a report.

1. Open the report in Design view.

Faculty of Information Technology-University of Moratuwa

215

Relational Database

2. Click Sorting and Grouping on the toolbar to display the Sorting and Grouping box. 3. Set the sort order for the data in the report. 4. Click the field or expression whose group properties you want to set. 5. Set the group properties in the following list. You must set either GroupHeader or GroupFooter to Yes in order to create a group level and set the other grouping properties. GroupHeader GroupFooter GroupOn Adds or removes a group header for the field or expression. Adds or removes a group footer for the field or expression. Specifies how you want the values grouped. The options you see depend on the data type of the field on which you're grouping. If you group on an expression, you see all the options for all data types. Specifies any interval that is valid for the values in the field or expression you're grouping on. Specifies whether Microsoft Access prints all or only part of a group on the same page.

GroupInterval KeepTogether

Faculty of Information Technology-University of Moratuwa

216

Relational Database

Tutorial 1 Start the Database software. Set up the following database with the file name : Lawyer Data Type Text Text Text Text Date/Time Number

Field Name
REF NO LAWYER CLIENT NAME DAY TIME PREVIOUS VISITS

Note: The TIME and PREVIOUS VISITS should be numeric fields. Use Date/Time for the TIME field data type and Field Properties format: Short Time. Make the REFNO as the Primary Key. Save the table as: Clients Close the database Tutorial 2 Open the Database Lawyer Changer the following Fields properties Properties Input Mask L999 Field Size (15) Field Size (20) Combo Box Format Short Time Number

Field Name
REF NO LAWYER CLIENT NAME DAY TIME PREVIOUS VISITS

Enter the following Records

REF NO J120 J561 M124 N657 C780 E120 L833 H777 G652 Y444 R567 H800 D437

LAWYER PATEL PATEL PATEL PATEL COLLINS COLLINS COLLINS COLLINS McBRIDE McBRIDE McBRIDE McBRIDE McBRIDE

CLIENT NAME JONES L SMITH C CLARKSON J GRIGGS S DENT J JENKINS Z DENNIS M MOWHILL S HARMAN D PETERS H CLARKE F PAUL G MULERO M

DAY WED TUE SAT FRI SAT WED SAT FRI THU FRI SAT SAT WED

TIME 09:30 12:00 16:00 13.45 09:00 10:30 10:00 17:45 11:00 18:30 09:30 11:00 15:00

PREVIOUS VISITS 6 10 4 10 12 0 8 12 12 6 0 6 2

Faculty of Information Technology-University of Moratuwa

217

Relational Database G123 H321 L909 F549 SIMPSON SIMPSON SIMPSON SIMPSON ANDREWS C GOODYEAR K STEWART J GREGORY A WED WED SAT THU 10:00 11:00 12:00 16:00 6 6 10 10

Mr M Dennis who was to see Mrs Collins has cancelled. Delete his details. Add the following new client for Mr Patel. His name Mr S Samuel and he has booked an appointment for Saturday at 10 am. His reference number is D321. Save the file. Add a new field to the database TITLE. Enter the clients titles as follows: TITLE MISS MRS MS MISS MR MR DR MISS MS MR MR DR MR MS MR MISS MR

CLIENT NAME JONES L SMITH C CLARKSON J GRIGGS S DENT J JENKINS Z MOWHILL S HARMAN D PETERS H CLARKE F PAUL G MULERO M ANDREWS C GOODYEAR K STEWART J GREGORY A SAMUEL S

Save and print the table. Close the database file.

Tutorial 3 Open the database Lawyer saved in Tutorial 2. Sort the file into alphabetical order of client name and save the query as SORT. Search for all the clients whose appointments day is Wed and save as WED. Find all the records of clients whose appointments are before 12:00 and have previously visited fewer than 8 times; Display only Client Name and Time fields and save the query as CLIENT EIGHT. Create a Query to Display only the Male clients and save the query as MALES. Display All the Client names Starting with Letter C and Save the query as CNAMES. Save and close the file.

Faculty of Information Technology-University of Moratuwa

218

Relational Database

Tutorial 4 Open the database Lawyer. Create a simple form using the table Clients. Change the text of the Field headings to Times New Roman, italic 18pt. Change the colour of the background in the field headings boxes to green. Save the form as Client Form. Enter the following new records through the Screen Form.
LAWYER COLLINS PATEL CLIENT NAME MUSGROVE D DANIEL Z DAY FRI TUE TIME 16:00 10:00 PREVIOUS VISITS 2 0 TITLE MR MISS

REF NO B421 H555

Tutorial 5 Open the database Lawyer. Produce a report as follows. o Display all of the records. o Group by Lawyer. o Sort in descending order of Client Name. o Title the report Clients groups by lawyer. o Add a header with your name and current time of day in Arial, bold, 14 pt. Change the report title to Client appointments this week, groups by lawyer. Save and print the report. Close the database file.

Faculty of Information Technology-University of Moratuwa

219

Information and Communication

Unit 5.5 - Information & Communication


5.5.1 Introduction to Internet How does the Internet work? Good question! The Internet's growth has become explosive and it seems impossible to escape the bombardment of www.com's seen constantly on television, heard on radio, and seen in magazines. Because the Internet has become such a large part of our lives, a good understanding is needed to use this new tool most effectively. This white paper explains the underlying infrastructure and technologies that make the Internet work. It does not go into great depth, but covers enough of each area to give a basic understanding of the concepts involved.

5.5.2

What is Internet?

The Internet, sometimes called the Net, is a vast global network of computers that are connected. Technically, rather than one network, the Internet is a loosely organized collection of thousands of networks. Students, business people, scientists, computer professionals and almost anyone can access it. 5.5.3 World Wide Web (WWW)

The World Wide Web is the graphical, multimedia portion of the Internet. To view files on the Web, you need Web browsing software such as Internet Explorer or Netscape. You use this software to view different locations on the Web, which are known as Web pages. A group of Web pages is known as a Web site. The first page of a Web site is often called the Home Page. 5.5.4 Electronic Commerce What is E-Commerce? While there is no one correct definition of e-commerce, it is generally described as a method of buying and selling products and services electronically. The main methods of e-commerce remain the Internet and the World Wide Web, but use of email, fax, and telephone orders are also prevalent. E-commerce also encompasses all ranges of transactions: business-to-business, business-to-consumer, and consumer-to-business. 5.5.5 Hyperlinks A hyperlink is a connection from one page to another destination such as another page or a different location on the same page. The destination is frequently another Web page, but it can also be a picture, an e-mail address, a file (such as a multimedia file or Microsoft Office document), or a program. A hyperlink can be a text or a picture.

Faculty of Information Technology-University of Moratuwa

220

Information and Communication

When a site visitor clicks the hyperlink, the destination is displayed in a Web browser, opened, or run, depending on the type of destination. For example, a hyperlink to an AVI file opens the file in a media player, and a hyperlink to a page displays the page in the Web browser. In the following example, the word "services" is a hyperlink; when the site visitor clicks it, the Services page is displayed.

5.5.6

URLs

Just as each household has a unique address, each Web page in the world has a unique Internet address, sometimes called a URL (Uniform Resource Locator). For example, the Internet address of Microsoft is: http://www.microsoft.com/ When you create a hyperlink, its destination is encoded as a URL (Uniform Resource Locator), such as http://example.microsoft.com/news.htm or file://ComputerName/SharedFolder/FileName.htm. A URL contains a web server or network location, path, and file name. A URL also identifies the protocol that will handle the file, such as HTTP, FTP, or FILE:

5.5.7

What is http?

HTTP stands for HyperText Transfer Protocol, the means of communicating using links. The html you often see at the end of the URL stands for HyperText Markup Language, a language to make pages that take advantage of multimediapictures, sound and even film clips. 5.5.8 What is an ISP?

The main trunks of the Internet, or backbones, are run by the major telecommunications carriers. These carriers provide access to the Internet through smaller companies called Internet Service Providers (ISPs). Users can get access to the Internet through an ISP to browse the World Wide Web, to download files, and to send and receive e-mail. Some popular ISPs in Sri Lanka are Sri Lanka Telecom, Lanka Internet and CeyCom. 5.5.9 Accessing Internet

In order for you to connect to the Internet you will need: Computer; Telephone connection;

Faculty of Information Technology-University of Moratuwa

221

Information and Communication

Modem; Internet account (from an ISP) and Internet software (Browser, email client, etc.)

5.5.10

Connecting to your ISP

Before you can begin to use a Web browser to browse the Internet you need to first connect to your local ISP. To do this you need to 1. Dial the number given to you by your ISP (this will be a local number such as 011-347347) through your computer. Once you do this you will be connected to the ISP who is in turn connected to other computers in the Internet. 2. Identify yourself to the ISP by typing the username and password they gave you. This way the ISP knows who is accessing Internet through them and will be able to charge you if they do so.

3. Once the ISP server recognizes your username and your password you can start any email software (such as a Web Browser, WebTV, Internet, etc...) and use Internet. 5.5.11 Exploring the Internet You can browse "Web pages" - or "Surf the Net" - in several ways. You can open any web page by typing its address in the Address box of your Web browsing software. And when you're viewing a Web page, you can navigate the Internet by clicking on Iinks (underlined text or special pictures when clicked causes you to go to the next Web page - this occurs only when you move the mouse pointer over a link.) When you click a link, another Web page appears. You can also use the toolbar buttons to move between Web pages.

Faculty of Information Technology-University of Moratuwa

222

Information and Communication

5.5.12

Searching the Internet

The Internet is a vast store of information with millions of computers connected around the world, finding the information that you want can be really timeconsuming. If you know the URL (like www.cnn.com, mtvindia.com, www.microsoft.com) then there is no problem, but if you want to find information on some topic, like the sites that sell a popular book (maybe Information Technology). One possibility is a search engine, a site that allows you to type in a request and then returns locations (URLs) of other web pages having the matching content. You can find information on the Web in a variety of ways. Click the Search button on the toolbar to gain access to a number of search providers. Type a word or phrase in the Search box. Type go, find, or? Followed by a word or phrase in the Address bar. Internet Explorer starts a search using its predetermined search provider. Choosing terms and syntax

5.5.13

1. Enter synonyms, alternate spellings and alternate forms (e.g. dance, dancing, and dances) for your search terms. 2. Enter all the singular or unique terms, which are likely to be included in the document, or site you are seeking. 3. Avoid using very common terms (e.g. Internet, people) which may lead to a preponderance of irrelevant search results. 4. Determine how your search engine uses capitals and plurals, and enter capitalized or plural forms of your search words if appropriate. 5. Use a phrase or proper name if possible to narrow your search and therefore retrieve more relevant results (unless you want a large number of results). 6. Use multiple operators (e.g. AND, NOT) if a search engine allows you to do so. 7. If you receive too many results, refine and improve your search. (After perusing the results, you may become aware of how to use NOT - e.g. Boston AND hockey AND NOT Bruins). Pay attention to proper spacing and punctuation in your search syntax (i.e. no space when using + means +term not + term). 5.5.14 Exploring with use of the Yahoo Page

One of the most popular search engines on the Internet is Yahoo. In other words Yahoo acts as the menu on Internet; it helps you to connect to addresses easily instead of typing the address in the address column. The Yahoo web site:

Faculty of Information Technology-University of Moratuwa

223

Information and Communication

To change your home page Your home page is the page that is displayed every time you open Internet Explorer. Make sure it is a page that you want to view frequently. Or make it one that you can customize to get quick access to all the information you want, such as the msn.com home page. Go to the page you want to appear when you first start Internet Explorer. On the Tools menu, click Internet Options.

Faculty of Information Technology-University of Moratuwa

224

Information and Communication

1. Click the General tab. 2. In the Home page area 3. click Use Current. Favourites Internet Explorer provides faster & easier access to your favourite web pages. By using the Favourites folder you can create a link to the web sites that are frequently visited. So that you can access that web page by just clicking it on the menu. To add a web page to the Favourites folder: 1. Select Favourites from the Menu bar 2. Click on Add Favourites

3. In Name box type in any name you wish to assign for your web page 4. Click OK once you have finished.

Faculty of Information Technology-University of Moratuwa

225

Information and Communication

5.5.15

Downloading a web page

1. On the File menu, click Save As. 2. Double-click the folder you want to save the page in. 3. In the File name box, type a name for the page. 4. In the Save as type box, select a file type. To save all of the files needed to display this page, including graphics, frames, and style sheets, click Web Page, complete. This option saves each file in its original format. To save just the current HTML page, click Web Page, HTML only. This option saves the information on the Web page, but it does not save the graphics, sounds, or other files. To save just the text from the current Web page, click Text Only. This option saves the information on the Web page in straight text format.

Saving pictures from a web page As you view pages on the Web, youll find information that you'd like to save for future reference or share with other people. You can save the entire Web page or any part of it: text, graphics, or links. You can print Web pages for people who dont have access to the Web or a computer. To save a page or picture without opening it 1. Right-click the link for the item you want, and 2. Click Save Target As 3. In the Save As dialog box, choose the path that you want to save and click OK. To copy information from a Web page into a document 1. Select the information you want to copy 2. Click the Edit menu 3. Click Copy. To create a desktop shortcut to the current page 1. Right-click in the page 2. Click Create Shortcut. To use a Web page image as desktop wallpaper 1. Right-click the image on the Web page 2. Click Set as Wallpaper. To turn off graphics to display all Web pages faster 1. On the Tools menu in Internet Explorer, click Internet Options. 2. Click the Advanced tab.

Faculty of Information Technology-University of Moratuwa

226

Information and Communication

3. In the Multimedia area, clear one or more of the Show pictures, Play animations, Play videos, or Play sounds check boxes.

5.5.16

Printing

Printing a Web page When you print a Web page, you can print the page as you see it on the screen, or you can print selected parts of it, such as a frame. In addition, you can specify that you want to print additional information in the headers and footers, such as the window title, page address, date, time, and page numbers. The following topics provide more information: To change appearance of a page when it prints 1. On the File menu, click Page Setup. 2. In the Margins boxes, type the margin measurements in inches. 3. In the Orientation area, select either Portrait or Landscape to specify whether you want the page printed vertically or horizontally. 4. Click Headers. In each Headers and Footers box, specify the information to be printed by using the following variables. Variables can be combined with text (for example, Page &p of &P).

To print the contents of a frame 1. Right-click in the frame. 2. On the menu that appears, click Print. 3. Set the printing options you want

Faculty of Information Technology-University of Moratuwa

227

Information and Communication

5.5.17

Electronic Mail

Electronic mail or e-mail is the process of sending messages directly from one computer to another. These messages can be sent back and forth at any time. The cost of sending e-mail is quite minimal. It is less than a normal phone call but it is faster than snail mail, mail that travel through postal service. Depending on the modem speed two parties can exchange mail from one country to another country within a course of less than 2 minutes. 5.5.18 Getting started With an Internet connection from your Internet Service Provider (ISP) and a Email software (such as Microsoft Outlook), you can exchange e-mail messages with anyone on the Internet. A typical Microsoft Outlook window

Forwarded This arrow indicates that this message has been forwarded.

Bold Messages displayed in bold have not been read.

Web toolbar

Standard toolbar Advanced toolbar Folder list Use this list to organize your messages in personal folders.

Faculty of Information Technology-University of Moratuwa

228

Information and Communication

5.5.19

E-mail address

Before you can send and receive email messages you need to have an email address given to you by your ISP . An Internet e-mail address consists of a user name and a domain name, with the two separated by an at sign (@). In the following example, siva is the user name and lanka.net is the domain name. siva@lanka.net The domain name extension indicates the domain type. Some common domain types are; Meaning Domain com Company net Internet related org Organization edu Educational

5.5.20

Email folders

Before we look into sending and receiving mail lets briefly check the organisation of an e-mail package. Almost all email software have the following folders: Inbox All your new mail which you receive will be put inside a box called In-box and if there are any unread mail, a closed symbol like this* will be displayed beside the new mail. When you double click on the message you can open and read your new message. Outbox Once you have composed all your new messages before sending those messages it will be placed in the Out-Box. And once an individual gets connected to the Service Provider the message will be sent and will be placed in the Sent Items box, if it is successfully sent.

Deleted Items If you want to delete any unwanted messages just select the message that you want to delete and press the Delete key on the keyboard. This routine will delete the mail and the deleted mail will be placed in the Deleted Items box. If you want to delete the mail permanently select the message from the "Deleted Items" box and press the delete key. 5.5.21 Creating and sending e-mail messages There are two ways to send e-mail messages using Outlook 2000: You can either open Outlook 2000 or begin a new message there or you can open any Office 2000 program, create a document, and send it directly to e-mail from that Office program . 5.5.22 To create and send an e-mail message from Outlook 2000

6. Start Outlook 2000.

Faculty of Information Technology-University of Moratuwa

229

Information and Communication

7. On the Actions menu, click New Mail Message. Or, on the Standard toolbar, . To send a message on stationery, on the Actions click New Mail Message menu, point to New Mail Message Using, click More Stationery, and then select a background. The New Message window opens.

8. In the To field, type the e-mail address of the person to whom you are sending the message. If you are sending to more than one person, type a semicolon (;) between the e-mail addresses. - Or Click To to open your address books. Select an address book and double-click a name. The address moves to the To Message Recipients field. 9. Repeat step 3 to add more e-mail addresses to the To field. 10. To send a carbon copy (CC) to someone (optional), click the CC field. Type the email address in the field, or click CC, choose an address from one of your address books, and click OK. Repeat to CC other people. 11. To send a blind carbon copy (BCC) to someone (to CC someone without the other message recipients knowing the person received the message) (optional), on the View menu select Bcc Field. Type the e-mail address in the field, or click BCC, choose an address from one of your address books, and click OK. Repeat to blind CC other people. 12. To add a subject line to the message, click in the Subject field and then type a brief line regarding the subject of the message. 13. Click in the blank field below the Subject field (the message field) and type your message.
Faculty of Information Technology-University of Moratuwa

230

Information and Communication

14. When you are satisfied with your message, click Send. The message automatically moves to your Outbox folder and you return to the main Inbox window. 15. If you are always connected to the network and Internet connection, your message is automatically sent- Or If you are not already connected to the Internet, click Send/ Receive to connect to the Internet and send the message. When the message has been sent, it moves to the Sent Items folder. If the message cannot be delivered to someone, you usually, but not always, receive an automatic reply letting you know who could not be reached and why. To attach a file to a message from Outlook 2000 16. In Outlook 2000, address and compose a text message as described in the To create and send an e-mail message section of this chapter. 17. To attach a file to the message, position the cursor in the message field where you want to insert the file. This can be at the beginning, at the end, or anywhere in between. 18. On the Insert menu, click File. Or, click the Insert File button on the Standard toolbar. The Insert File dialog box opens. 19. Locate the file you want to attach. Click the file and then click OK. An icon representing the file labeled with the file name appears in the message field. -OrClick on a file and drag it to the message field. Receiving and replying to e-mail messages When Outlook 2000 receives messages, it stores them in the Inbox folder. The number next to the word Inbox in the Folder list tells you how many messages are waiting for you. If there is no number, you have no new messages. When you click the Inbox folder in the Folder list, the contents of the folder are displayed on the upper, right portion of the window, which is called the Message List pane. The Message header shows the subject and author of the messages in the Inbox. If a message header is bold, that message has not yet been read. If the message header is not bold, the message has been opened. To receive and read messages 20. Open Outlook 2000. 21. If you are always connected to the network and the Internet, any messages sent to you are automatically received to the Inbox folder. If you have new messages, an envelope icon appears in the taskbar. - Or Click Send and Receive. Your computer connects to the Internet and tries to retrieve your messages to the Inbox folder. (It also sends any messages in the Outbox folder.) 22. In the Folder list, click the Inbox folder. (If it has a number next to it, you have new or unread messages.) New and unread messages appear in bold in the Message List pane.

Faculty of Information Technology-University of Moratuwa

231

Information and Communication

23. To read a new message, click it in the Message List pane. The contents of the message are displayed in the Message Contents pane. -Or -Double-click the message in the Message List pane to open the message in its own window. 24. To open an attachment, double-click its file icon. The attachment opens in the appropriate program. 25. When you are finished, you can close the message and it remains in the Inbox folder. Creating an address book Use the Address Book dialog box to look up e-mail and fax information when you address messages. Use the Contacts folder to store and retrieve all types of information about others such as street addresses, telephone numbers, e-mail addresses, fax phone numbers, and Web page addresses. To open the Address Book dialog box, click Address Book on the Standard toolbar, or click Address Book on the Tools menu. There can be several types of address books in the Address Book dialog box including the Global Address List, the Personal Address Book, and the Outlook Address Book. Select these address books in the Show names from box. Contacts in the Contacts folder that include an entry in the e-mail field or one of the fax phone number fields automatically appear in the Outlook Address Book. To add information to the address book 26. Click Address Book on the Standard toolbar. The Address Book dialog box opens. 27. In the Show Names from the drop-down box, select Personal Address Book. 28. Click New Entry on the dialog box's toolbar.

29. In the Put this entry in the drop-down list, click Personal Address Book. 30. Select the type of entry you want to create (Microsoft Mail Address, Internet Address, Other Address, and so forth) and then click OK.
31. Enter the person's name and e-mail address in the appropriate fields. 32. If you want, click the Business, Phone Numbers, or Notes tabs and enter additional information. 33. Click OK to save the information. 34. Repeat steps 3 through 7 to add more addresses.

To create a new contact

Faculty of Information Technology-University of Moratuwa

232

Information and Communication

35. On the File menu, point to New and then click Contact. The Contact dialog box opens. 36. In the Full Name box, type a name for the contact. 37. Enter the information you want to include for the contact. There are several tabs on which you can enter information. 38. If you wish, assign the contact to a category. Click Categories and then select a category from the list. 39. Click Save and Close. Open and save a file attachment To open a file attachment At the bottom of the message window, double-click the file attachment icon. OR In the preview pane, click the file attachment icon in the message header, and then click the file name.

To save a file attachment At the bottom of the message window, double-click the file attachment icon.
OR

In the preview pane, click the file attachment icon in the message header, and then click the file name. Signatures

5.5.23

You can use a signature to automatically add text to the messages you send. For example, you can create a signature that includes your name, job title, and phone

Faculty of Information Technology-University of Moratuwa

233

Information and Communication

number. You can also use a signature to add a paragraph about how you want others to respond to your messages. Create a signature for messages 1. On the Tools menu, click Options, and then click the Mail Format tab. 2. In the Send in this message format box, click the message format you want to use the signature with. 3. Click Signature Picker, and then click New. 4. In the Enter a name for your new Signature box, enter a name. 5. Under choose how to create your Signature, select whether to start from scratch or use an existing signature. To select a file to base your signature on, click Use this file as a template and type the path and file name in the box, or click Browse to select from a list. 6. Click Next. 7. In the Signature text box, type the text you want to include in the signature. You can also paste text to the Signature text box from another document. 8. To change the paragraph or font format, select the text, click Font or Paragraph, and then select the options you want. These options are not available if you use plain text as your message format.

Faculty of Information Technology-University of Moratuwa

234

Information and Communication

Tutorial 1 Name two types of network systems and briefly explain them. Explain why you need a modem to communicate with another computer/network. What is WWW? Describe the concept of Web Page Browsing using a diagram. Explain what is meant by a Home Page. Tutorial 2 Describe the meaning of an URL. Give three examples. Using some of the examples identify the main components of a URL. What are the types of Protocols that are used in internet? Explain what a Hyperlink is and how to identify one in a web page. Explain the role of ISP(Internet Service Provider) and give examples for ISP companies in Sri Lanka. Name five basic components that are used to get the internet connection. Name the typical type of software used to access information from the WWW(or Web) and give examples. Tutorial 3 Write the functions of Tool buttons given below in relation to a Web Browser. (a) Home (b) Refresh (c) Stop (d) History Visit the web site http://www.abobe.com & extract about Adobe Photoshop. Save the complete web page in your working diskette. Add the web page to favourites for future reference. Save the adobe logo into your working diskette. Tutorial 4 Explain the task of Search Engine and provide Three examples. Use an appropriate Search Engine to find information about the Y2K crisis. Tutorial 5 Part 1 You are planning a holiday in New York, USA Find the British Airways web site and describe the information it contains. List the flights from Colombo to New York What is the main difference in the information these two sites give you? Part 2 You need information to assist you buy a computer. Find the IBM UK computer site and describe the information it contains. Use the site to find details of a desktop PC suitable for use in the home. Comment on the convenient use of the site for finding the information about the specifications and costs. Find the internet address(the URL) of another computer manufacturer. What is the main difference in the information these two sites give you?

Faculty of Information Technology-University of Moratuwa

235

Information and Communication

Tutorial 6 Send an electronic mail to your tutor giving brief answers to the following questions. What do the bayous parts of an e-mail address mean? How can a file be sent by e-mail? How can you send the same e-mail message to many people at the same time? Explain what is meant by Reply a mail? Explain what is meant by an e-mail attachment and outline the way attachments are used. Use the attachment function and attach the web page, which you save on the Tutorial 3 and send e-mail to your institute. Write down the function of each folder in a Microsoft Outlook Express. (a) In-Box (b) Out-Box (c) Deleted Items (d) Sent Items

Faculty of Information Technology-University of Moratuwa

236

Operating System

Unit5.6 - Operating System


5.6.1 Introduction to Operating System An Operating System or OS is a software program that enables the computer hardware to communicate and operate with the computer software. Without a Operating System, a computer would be useless. 5.6.2 Features Expected of an Operating System

To Startup and Shutdown the computer. To act as an interface between the user and the hardware. To perform housekeeping tasks such as file handling, disk/memory management. To be able to allow the user to configure the system. This includes changing the types of printers, adding new hardware (such as sound cards), etc. 5.6.3 Types of Operating Systems Operating systems can be broadly classified into two categories based on the type of Interface provided to the user. Command Line Interface In these types of operating systems the user can enter commands through the keyboard and each command will perform a specific action. But this type of interface is very difficult for a beginner to use, because the commands have to be remembered. E.g. MS-DOS, Unix DOS DOS stands for Disk Operating System. It was developed by Microsoft as an operating system in the 1980s. Windows 3.x needed DOS to run, but Windows 95, 98, and 2000 do not. The later versions of Windows can still run DOS programs, as well as those designed specifically for Windows.

Faculty of Information Technology-University of Moratuwa

237

Operating System

Graphical User Interface These operating systems provide the user the ability to manipulate the computer in a more interactive way. These systems are more user-friendly and easier to use than command driven interface, because the commands need not be learnt. E.g. Windows, OS/2 Warp, MacOS 5.6.4 The Windows Desktop

Desktop Just like a physical top of a desk, the Windows desktop is where you put the things you are working on or want to access. The desktop is the main screen in Windows where you can put icons that act as shortcuts to various programs. Shortcut A shortcut is a Windows icon that when clicked does something - starts a program, views a graphic, plays a sound, etc. Since they are only "paths" to the program, they can be deleted without deleting the actual program itself. Let me give you an analogy Pretend you're in Miami and have to fly to Chicago, and there's only one airline company selling a ticket. If the airline company suddenly canceled that flight, that doesn't mean Chicago doesn't exist anymore. However, if an alien invasion destroyed Chicago, it doesn't matter how many plane flights go there, it just doesn't exist anymore. Similarly, if you delete a shortcut, the program itself isn't erased. You

Faculty of Information Technology-University of Moratuwa

238

Operating System

just no longer have that particular method of opening your program. However, if the program itself is erased, all the shortcuts in the world won't get you anywhere. On your desktop, you probably have several shortcuts. Shortcuts are denoted with a small arrow in the lower left corner of the icon. If you double-click them, the program that the icon represents will open. The Taskbar and Start Button Start Menu The start menu is located at the bottom left of Windows 95, 98, and 2000. The start menu contains commands used to open programs and files, commands to search for items on your computer, and commands to change settings on your computer. Program Also known as software. A program is simply something that allows you to work or play on the computer. A game is a program, a word processor is a program, Windows is a program. Programs are used to create documents and files for the user, or to just have fun. Programs are what actually put your computer to good use. Without a program, your computer is impotent.

To change your computer's date 1. To open the Date/Time Properties dialogue box. 2. Under Date, select the item you want to change: To change the month, click the month list, and then click the correct month. To change the year, click the arrows in the year list, or type the correct year. To change the day, click the correct day on the calendar. Notes You can also open the Date/Time Properties dialogue box by clicking Start, pointing to Settings, clicking Control Panel, and then double-clicking Date/Time. To use the Start menu Click the Start button. The Start menu appears Click the item you want to open.

Faculty of Information Technology-University of Moratuwa

239

Operating System

5.6.5 .

Point to items with right-facing arrows to open secondary menus

5.6.6

Keyboard Keys

The Shift Key: Used exactly the same as a typewriter in Windows. Makes capital letters and allows you to use the "cursing symbols" such as @#$%. The Shift Key can also be used to highlight text, like you would do with your mouse. Try it. Hold down the shift key (don't release it), now move your cursor with the arrow keys. You should be able to highlight text this way. The Alt Key: The ALT key stands for "Alternate." When you push this key in Windows, the cursor moves to the menu bar at the top of the screen. It's the same as clicking your mouse on the "File" Menu above. From there you can use the arrow keys to select menu options. This is useful if you don't like switching between your

Faculty of Information Technology-University of Moratuwa

240

Operating System

mouse and keyboard often. Press "Alt" again to move the cursor back off of the menu bar. The Windows Key: This key opens the "Start Menu" at the lower left corner of your screen. It has the same effect as you clicking the "Start" button with your mouse. The CTRL Key: The CTRL key stands for "Control." This key is used in combination with other keys to perform specific tasks, often called shortcuts. A list of common Windows Keyboard Shortcuts can be found on this site. One example is "CTRL+P." Often times programs automatically print the document you are using if you push the Control button and the "P" key at the same time. If you are using Netscape Navigator or Internet Explorer to view this Web page, you can bookmark the page using the keyboard shortcut "CTRL+D." Try it out! The Delete Key: This key erases the character directly to the right of your cursor. If you have text or graphics that are highlighted, those are erased by pushing this key as well. The Backspace Key: This key erases the character directly to the left of your cursor. If you have text or graphics that are highlighted, those are erased by pushing this key as well. 5.6.7 Using a Mouse

A mouse is a hand-held device that controls the movement of a pointer on your screen. You use your mouse to perform tasks on your computer. As you move the mouse, a mouse pointer moves on your screen. When you position the pointer over an object, you can press (click or double-click) the mouse button to perform different actions on the object. For example, you can double-click to open and work in files, click-and-drag to move files, and click to select files. In fact, youll probably use your mouse for most tasks. The pointer usually appears as an arrow, but it can change shape. The following sections explain the other actions you can perform with your mouse. Pointing and Clicking You perform most of the tasks on your computer by pointing at an object on your screen, and then clicking a mouse button. To point to an object, move the mouse until the tip of the mouse pointer is over the item or area you want. The following table describes common click actions. Action Description Click: Press and release the left mouse button once.

Faculty of Information Technology-University of Moratuwa

241

Operating System

Double-click: Quickly press and release the left mouse button twice.

Right-click: Press and release the right mouse button once. A shortcut menu appears.

You can switch left and right mouse buttons. Icon An icon in Windows is a small picture or object that represents a file, program, web page, or command. Most of the time, the icon picture relates to the function of the item that it represents. For example, if the icon is attached to an e-mail program, it might be a picture of a letter. Icons are located on the desktop, in the start menu, and various other places. If you are using Windows 95, 98 or 2000, you can see several icons right now. In the upper left corner of this browser, you should see an icon next to "Internet Explorer", "Netscape Navigator" or whatever browser you use. My Computer My Computer is helpful if you prefer viewing the contents of a single folder or drive. When you double-click My Computer on your desktop, available drives appear in a new window. When you double-click a drive icon, a window displays the folders contained on that drive. You can then double-click a folder to see the files it contains. Some of the following icons may appear in your My Computer window. Double-click To View the contents of the hard disk, which is usually designated drive C. View the contents of a network drive, if your computer is connected to one. View the contents of a compact disc in the CD-ROM drive, if your computer has one. View tools you can use to modify your computer settings. Set up a printer and view information about available printers and print job status.

Faculty of Information Technology-University of Moratuwa

242

Operating System

View the folder contents.

To use My Computer to view your hard disk

On the desktop, double-click My Computer. The My Computer window appears. 1) Double-click the icon that represents your hard disk. 2) Your hard disk window appears, and the contents of your hard disk appear. 5.6.8 Starting and Quitting Programs Most of the programs installed on your computer are available from one convenient locationthe Programs section of the Start menu. Depending on how your computer is set up, what you see on the Start menu varies. To start a program Click the Start button, and then point to Programs. The Programs menu appears. Point to the group (such as Accessories) that contains the program you want to start, and then click the program name.

Faculty of Information Technology-University of Moratuwa

243

Operating System

Note You can also open a program by clicking Run on the Start menu, typing the path and name of the program, and then clicking OK. To quit a program Click the Close button in the upper-right corner of the program window. 5.6.9 Personalising Your Desktop Display In addition to customizing your computer by using the TV and Web-like options, you can personalize your desktop with pictures, patterns, and colors by using the Display control panel. You can display pictures, patterns, or even scanned photographs as your wallpaper, the background of your desktop. Using the different tabs in the Display Properties dialogue box, you can also change items such as the icons on your desktop, the colors of individual windows, and the size of the objects on your screen. You can even add items to your Active Desktop or set up a screen saver. To open the Display control panel Click the Start button, point to Settings, and then click Control Panel. The Control Panel window appears. Double-click Display.

Faculty of Information Technology-University of Moratuwa

244

Operating System

The Display Properties dialog box appears. To set wallpaper, select an image or click the Browse button. Click the other tabs in the dialog box to set up a screen saver, change the desktop and window colors, add Active Desktop items, change your screen resolution, and so on.

Faculty of Information Technology-University of Moratuwa

245

Operating System

Windows Explorer If you prefer to look at your files in a hierarchical structure, youll like using Windows Explorer. Instead of opening drives and folders in separate windows, you can browse through them in a single window. The left side of the Windows Explorer window contains a list of your drives and folders, and the right side displays the contents of a selected folder. You can use the View menu to change how the icons in the right half of the window appear. To use Windows Explorer to view your hard disk Click the Start button, point to Programs, and then click Windows Explorer. In the left pane, click the letter that represents your hard disk. The contents of your hard disk appear in the right pane.

5.6.10

Managing Files and Folders

In Windows, you can organize your documents and programs to suit your preferences. You can store these files in folders, and you can move, copy, rename, and even search for files and folders. Creating Files & Folders

Faculty of Information Technology-University of Moratuwa

246

Operating System

When you use a program and save your work, or when you install a program, youre creating files. You can store your files in many locationson the hard disk, a network drive, a floppy disk, and so on. To better organize your files, you can also store them in folders. To create folders On the desktop, double-click My Computer. The My Computer window opens. Double-click the disk drive or folder in which you want to create a folder. The drive or folder window opens.

On the File menu, point to New, and then click Folder. Type a folder name, and then press ENTER. The new folder appears in the location you selected. To create files One way of creating files on your computer is by starting the associated program and then saving the file in a folder. Another way is through using the Windows Explorer or My Computer Open My Computer or start Windows Explorer. Open the disk drive or folder in which you want to create the file. On the File menu, point to New, And then select the type of file that E.g. Select Text Document to create a text file. Type a file name and then press ENTER. The new file appears in the location you selected. Double-click on the file to open and edit it. you wish to create.

Faculty of Information Technology-University of Moratuwa

247

Operating System

Note File/Folder names in Windows can be up to 255 characters, including spaces. However, file names cannot contain any of the following characters: \ / : * ?"<>| Opening Files and Folders After youve located the file you want, you can double-click to open it. To open a file or folder On the desktop, double-click My Computer. The My Computer window opens. Double-click the drive that contains the file or folder you want to open. Double-click the file or folder. Renaming Files and Folders If you decide to change the name of a file or folder, you can easily rename it. To rename a file or folder In a window, select the file or folder you want to rename. On the File menu, click Rename. OR Press the F2 key. Type a name, and then press ENTER. Copying and Moving Files and Folders When you create files and folders, you may want to copy or move them to another location. Unless youre an advanced user, you should avoid moving program and system files. To copy or move a file or folder In a window, select the file or folder you want to copy or move. Note :You can select multiple items. To select nonadjacent items, hold down CTRL and click the items you want to select. To select adjacent items, hold down SHIFT while you select items. To select all of the items in a window, on the Edit menu, click Select All. On the Edit menu, click Copy to copy the file, or click Cut to move the file. Double-click the folder in which you want to place the file or folder. On the Edit menu, click Paste. The file appears in its new location. Deleting Files and Folders Whenever you delete a file, its temporarily moved to the Recycle Bin on your desktop. If you change your mind, you can restore the file. However, when you empty the Recycle Bin, all of the items in it are permanently deleted from your computer. To delete files and folders On the desktop, double-click My Computer.

Faculty of Information Technology-University of Moratuwa

248

Operating System

The My Computer window appears. Select the file or folder you want to delete. On the File menu, click Delete. The Confirm File Delete dialog box appears. Click Yes. The file is moved to the Recycle Bin. To permanently delete files On the desktop, double-click Recycle Bin. The Recycle Bin opens. On the File menu, click Empty Recycle Bin. 5.6.11 Searching Files and Folders When youre looking for a particular folder or file, you can use the Search command instead of opening numerous folders. The Search command lets you quickly search a specific drive or your entire computer. To search a file or folder Click the Start button, point to Search, and then click Files or Folders. The Search dialog box appears. In Search for, type the file or folder name you want to find. Click the Look in down arrow to specify where to search. Click Search Now. After a moment, the results of the search appear.

Faculty of Information Technology-University of Moratuwa

249

Operating System

Search for

Look in

Provides a place for you to type all or part of the name of the file you want to find. Leave this blank if you want the search to display ALL the files and folders. Shows the location to start the search for the file you want to find. To specify a different location, click Browse. To see a list of previous locations, click the arrow.

The status bar at the bottom displays the number of files that were found. To use advanced search methods to find files and folders Click Date to look for files that were created or modified on or between specific dates. Click Type to look for files of a specific type. Click Size to look for files of a specific size. Click Name & Contents to look for files with specific text. This provides a place for you to type some of the text contained in a file. If you don't know the file name, you may be able to find the file by typing some of its contents. Click Advanced to: Search subfolders - Search current folder including the sub folders. Case Sensitive - Matches exact case

Faculty of Information Technology-University of Moratuwa

250

Operating System

Using wildcard characters A wildcard character is a keyboard character such as an asterisk (*) or a question mark (?) that you can use to represent one or more real characters when you are searching for files or folders. Wildcard characters are often used when you dont know what the real character is or when you dont want to type the entire name. For instance, if you are searching for a file or a folder but you dont remember the whole name, you can use a wildcard character in place of one or more characters. The Search windows uses both the asterisk and question mark to broaden the scope of your searches. Asterisk (*) You can use the asterisk as a substitute for any number of characters. If youre looking for a file that you know starts with "gloss" but you cant remember the rest of the file name, type "gloss*" as the name. The Find dialog box will locate all files of any file type that begin with "gloss" including "glossary.txt," "glossary.doc," and "glossy.doc." To narrow the search to a specific type of file, type "gloss*.doc." In this case, the Find dialog box will find all files that begin with "gloss" but have the file extension ".doc", such as "glossary.doc" and "glossy.doc." Typing *.* will result in a search that finds all files regardless of the file type or the length of the name. Question Mark (?) You can use the question mark as a substitute for a single character character in a name. For example, if you typed "gloss?.doc" the Search window would locate the file "glossy.doc" but not "glossary.doc," as in the search using an asterisk. When you use the question mark, only one character will replace the question mark, appearing in the same location in the name where the question mark is placed. Getting Information about a Folder Using Windows Explorer or the Search command you can get a lot of information about the number of files in a folder (even including its subfolders), size of files and the date files were created/updated. For any file or folder right-click on it and click on Properties, a dialog box displays all the information about the file/folder. Properties of a Folder Properties of a File

Faculty of Information Technology-University of Moratuwa

251

Operating System

5.6.12

Viewing Folders

You can easily change the appearance of the files in a folder and sort the files in a folder according to your requirement. To change the appearance of items in a folder In My Computer or Windows Explorer, 1. On the View menu, click Large Icons, Small Icons, List, or Details. To sort the files in a folder In My Computer or Windows Explorer, On the View menu, click to Arrange Icons And Note select the order in which you wish to sort the files.

You can sort the items by name, size, date, and type, depending on the view. When you point to a menu command, the status bar at the bottom of the window displays a description of what that command does. On the View menu, you can click Status Bar if the status bar is not visible in your window. Formatting a Diskette

5.6.13

To format a disk 1. If the disk you want to format is a floppy disk, insert it into its drive. 2. In My Computer or in the right pane of Windows Explorer, right-click the icon for the disk you want to format. 3. On the pop-up menu, click Format. Notes Do not click the disk icon with the left button, because you can't format a disk if it is open in My Computer or Windows Explorer. Formatting a disk removes all information from the disk. You cannot format a disk if there are files open on that disk. 5.6.14 Shutting Down Your Computer

When youre finished working in Windows, you use the Shut Down command on the Start menu to close windows and programs and prepare your computer for shutting down. If you havent already saved your work, youre prompted to do so. Important Dont turn off your computer until you see a message telling you that shutdown is complete. If you turn off your computer without shutting it down correctly, you risk losing information.

To shut down your computer


Faculty of Information Technology-University of Moratuwa

252

Operating System

Close all the programs that are running. Click the Start button, and then click Shut Down. The Shut Down Windows dialog box appears.

Click OK if you want to turn off your computer. If your computer doesnt turn off automatically, a message appears when you can safely turn off your computer. 5.6.15 Printing

Before you can print any document with your computer, you have to first set up the printer. This means telling Windows about the type of printer that you have. You could have more than one printer connected to your computer. To see a list of all the printers installed in your computer open the Printers folder in the Taskbar/Control Panel. To Open the Printers Folder 1. Click Start point to Settings 2. Click Printers.

Default Printer Selecting the Default Printer

Faculty of Information Technology-University of Moratuwa

253

Operating System

Your print jobs are always sent to the default printer unless you specify otherwise. In the Printers dialog box, the default printer has a check mark beside its icon. You can change your default printer at any time. To set a default printer 1. Click Start, point to Settings, and then click Printers. 2. Right-click the icon of the printer you want to set as the default. 3. A shortcut menu appears. 4. Select Set as Default.

Printing a Document After you set up a printer, you can easily print your documents. In many programs, the Print command is available on the File menu. To print an open document On the File menu, click Print.

Faculty of Information Technology-University of Moratuwa

254

Operating System

Tutorial 1 Start the Paint program in the Accessories group. If the Window is not maximized, maximize it by clicking on the maximize button. Draw the flag of the RED CROSS.

Save the file as RED CROSS on your floppy disk. Take a printout of the flag. Exit the Paint program.

Tutorial 2 Start the WordPad program in the Accessories group. Type ion the following paragraph. Welcome to year 2000 website of Aberdeen University Red Cross Society and Aberdeen University (British Red Cross) Group. AURCS was established in 1992 to promote and support the British Red Cross through Aberdeen University Group by offering Aberdeen Universitys students the opportunity to use and learn basic life support and community care skills. Save the file on your floppy disk as BRITISH RED CROSS. Minimize the WordPad. Start the Paint program. Open the file that you created in Tutorial 1 (RED CROSS) Select the flag (picture) and copy it. Switch over the WordPad. (Click on the WordPad icon on the taskbar.) Paste the flag (picture) at the beginning of the page, so that the flag looks like a logo. Save the file buy the same name, BRITISH RED CROSS Take a printout of the document you made in WordPad. Close the WordPad and the Paint programs. Tutorial 3 Start Windows Explorer and create the following directory structure in your diskette. A:\

DOS

DBASE

WINDOWS

OFFICE

Faculty of Information Technology-University of Moratuwa

255

Operating System

TEMP

MSAPPS

LETTERS

SYSTEM

Create a file called UNAMES.TXT in the WINDOWS directory and enter the following names.

Cybil Shepard
Mark Morrison Bruce Wills Robby Williams Los Del Rio Copy the UNAMES.TXT to the sub directory A:\DOS\TEMP. Remove the DBASE directory from the diskette. Change the name of the file UNAMES.TXT to FNAMES.DAT

Tutorial 4 A

Data

Letters

Memo

Create the files EX1.TXT, EX2.TXT, EX3.TXT in the MEMO directory. The contents of the files should be as follows. EX1.TXT -This is the file EX1.TXT EX2.TXT -This is the file EX2.TXT EX3.TXT -This is the file EX3.TXT Using the Search\find command search for the files with the *.COM extension in the directory C:\ and copy them to the DATA directory in the floppy disc. Create a new text file called SUMMARY in the DATA directory and type the following data into it (Hint- Use the Search\Find command); o The total number of files in your floppy diskette (dont count the folders) o The total size of all the files in your floppy diskette. o The names of the four largest files in the DATA directory. Move the files in the DATA directory starting with C to the LETTERS directory. Delete the files starting with MO in the DATA directory. Find all the files starting with E in your floppy diskette and move all of them to the LETTERS directory.

Faculty of Information Technology-University of Moratuwa

256

ICT for National Development

Unit 6 - ICT for National Development


6.1. Introduction

Today ICT is used not only as a tool in the office environment for office productivity. It is increasingly utilized as tool or vehicle for Development in the Society. It is used to empower or enhance the traditional development processes. Information and Communication Technologies (ICT) is a broad term that covers all information handling tools. It includes a varied set of goods, applications and services that are used to produce, store, process, distribute and exchange information. They include: Traditional ICT: telephone, radio and television New ICT: Personal Computers, mobile phones, satellite and wireless technologies, Internet and the World Wide Web Increasingly, the demarcations between these media or delivery channels are blurring as the world becomes more networked - interconnected telephone services, standardized computer hardware, and seamless data transmission services. Today, we are witnessing a new revolution that will shape the knowledge society of the 21st century: the digital revolution. Driven by the accelerating convergence between the Internet, broadcast media and ICTs, this revolution indeed affects all aspects of our life the way we learn, work and communicate with each other as well as the way governments interact with civil society. New opportunities are opening up to those who can make effective use of information technologies, but a large percentage of people are not aware on this digital revolution and opportunities, they dont have access to those technologies and information which are also not affordable Some feel that it is a new threat to development. At the same time, the digital revolution risks to exclude others from reaping its fruits, thus increasing existing inequalities. This gap between those who have access to ICT and those who lack of it, has become known as the digital divide. Digital Divide is the unequal access to information and communication technologies(ICT) between the information haves and have-nots. The digital divide reflects, in a large part, other social and economic divides not only between industrial and developing nations, but also within countries. The divide exists among developed countries and the less developed countries as well as within one country among the urban and rural areas, across peoples ages and levels of education. The divide also exists between those who are literate and illiterate; those who are normal and those who are disabled. Bridging the digital divide has therefore emerged as a key challenge for development and as the only hope for the marginalized part of the world to benefit from the opportunities offered by the global knowledge economy.

Faculty of Information Technology-University of Moratuwa

257

ICT for National Development

Under the development strategy of developing world is to address among other topics education, knowledge through human development. Poverty reduction and the enhancement of the quality of life for the people are still on the high-priority list and ICTs can play a great role in facilitating and accelerating. ICTs plays a great role in this strategy, and in doing so, the issue of digital divide must be considered. To bridge the digital divide has become a big challenge facing developing countries. ICT is considered as the major information infrastructure for improving the quality of access and diffusion of information for the citizens. 6.2. Evolution of Poverty Eradication Programs Poverty Reduction Focus in the Agriculture Age Type A : Basic Needs Clean Water Health Care Food Poverty Reduction Focus in the Industrial Age Type B : Infrastructure Development Roads Electricity Telecommunication + Type A Poverty Reduction Focus in the Information Age Type C : Information and Knowledge ICT for Education ICT for Enhancement of Agriculture Production and Market ICT for Improvement of information access in the rural areas + Type A and Type B 6.3. Harnessing the potential of ICT for Development ICT are a powerful tool for sustainable development, empowerment and poverty reduction. ICTs are a component of a broader strategy to sustainable development and should not be seen as a panacea for all development problems. ICT encompass a full range of technologies not only the Internet, but also traditional devices, such as radios or TV, which are the most widely used tools in developing countries.

Faculty of Information Technology-University of Moratuwa

258

ICT for National Development

The effective use of ICT is not just a question of infrastructure, but also requires an appropriate institutional and regulatory framework and human capacity.

6.4.

How does ICT enhance and facilitate Development?

In a variety of areas, access to and use of information can contribute to empower people, reduce poverty and improve lives, notably by: Providing access to relevant information ICT can help improve the economic and social situation of the poor by enabling people to obtain relevant information on market prices, weather conditions, medical assistance, land and political rights as well as welfare or credit schemes increase their competitiveness and market access Train them via e-learning, thus making them responsible for their own development.

Giving a voice As a consequence of their poverty, the poor often lack an effective voice in public life and policy. ICT help: increase the voice and participation of the poor in the decision-making processes communities express their cultural identity People assert their own rights and interests and pressure decisionmakers to be more responsive to their needs. increase the efficiency, transparency and accountability of governments and institutions promote local cultures and cultural diversity through local content Facilitating communication and network building By facilitating a new level of many-to-many information, ICT offer an interactive and decentralized platform that enables people to share knowledge and build networks promote their interest and rights more efficiently influence more effectively, rapidly and collectively political decisions that affect their lives communicate more effectively, thus enhancing intercultural understanding

The purpose of the use of ICT for Development is 1) 2) To raise standard of living of people To ensure the rights of information access through the use of ICT

Faculty of Information Technology-University of Moratuwa

259

ICT for National Development

3) 4)

To learn from the global knowledge and contribute to it To provide more opportunities to people for education, culture and other Information and Communication Technology (ICT) to Rural Areas in Sri Lanka- Problems and Issues.

6.5.

It is reported that the gap between the people of the city and the rural areas in Sri Lanka is widening dramatically during the past decades. Though the government launched a number of development activities such as road, telecommunication, electricity, education, irrigation facilities, etc. in the rural areas, such development activities have made very marginal contribution in bridging the urban rural gap. The civil unrest that prevailed since 1980s in the country resulted in widening the gap be decreeing productivity and rural income. Most developing countries including Sri Lanka are constantly struggling with issues of poor economic performance, poor productivity and inefficient governance. Today it believed that e-governance (re-engineering government) does and could play a vital role in enhancing the quality of life of a nation. Information and Communication Technology (ICT) is the vital ingredients in re-engineering government. The important message of this is that the communities have choice and access for information and services. However while there are many positive aspects to egovernance, it seems that there are some challenges that have to be faced by the communities, with regard to the obtaining these services. The Regaining Sri Lanka policy document emphasizes that the access to market information is essential to compete with the global economy. In this regard it is necessary to provide information and communication facilities to all. An e-Sri Lanka initiative has been launched to ensure the benefits of modern technology accessible to the poor. To achieve this, Regaining Sri Lanka has identifies some strategies to bridge information gap with a view to create opportunities for pro-poor growth. Poor usage in rural areas. Even though Internet service has been introduced in Sri Lanka since 196, only 40,705 internet receivers are available in the country at the time survey conducted by SLT in 2002. Out of the data communicated during the period of survey, the users in Colombo District represent 87%, 2% from Kandy and other 11% represent all the districts. This reveals that the usage of Internet in the rural area is not popularized among the country people. Non availability of telephone services According to the available information out of the total number of telephones, which is the most relevant facility in the ICT facilitation, about 45% is in the Metro region and balance 55% in the other 3 regions. Hence it is necessary to provide telephone facilities to the rural areas to enable them to use internet and e-mail facilities.

Faculty of Information Technology-University of Moratuwa

260

ICT for National Development

Internet is a stranger to the rural area In Sri Lanka computer education is mainly conducted in English language. Hence, rural people with poor English literacy experience difficulties in learning the computer education. Though the English language is considered as second language in Sri Lanka, the facilities such as qualified and dedicated teachers provided by the department of education is not to the expectation. Hence, the knowledge of English among the rural school children are not sufficient to work with computers properly and to understand the contents of the internet and web sites. If the government is not able to provide qualified and dedicated English teachers to the rural areas, problem of non-deliver of knowledge will remain forever. Countries like India, Malaysia, South Korea and Japan use their own languages for computers, considering the capability of the children to use the computers from the childhood. However, since English is the language still used learning computer in Sri Lanka, it has prevented the farmers and children from accessing the required knowledge. Non acceptability by rural community. According to a recent survey conducted, it is reveled that there are resistance and unsupportive attitudes towards the development of electronic computer systems in the rural areas. This is partly attributed to children using Internet for culturally sensitive matter. It was observed 60% of the rural adults have a negative approach over the introduction of e-governance in to the rural areas. Identified reason for this is the lack of English knowledge to handle and operate the computers.

Migration of educated generation Most of the English educated youngsters have been migrated to the city area, as they are able to get employment in the cities, as a result rural areas are short of resource persons on ICT. High cost computers The processes of the computers are very high when compared to the income level of the people of the rural areas in Sri Lanka. Therefore it cannot be expected to popularize the computers and Internet usage among rural areas, as they cannot afford to purchase computers and get the services of e-mail and Internet. Relevancy of information Content of the Internet is still not very relevant to the rural people in Sri Lanka. In India, there are important messages, which are useful to the farmers and other types of rural producers, on the Internet. Maintenance and equipment and services Maintenance of equipment and services is very expensive as they operate outside the rural areas.

Faculty of Information Technology-University of Moratuwa

261

ICT for National Development

Quality of training institutions There are complains that ICT training institutions are misleading not only for the students but also for the parents and the entire country. Matters to be considered ICT should be harnessed for the benefit of ordinary farmers. ICT policy is a mot important factor on the introduction of information communication technology to the rural mass with a view to empower them by providing all types of information and communication with regard to their day to day life. Awareness building on ICT usage should be conducted to the rural mass through the institutions such as Sannivedana Piyasa or regional Chambers, etc. Government has to the software developers to develop packages in Sinhala and Tamil languages. While the dedicated qualified English teachers are appointed to the schools to enhance the English knowledge, computer literacy has to be given their mother language at least until the students are able to understand and handle the computers. The rural people should be educated as how to use the Web facilities and Internet for marketing their own products. This could be implemented where the Sannevadana Piyasa and Vishva Ghana Kendra programs are implemented. Most of the services provided by the government institutions require filling of forms. All the ministries/institutions should provide the information, with regard to the services they provide and the relevant specimen formats and application forms also to be uploaded in the Internet online. Established cyber cafes in rural areas to facilitate the rural people who cannot purchase computers by themselves. To encourage the private sector to establish cyber caf to provide ICT services in the rural areas. The software venders are suffering from lack of ICT manpower and infrastructure. If introducing Sinhala and Tamil languages breaks the language barrier, which is familiar to the students, it may help to build local capacity. Arrangements should be in place for the maintenance of computer related services in schools. It is necessary to n open dialogue and professional discussions to create awareness on ICT in the rural areas, To support and facilitate to develop local contents for the Internet

Faculty of Information Technology-University of Moratuwa

262

ICT for National Development

As the knowledge is path to improve the quality of life, which is poor in the countryside of Sri Lanka, it is the responsibility of the government to evacuate the barriers that prevent the flow of knowledge in to the country masses. Policy makers have to consider this seriously with a view to minimize the gap of economic condition as well as knowledge between the societies of urban and rural areas.

Faculty of Information Technology-University of Moratuwa

263

High Quality of Life


Wealth Creation Socio-Economic Development

ICT for National Development

Poverty Reduction
(Rural and Urban)

Employment Creation and Income Generation

Youth Indigenous Knowledge Disadvantaged

Peace & Democracy

e-Society Projects
Innovation s

Women

Faculty of Information Technology-University of Moratuwa

264

ICT for National Development

Faculty of Information Technology-University of Moratuwa

265

You might also like