Ug Computer Manual PDF
Ug Computer Manual PDF
ON
Computer Application
(for Under Graduate courses)
by
Dr. Amulya Kumar Parida, Ph.D.
Associate Professor
By
Dr. Amulya Kumar Parida, Ph.D.
Associate Professor
PREFACE
The knowledge of agricultural statistics is required to all
concerned and particularly the professionals. It is well known that
the valid information is very important which is obtained through
problem formulation to data collection & compilation, data storage
& retrieval, appropriate statistical analysis and interpretation. So,
in this advanced age, the knowledge of subject statistics as well
as application of computer plays a vital role in handling
voluminous data collection, storage and any complex analysis.
This practical manual has been conceived and prepared for
the students as per the syllabi of 4th Dean’s committee of ICAR for
under graduate courses in agriculture and allied sciences to
acquaint the basics of computer and its application for data
handling, analysis, report writing, presentation, internet browsing
and electronic communication of various forms of information. The
contents of the manual have been prepared by referring many
text books, journals, manuals and the internet. I acknowledge the
help due to those sources. I expect comments from the users of
this manual for any addition or deletion and improvement in
future. I wish the practical manual would be very much useful to
the students and researchers.
I may, also, thank to the authorities for providing funds
from the XIth ICAR development grant for printing the manual.
PRACTICAL-1: Study of Computer Components, Booting of Computer and its Shut Down:
1.1. Computer Components:
A Computer is an electronic device that can perform activities that involve mathematical,
logical and graphical manipulations. Generally, the term is used to describe a collection of devices
that function together as a system. It performs the following three operations in sequence.
Central Processing Unit: It is the part of the computer that carries out the instructions
computer program. It is the unit that reads and executes program instructions. Hence it is known as
the brain of the computer. The CPU consists of storage or memory unit, Arithmetic Logic Unit
(ALU) and control unit.
Basically there are two types of processors which are manufactured by two companies and
they are Intel and AMD. Now there are a number of varieties available in both Intel and
AMD.
Intel offers Pentium Pro, Pentium II, Celeron, Pentium II Xeon, Pentium III, Pentium II and
III Xeon, Celeron with Pentium III Based, Pentium 4, Pentium M, Intel Core, Dual Core Xeon LV,
Intel Pentium Dual Core, Intel Core 2, Pentium Duo, Pentium Dual Core, Core 2 Quad, Intel
Pentium 2 Dual Core Processor.
AMD processors include AMD Athlon, AMD Athlon 64, AMD Athlon X2, AMD Athlon
Xp, AMD Duron, AMD Sempron, AMD Turion, MD Opteron and AMD Phenom 1.
Moreover, there are various processors offered by various companies like Macintosh
processor. In other words different processors are used for different types of technology.
(a). Memory Unit: It is also known as the primary storage or main memory. It stores data,
program instructions, internal results and final output temporarily before it is sent to an
appropriate output device. It c o n s i s t s of t h o u s a n d s of cells called ―storage locations‖. These
cells activate with ―off-on or binary digits(0,1) mechanism. Thus a character either a letter or
numerical digit is stored as a string of (0,1) BInary digiTS ( BITS). These bits are used to store
instructions and data by their combinations.
Types of Memory: A computer memory is of two types:
1) Primary Memory (Internal storage)
2) Secondary Memory (External storage)
Primary Memory: Primary memory is also called internal memory and is an important part of
Department of Agricultural Statistics, OUAT Page-6
UG Practical Manual on Computer Application
a computer. It is the main area in a computer where the data is stored. The stored data can be
recalled instantly and correctly whenever desired. This memory can be quickly accessed by the
CPU for reading or storing information. Primary memory is further classified into two types:
Random Access Memory (RAM) and Read- Only Memory (ROM )
RAM: It is also known as read/write memory as information can be read from and written onto it.
RAM is a place in a computer that holds instructions for the computer, its programs and the data.
The CPU can directly access the data from RAM almost immediately. However, the storage of data
and instructions in RAM is temporary, till the time the computer is running. It disappears from
RAM as soon as the power to the computer is switched off. i.e it is volatile memory.
Fig. 4. A RAM
ROM: It is called Read-only memory as information can only be read from and not written or
changed onto ROM. ROM is the built-in memory of a computer. It stores some basic input–output
instructions put by the manufacturer to operate the computer. The storage of data and instructions in
ROM is permanent. It does not depend on the power supply i.e it is non-volatile memory.
Secondary memory: The primary memory which is faster (and hence expensive) is generally
not sufficient for large storage of data. As a result, additional memory, called the ―auxiliary or
―secondary memory is used. It is also referred as ―backup storage as it is used to store large volume
of data on a permanent basis which can be transferred to the primary memory whenever required
for processing. Data are stored in secondary storage in the same binary codes as in the main
(primary memory) storage. Some of the devices of secondary storages are Floppy Disk, Hard
Disk, CD-ROM(CD-R, CD_RW), D V D ( DVD-R, DVD_RW) and Flash drive.
obtained from a printer is often referred as printout. The different printers and their speeds are as
follows:
1 Dot – Matrix Prints the character in dotted pattern through printer 200/300 to 700
printer ribbon using either 24 pin or 9 pin CPS
3 Laser printer Also called page printer. Uses laser beam to produce an 6 to 12 PPM
image.
4 Line printer Prints lines at a time instead of single characters. 300 to 600 LPM
( CPS: Characters Per Second; PPM: Pages Per Minutes; LPM : Lines Per Minute)
3. Plotter: Produces drawings or graphs through pens which are filled with different colours.
Both Input/Output devices:
Floppy drive, Hard disk drive, Tape drive, Zip drive, CD/DVD drive, Pen drive, etc.
1.2. Booting of Computer and its Shut Down:
Booting of the Computer implies activating the computer for working. Thus, when the
computer is switched on, the operating system residing in the hard disk is transferred into the
primary memory. After this, the computer is ready to accept the commands at user terminal. If OS
does not exist either in any drive or in the hard disk drive, non-system or disk error is flashed on
the screen. The booting of the computer is carried out with software which resides on ROM chip
called BIOS (Basic Input Output System). Thus when a PC with system disk either in Hard-Disk
Drive or any Drive is switched “on”, the screen finally displays one of the following symbols with a
blinking cursor at its end:
C:\> It imply that the PC is booted through the Hard-Disk Drive `C‘ and is ready to accept DOS
commands.
Booting is essential whenever the system is locked or switched-off. A PC can be booted through two
ways:
a). Cold Booting and b). Warm Booting
To start afresh the computer is called cold booting. In case , if the machine does not work
properly or halt for some reasons then the computer is restarted or rebooted and it is called hot or
warm booting. Hot booting is done either shutting down the power and again by pressing power on
switch or by pressing simultaneously the 3 keys- CTRL+ALT+DEL at a time.
When we sit in a computer, we switch on the computer by supplying electric current through
an UPS (Uninterruptible Power Supply which supplies current through its charged battery for some
specified time even the current goes.) connected to the main power supply from an electric switch
board. An UPS safeguards the computer against problems encountered due to sudden failure and
fluctuation of electricity. So, to work in a computer an UPS is badly required.
When all work done using computer, it's important to turn it off properly—not only to save
energy, but also to ensure that data is saved and to help keep your computer more secure. Best of all,
your computer will start quickly the next time you use it. We work in the computer by booting. After
finishing any job(s) in the computer, it is required to close or make off the computer. Closing the
computer is known as shutting down or turn off computer. To safely close the computer, the
following steps are required.
1. Close all open windows which can be assured from the task bar
2. Click the Start button on the taskbar present at the bottom extreme left
3. Click Shut Down in the pop-up menu and then click OK (if required)
4. Wait for Windows to display a message that “it is safe to turn off your Computer”, then
turn off your computer and monitor.
5. don’t touch the computer till it is completely power off.
PRACTICAL-2: Practice of some fundamental DOS Commands - TIME, DATE, VOL, LABEL,
PATH, DIR, MD, CD, RD, DELTREE, FORMAT and COPY:
A computer is made operational by hardware and software.
a). Hardware: The physical components of the computer are known as hardware. It refers to the
objects that we can actually touch. Ex: input and output devices, processors, circuits and the
cables.
b). Software: Software is a program or set of instructions that causes the Hardware to function in a
desired way. Without software, the Hardware is a dead machine.
There are five categories of software.
1. Operating System 2. Translators 3. Utility programs 4. Application programs
5. General purpose programs
Operating System (OS): The software that manages the resources of a computer system and
schedules its operation is called Operating system. The operating system acts as interface between
the hardware and the user programs and facilitates the execution of programs.
Generally, the OS acts as an interface between the user and the Hardware of the computer. i.e. it is a
bridge between the user and the Hardware.
The User interface provided by the OS can be character (CUI) or graphical (GUI) based.
CUI (Character user Interface) : It is operated with keyboard only. Ex: MS-DOS, UNIX
Disk Operating System (DOS) was developed as early as 1980 by Microsoft of Bill Gates. DOS is
a single user and single task operating system.
MSDOS commands are of two types.
i). Internal commands (written in COMMAND.COM file present in hard disk):
Examples - CD, CLS, COPY, COPY CON, DATE, DEL, DIR, MD, REN,
RD, TIME, VER, TYPE, VOL etc.
ii). External commands (written as program files with filename extension of
.COM, .EXE or .BAT and present in the hard disk):
Examples – CHKDSK, BACKUP, EDIT, FORMAT, MORE, PRINT, SORT,
TREE, DELTREE, XCOPY, etc.
GUI (Graphical User Interface): The system can be operated with mouse and keyboard.
WINDOWS :It works with DOS and it supports single user and multitask system.
UNIX AND XENIX: Suited for multi-user and multi-task system
MSDOS is a collection of programs and other files. It is a single user and single
programming environment. MSDOS is designed to provide a method of organizing and using the
information stored on disks, application programs, system programs and the computer itself.
Files and File names: A file is a collection of related information. The files should have suitable
names for their identification in later use.
Rules for naming the files:
1. File names should be of one to eight characters in length with an option of one to three character
extension.
2. File names can include any one of the following characters:A to Z (or a to z) 0 to 9, $, &, #, @. %,
( ),{}
The characters which are not allowed are: :, ; + / \ * as these have special meaning
3. A period (.) is used to separate the first part of a file name from the extension. (LETTER, TXT,
RAMA.WK1, etc.,)
4. When a file name includes an extension, it should be referred along with its extension and not
only with the first part.
5. Reserved devices names are not allowed. (COMMAND.COM, DATE, etc.).
The details of the DOS commands and their syntax (the way of typing the command in DOS
environment of the computer to get the result) are given serially in the following for the ease of
learning. After typing each command in its proper syntax, the ENTER key is to be pressed gently
once to get the result. For example to get the result of the command VER, the user is to follow as:
C:\>VER <ENTER>
1). CLS: Clears the screen. The cleared screen shows only the command prompt and cursor (the
blinking light on the screen).
Syntax: CLS
2). VER: Displays the MS-DOS version number of the computer.
Syntax: VER
3). VOL: Displays the disk volume label and serial number, if the disk has them.
Syntax: VOL [drive:]
Parameters
drive: Specifies the drive(A or C or D or E etc.) that contains the disk for which you want to display
the volume label and serial number.
4). DATE: Displays the date and prompts you to change the date if necessary. MS-DOS records the
current date for each file you create or change; this date is listed next to the filename in the directory.
Syntax : DATE [mm-dd-yy]
Parameter
mm-dd-yy: Sets the date you specify. Values for day(dd), month(mm), and year(yy) must be
separated by hyphens (-). The following list shows the valid values for the month, day, and year
portions of the mm-dd-yy parameter.
mm 1 through 12
dd 1 through 31
yy 80 through 99 or 1980 through 2099
5). TIME: Displays the system time or sets your computer's internal clock. MS-DOS uses time
information to update the directory whenever you create or change a file.
Syntax : TIME [hours:minutes:seconds.hundredths A|P]
To display the current time or to display a prompt by which you can change the current time,
use the following syntax:
Parameters
Hours : Specifies the hour. Valid values are in the range 0 through 23.
Minutes : Specifies minutes. Valid values are in the range 0 through 59.
Seconds : Specifies seconds. Valid values are in the range 0 through 59.
Hundredths: Specifies hundredths of a second. Valid values are in the range 0 through 99.
A|P : Specifies A.M or P.M. for the 12-hour time format. If you type a valid 12-hour time but do not
type A or P, TIME uses A (for A.M.).
6). DIR: Displays a list of the files and subdirectories that are in the directory you specify. When you
use DIR without parameters or switches, it displays the disk's volume label and serial number; one
directory or filename per line, including the filename extension, the file size in bytes, and the date
and time the file was last modified; and the total number of files listed, their cumulative size, and the
free space (in bytes) remaining on the disk.
7). MKDIR or MD: Creates a new directory. You can use the MKDIR or MD command to create a
multilevel directory structure.
Syntax: MKDIR [drive:]path
OR
MD [drive:]path
Parameters
drive: Specifies the drive on which you want to create the new directory.
path : Specifies the name and location of the new directory.
IMPORTANT: The maximum length of any single path from the root directory to the new directory
is 63 characters, including backslashes (\).
8). CHDIR or CD: Displays the name of the current directory or changes the current directory.
Syntax: CHDIR [drive:][path]
OR
CD [drive:][path]
Parameters
[drive:][path] : Specifies the drive (if other than the current drive) and directory to which you want
to change.
CD.. Specifies that you want to change back to the parent directory.
CD\ Specifies that you want to change back to the root directory.
9). RMDIR or RD: Deletes (removes) a directory. Before you can delete a directory, you must
delete its files and subdirectories i.e., the directory must be empty.
Syntax: RMDIR [drive:]path
OR
RD [drive:]path
Parameter
[drive:]path : Specifies the location and name of the directory you want to delete.
10). COPY CON: In the computer when there is/are no software to create a new file, it creates a
new file with the typed words/messages in the console of the computer. After typing the contents,
the file is saved by pressing F6 key or CTRL+Z. A file created in COPY CON is a text file in ASCII
format.
Syntax: C:\CLASS>COPY CON [file name] <press ENTER>
11). TYPE: Displays the contents of a text file only but not in any other format. Use the TYPE
command to view a text file (ASCII format) without modifying it.
Syntax: TYPE [drive:][path]filename
Parameter
[drive:][path]filename : Specifies the location and name of the file that you want to view.
TYPE drive:\file name | more - to see page-wise of a big file
TYPE drive:\file name >prn - to send the contents of the file to the printer
12). RENAME or REN: Changes the name of the file or files you specify. You can rename all files
matching the specified filename. You cannot use the RENAME command to rename files across
drives or to move files to a different directory location.
Syntax: RENAME [drive:][path]filename1 filename2
OR
REN [drive:][path]filename1 filename2
Parameters
[drive:][path]filename1 : Specifies the location and name of the file or set of files you want to
rename.
filename2 : Specifies the new name for the file or, if you use wildcards, the new names for the files.
(You cannot specify a new drive or path.)
13). COPY: Copies one or more files to the location you specify. This command can also be used to
combine files. When more than one file is copied, MS-DOS displays each filename as the file is
copied.
Syntax : COPY [/Y|/-Y] [source+ source + ...] [destination ] [/V]
Parameters
source : Specifies the location and name of a file or set of files from which you want to copy.
Source can consist of a drive letter and colon, a directory name, a filename, or a combination.
destination : Specifies the location and name of a file or set of files to which you want to copy.
Destination can consist of a drive letter and colon, a directory name, a filename, or a combination.
Switches
/Y : Indicates that you want COPY to replace existing file(s) without prompting you for
confirmation. By default, if you specify an existing file as the destination file, COPY will ask you if
you want to overwrite the existing file.
/-Y : Indicates that you want COPY to prompt you for confirmation when replacing an existing file.
/V : Verifies that new files are written correctly.
14). XCOPY: Copies directories, their subdirectories, and files (except hidden and system files).
With this command, you can copy all the files in a directory, including the files in the subdirectories
of that directory.
Syntax : XCOPY [source] [destination] [/Y|/-Y] [/D:date] [/P] [/S] [/E] [/V] [/W]
Parameters
source : Specifies the location and names of the files you want to copy. Source must include either a
drive or a path.
destination : Specifies the destination of the files you want to copy. Destination can include a drive
letter and colon, a directory name, a filename, or a combination.
Switches
/Y : Indicates that you want XCOPY to replace existing file(s) without prompting you for
confirmation. By default, if you specify an existing file as the destination file, XCOPY will ask you
if you want to overwrite the existing.
/-Y : Indicates that you want XCOPY to prompt you for confirmation when replacing an existing
file.
/D:date : Copies only source files modified on or after the specified date. Note that the format of
date depends on the COUNTRY setting you are using.
Department of Agricultural Statistics, OUAT Page-17
UG Practical Manual on Computer Application
/P : Prompts you to confirm whether you want to create each destination file.
/S : Copies directories and subdirectories, unless they are empty. If you omit this switch, XCOPY
works within a single directory.
/E : Copies any subdirectories, even if they are empty.
/V : Verifies each file as it is written to the destination file to make sure that the destination files are
identical to the source files.
/W : Displays the following message and waits for your response before starting to copy files:
Press any key to begin copying file(s)
15). PRINT: Prints a text file(ASCII format) while you are using other MS-DOS commands. This
command can print in the background if you have an output device connected to one of your system's
serial or parallel ports.
Syntax: PRINT [drive:][path]filename
Parameter
[drive:][path]filename : Specifies the location and name of a file or set of files you want to print.
You can include multiple files (usually as many as 10) on one command line.
16). DEL or Erase: Deletes the files you specify.
Syntax: DEL [drive:][path]filename [/P]
OR
ERASE [drive:][path]filename [/P]
Parameter
[drive:][path]filename : Specifies the location and name of the file or set of files you want to
delete.
Switch
/P : Prompts you for confirmation before deleting the specified file.
17. FORMAT: FORMAT command is used to erase all information of a diskette or fixed drive.
1. format a:
Would erase all the contents off a disk. Commonly used on a diskette that has not been
formatted or on a diskette you wish to erase.
2. format a: /q
Quickly erases all the contents of a floppy diskette. Commonly used to quickly erase
all information on the diskette.
3. format c:
This would erase all the contents of C: hard disk drive. In other words, unless you
wish to erase all your computer's information, this command should not be done unless
you're planning to start over.
18. PATH: Path is used to specify the location where MS-DOS looks when using a command. For
example, when using the command "format", if the path is not specified to where the command is
you will receive bad command or file name. For example
PRACTICAL-3: Practicing WINDOWS Operating System - use of Mouse, Title Bar, Minimum,
Maximum and Close Buttons, Scroll Bars, Menus and Tool Bars
WINDOWS
• An operating system with a graphical user interface (GUI)
• Graphical User Interface (GUI) is a user interface based on graphics (icons and pictures and
menus) instead of text; uses a mouse as well as a keyboard as an input device)
Versions
Windows 98
Windows Me
Windows NT
Windows 2000
Windows XP
Windows Server 2003
Windows Vista
Windows 7
Windows 8
Computer
lists the contents of floppy disk, hard disk, CD-ROM drive, and mapped network
drives
Network
locates shared resources on the entire network to which the computer is connected.
Recycle Bin
stores deleted files, folders, graphics, and Web pages until you empty the bin.
Internet Explorer
opens the browser internet explorer.
Anatomy of a Window
A rectangular area on the desktop that is used by an application is called a Window. Although the
contents of every window are different, all windows share some things in common. For one thing,
windows always appear on the desktop - the main work area of your screen. In addition, most
windows have the same basic parts:
Title bar: Displays the name of the document and program (or the folder name if you're
working in a folder).
Minimize, Maximize, and Close buttons - These buttons hide the window, enlarge it to fill the
whole screen, and close it, respectively (more details on these shortly).
Menu bar - Contains items that you can click to make choices in a program.
Tool bar – It is present below the Menu bar of some Windows and have ready-made programs
in form of icons viz., Standard tools( New, Open, Cut, Copy, Paste etc.) and Formatting
tools(Bold, Italic, Underlined, Alignments, Spacing etc.).
Scroll bar - Lets you scroll the contents of the window to see information that is currently out
of view.
Borders and corners - drag these with mouse pointer to change the size of the window.
Starting Windows
1. Switch on the power supply.
2. Switch on the CPU and Monitor.
3. Windows XP splash screen will be displayed as shown below and wait for desktop displayed
to work in the computer:
Shutting Down
• Click Start Button Choose Turn Off Computer option
• Click the Turn Off option in the Shut Down Dialog Box.
Use of Mouse
Windows Explorer is a file manager application used to view and manage drives, folders, and
files. Windows Explorer can be opened by clicking on:
Start > My Computer or using the short cut key Windows + E while in Windows Xp
OR Right click Start button and Click Open Windows Explorer
Start > Computer or using the short cut key Windows + E while in Windows Vista.
To delete a folder
Locate and select the folder you want to delete.
Choose delete.
Finding Files
Click Start > Search
Click For Files or Folders and in the box type Name of file and other parameters and hit enter.
PRACTICAL-5: Simple programs in BASIC to compute the Mean, Variance, correlation and
Regression
Statistical data analysis in agriculture can be carried out by writing programs (a set of
instructions for a particular job) in any high level computer languages, viz., BASIC, FORTRAN,
Department of Agricultural Statistics, OUAT Page-28
UG Practical Manual on Computer Application
COBOL, PASCAL, C, C+ , C++ etc. Here, BASIC (Beginner’s All-purpose Symbolic Instruction
Code) language is used as it is an extremely powerful and useful language and easy to learn for a
beginner. The programs can be written by opening the BASIC interpreter in a computer and run for
data analysis.
In BASIC, the instructional statements are almost similar to normal algebra and it is easy to
understand and quick to learn. It contains a relatively less number of statements and its grammar is
simple.
A Sample Program in BASIC
Program on Summing of N numbers:
constants that are to be assigned to the variables in READ statement. The words within the quotation
are known as string constants.
The following are some general rules of writing a program in BASIC:
1. All statements should be numbered. The numbers can be anything ranging from 1 to 9999
2. More than one statement can be written on one line and colon (:) acts as a separator between
the statements. In this case only the first statement can have the statement number. Example:
10 READ X, Y: PRINT X + Y
3. A single statement can be continued on successive lines of the program but the maximum
number of lines that a multiple-line statement can have varies with the system (usually 254
characters including blanks).
4. The highest numbered statement must be the END statement
5. Statements can be entered in any order but the execution will be in ascending order of
statement numbers
6. Blanks will be ignored except those in string constants
7. Any line of information which begins with a numeric character will be treated as a line of
BASIC
2. Numerals :
0, 1, 2, …, 9 (10 characters)
3. Special characters :
minus (operator for subtraction)
+ plus (operator for addition)
* asterisk (multiplication operator)
/ slash (division operator)
^ Caret (exponentiation operator)
( opening bracket (left parenthesis)
) closing bracket (right parenthesis)
, comma
; semicolon
: colon
$ dollar symbol
= equality or assignment symbol
. decimal point
< Greater than
< less than
quotation mark (16 characters)
Only these fifty-two characters are allowed to construct statements in BASIC (subject to
certain rules). Blank space is a character when used in string constants. Other characters used are #
and ?.
Constants
Constants are those that do not change while executing the program. BASIC deals with two types
of constants:
1. Numeric constants
2. String constants
Numeric constants
All numbers belong to this category because their values remain constant.
While writing constants, it is worth remembering the following points:
1. A number can normally have up to a maximum of eight digits but varies with the system.
2. Commas are not allowed in a numeric constant.
3. The use of + sign is optional but sign should be used if the number is negative.
4. The length of the exponent should not be more than two digits and it can contain or + sign.
Again + sign is optional.
5. BASIC does not make any distinction between integer and fractional numbers.
String Constants
A string constant is any set of valid BASIC characters enclosed in quotation marks. The
quotation marks do not form part of the string. Strings are used to represent non-numeric information
such as names of persons and places, addresses, days, months and years, etc. as:
“NAME”
Department of Agricultural Statistics, OUAT Page-31
UG Practical Manual on Computer Application
“R.N.SHARMA”
“NEW DELHI”
“3456”
“A + B”
“10 + 7”
It should be remembered that 3456 is a numeric constant while “3456” is a string constant. No
attempt should be made to perform any arithmetic operations of the quantity 54 with the character
string “32”. It has no meaning to the computer.
Variables
The quantities which change during the execution are variables. One of the important tasks of
preparing a computer program is deciding the appropriate variables and establishing their data
structure. We are familiar with the use of letters which represent quantities that can change in a
formula.
Naming the Variables
We have seen that there are two types of constants, namely, numeric and string constants. BASIC
also has two types of variables to handle the two types of constants as:
1. Numeric variables
2. String variables
Numeric Variables
It can be any single letter or letters followed by one or more numbers starting with an alphabet
but no special character. IBM BASIC allows a length of up to 40 characters for variable names.
Examples: a, b, c, aa, ab, abc, a1, b5, c34, cd456, etc.
String Variables
String variables take string constants. It takes letter(s) or letter(s) in combination with
number(s) but ending with a dollar($) symbol. The valid string variables are:
A$, B$, C$, …, Z$, A1$, AA$, CD$, ABC123$
20 A$= “Ram Gupta”
30 LET VOL$= “Volume of the Container” (Here LET is optional).
Expressions in BASIC
We have simple algebraic expressions like, A + 5, 7 + 2, X + Y, P Q
They are simple arithmetic expressions where numeric variables(like A, X, Y, P, Q) and or
constants are combined using arithmetic operators like + and . We can have also expressions as:
I > N, M >= A, J = M, N < 25
These are known as logical or relational expressions. They compare two variables and are used
for making certain decisions in program logic. BASIC thus deals with two types of expressions.
They are :
1. Arithmetic expressions, and
2. Logical expressions
Arithmetic Expressions
BASIC handles any complex arithmetic expressions. However, the system cannot understand terms
like x2, A x B, etc. Certain arithmetic operations (or symbols) which are meaningful to the computer
are to be used to evaluate such arithmetic expressions are:
+ for addition
for subtraction
* for multiplication
/ for division
^ or ** for exponentiation or power
Examples:
Algebraic expression BASIC expression
A+bx A+BX
axb A*B
A/B
A*B/C
ab A ^B
√ X ^ 0.5
a+bxc A+B*C
4x2 + 3.5 4 * X ^ 2 + 3.5
a(b + 2) A * (B + 2)
So, arithmetic expressions are formed by combining numeric constants and numeric variables
with arithmetic operations in conjunction with brackets, if necessary.
Hierarchy of Operators
During evaluation of expressions, the order of hierarchy is given below:
Operation Order of priority
( ) expression inside 1
the brackets
^ exponentiation 2
/ and * division and 3
multiplication
+ and addition and 4
subtraction
Operations of equal priority are performed from left to right. In the expression of 4 + 9/3
1, division has a higher priority than addition and therefore 9/3 will be executed first. The result 3
will be added to 4 and then 1 will be subtracted from 7 thus giving a result of 6. Though + and
have equal priority, the + which appears first is performed first.
Department of Agricultural Statistics, OUAT Page-33
UG Practical Manual on Computer Application
Rules of Arithmetic
While writing expressions the following rules must be obeyed:
1. Two operators should never appear together, e.g.
A/ B and A ^ B are wrong.
A/( B) (or A/B) and A ^ ( B) are correct.
It should be remembered that brackets are not operators. Similarly, the product of a positive
number with a negative number should be written as A * ( B) or A * B.
2. No attempt should be made to raise zero to a negative power, e.g. in X ^ Y, X should not
become zero while Y is negative.
3. A negative value should not be raised to real number (fractional number) e.g. (5) ^ 2.5 is
not allowed.
If we use expressions like A ^ B in certain repetitive calculations, care should be taken to see
that A does not become negative when B is real or B does not become real when A is
negative.
4. Denominator of an expression should never be zero, e.g. in the expressions (A + B) / (C D),
C and D should never become equal.
5. String constants or string variables are not allowed in expressions, e.g.
A + “B” * C
X * 3.5 “4 + 2”
N$ * A ^ D
are invalid expressions.
6. When variables are used in an expression we should make sure that they are assigned values
before attempting to evaluate the expression.
7. Every left bracket(s) must be matched by a right bracket(s).
Any violation of these rules will be a syntax error and a corresponding error message will be
provided by the computer.
Relational Expressions
In the execution of programs, it is often necessary to compare two numerical quantities (or
sometimes string quantities) and take decisions on achieving certain conditions. For example, we
may wish to check the number of repetitive calculations performed or to find out whether the
denominator of an arithmetic expression has become zero or if a particular quantity is negative, and
so on. Expressions written to compare two quantities using certain relational operator are known as
logical (or relational) expressions. These expressions take only one of the two values, namely, TRUE
or FALSE.
For instance, the relational expression
X>Y
will be TRUE if X is greater than Y, otherwise FALSE. This test result is used to change the
sequence of execution of statements in a program. The general form of a relational expression is:
Constant Constant
or or
Variable Relational operator Variable
or or
Expression Expression
BASIC uses the following relational operators:
Operator Meaning
= Equal to
< Less than
> Greater than
>= or => Greater than or equal to
<= or =< Less than or equal to
<>or >< Not equal to
Examples of logical expression are:
A = 15 is TRUE if A equals to 15, otherwise FALSE
5> 5 is FALSE
3 >= 5 is TRUE
A + B>C D
A + B<C D only one of these can be TRUE.
A+B=CD
When expressions are used on either side of the relational operators, the expressions will be
evaluated first and then the results of expressions compared. This means that the relational operators
come last in the hierarchy of operations, if we write
A * A B> C * C D
the computer will not compare simply B and C. it will first evaluate the expressions a 2 b, then
evaluate the expression c2 d and then compare the computed values. For A = 2, B = 5, C = 4 and D
= 3, the logical expression is FALSE.
Logical expressions are used in IF…THEN statements to determine the course of action of a
running program.
Beware If you use a logical expression like
20 IF B * B 4 * A * C = 0 THEN 90
it means that when b2 4ac = 0, then control should be transferred to the line 90. Remember it will
rarely be exactly zero due to rounding errors of real numbers. This problem can be overcome by
modifying the logical expression as follows:
20 IF ABS (B * B 4 * A * C) < = 0.0001 THEN 90
This statement compares the magnitude of the difference between b2 and 4ac with the
quantity 0.0001 and if it is less than or equal to this quantity then the control is transferred to 90. The
Department of Agricultural Statistics, OUAT Page-35
UG Practical Manual on Computer Application
quantity 0.0001 is known as error limit and can be any value depending upon the need. The ABS(X)
is one of the library functions in BASIC.
Logical Operators
Like relational operators, BASIC also supports logical operators to perform logical operations
on numeric values. Logical operators are used to connect two or more relations and return a TRUE or
FALSE value to be used in a decision.
The common logical operators are:
AND conjunction
OR disjunction
NOT logical negation
For example, the expression
A > 50 AND B > 100
is TRUE when A is more than 50 and at the same time B is more than 100. Similarly,
X < 1.0 OR Y > 10
is TRUE if the value of X is less than one or the value of Y is greater than 10.
Logical operators return results as indicated in the following tables. T indicates a TRUE and
F indicates a FALSE. X and Y are relational expressions.
AND operator
X Y X AND Y
T T T
T F F
F F F
F T F
OR operator
X Y X OR Y
T T T
T F T
F F F
F T T
NOT operator
X NOT X
T F
F T
Sl. System
Functions with Syntax
No. commands
1. SYSTEM Used to exit BASIC interpreter and to come back DOS environment.
SYSTEM <ENTER>
2. CLS To clear the screen.
CLS <ENTER>
3. FILES To display the files and directories. This command works as DIR in DOS
environment.
FILES <ENTER>
4. AUTO To generate automatic line numbers while writing a program.
AUTO <ENTER> - automatically starts from line 10 with increment of 10.
AUTO 100,20<ENTER> - automatically starts from 100 with increment of
20.
5. NEW To erase a program from RAM. It is required to write or load a program.
NEW <ENTER>
6. EDIT To edit a line of a program.
EDIT (line No.) <ENTER>
7. KILL To delete a file permanently from secondary memory when we do not require
a file anymore.
KILL”ABC.BAS” <ENTER> It deletes the file named as ABC.BAS
8. RENUM To renumber a program when it is active.
RENUM Old starting line No.,New starting line No.,Increment No.<ENTER>
Programs in BASIC
PRACTICE -1 :
10 REM "FOR ADDITION AND SUBTRACTION OF TWO NUMBERS"
20 CLS
30 INPUT "ENTER ANY TWO NUMBERS";A,B
40 PRINT "ENTER YOUR CHOICE 1 FOR ADDITION 2 FOR SUBTRACTION"
50 INPUT C
60 IF C=1 THEN 70 ELSE 90
70 S=A+B
80 PRINT S :GOTO 110
90 D=A-B
100 PRINT D
110 END
PRACTICE - 2 :
10 REM * SUM AND MEAN OF N NATURAL NUMBERS (data is taken by the program
itself)*
20 CLS
30 INPUT "What is the value of N =";N
40 LET S=0:LET I=O
50 LET I=I+1
60 LET S=S+I
70 IF I=N THEN 80 ELSE 50
80 PRINT
90 PRINT "No. of Observations =";N
100 PRINT
110 PRINT "Total of the Natural Nos. = ";S
120 PRINT
130 PRINT "Mean of the Natural Nos. = ";S/N
140 END
PRACTICE- 3 :
10 REM *SUM AND MEAN OF N NATURAL NUMBERS (data is written in the program)*
20 CLS
30 INPUT "What is the value of N =";N
40 PRINT
50 LET S=0:LET I=O
60 READ A
70 LET S=S+A
80 LET I=I+1
90 IF I<N THEN 60
100 PRINT
160 NEXT I
170 MD=S2/N
180 PRINT
190 PRINT "Mean Deviation from Mean = ";
200 PRINT USING "#####.##";MD
210 PRINT
220 STOP
230 REM * For Standard Deviation *
240 FOR I=1 TO N
250 SXX=SXX+X(I)*X(I)
260 NEXT I
270 V=SXX/N-(M)^2
280 SD=SQR(V)
290 PRINT "Standard Deviation = ";
300 PRINT USING "#####.##";SD
310 DATA 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20
320 END
PRACTICE- 7 :
10 REM *to compute MEAN,VARIANCE, S.D. and C.V. of a series of observations(by using
variable loop where a condition is required like IF...THEN)*
20 CLS
30 INPUT "HOW MANY OBSERVATIONS= ";N
40 S=0:P=0:S1=0
50 READ X
60 P=P+1
70 S=S+X
80 S1=S1+X*X
90 IF P<N THEN 50
100 M=S/N
110 V=S1/N-(S/N)^2
120 SD=SQR(V)
130 CV=SD*100/M
140 PRINT "No. of Observations=";N
150 PRINT
160 PRINT "Variance of X=";V
170 PRINT
180 PRINT “Mean of X = “;M
190 PRINT
200 PRINT "Standard Deviation of X=";SD
210 PRINT
220 PRINT "Coefficient of Variation=";CV;”%”
230 DATA 12,14,15,16,13,11,10,12,14,15,11,10,11,11,12,13,14,16,18,20,18,15,16,17
240 END
PRACTICE- 8 :
10 REM *To compute MEAN, MEAN DEVIATION,VARIANCE, S.D. and C.V. (by using
fixed loop where operations are repeated a fixed number of times i.e.; use of FOR…NEXT
statement)*
20 CLS
30 INPUT "No. of observations = ";N
40 DIM X(N),S1(N)
50 FOR I=1 TO N
60 READ X(I)
70 SX=SX+X(I)
80 SXX=SXX+X(I)*X(I)
90 NEXT I
100 M=SX/N:V=SXX/N-(SX/N)^2:SD=SQR(V):CV=SD*100/M
110 FOR I=1 TO N
120 S1(I)=ABS(X(I)-M)
130 S2=S2+S1(I)
140 NEXT
150 MD=S2/N
160 PRINT
170 PRINT TAB(8);"Mean";SPC(12);"M.D.";SPC(7);"Variance";SPC(10);"S.D.";
SPC(7);"C.V.(%)"
180 PRINT
190 PRINT USING "#########.####";M,MD,V,SD,CV
200 DATA 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20
210 END
PRACTICE- 9 :
10 REM "Computation of simple CORRELATION COEFFICIENT"
20 CLS
30 INPUT "No of observations=";N
40 DIM X(N),Y(N)
50 FOR I=1 TO N
60 INPUT "ENTER VALUE OF X ";X(I)
70 INPUT "ENTER VALUE OF Y ";Y(I)
80 S=S+X(I)*Y(I)
90 T=T+X(I)^2
100 U=U+Y(I)^2
110 V=V+X(I)
120 W=W+Y(I)
130 NEXT I
140 A=V/N
150 B=W/N
160 LET D=(T-N*A*A)*(U-N*B*B)
170 R=(S-N*A*B)/SQR(D)
X 12 15 18 14 20 16 14 10 15 25 16 20 15 17 20
Y 10 12 13 11 15 12 12 8 12 20 14 10 18 12 14
PRACTICAL-6: MS WORD: Creating a document, editing and saving; use of options from tool
bars - Format, Insert and Tools (Spelling & Grammar), alignment of paragraphs and text
Word-processing: Word-processing is essentially typing, editing, and manipulation of a document
in a desired form.
Word-processing the process of using computer to create, edit and print documents.
Word processing is creating documents with
o Various formatting viz., font face, font styles, font sizes, font colors (eg: one, two, three)
o Different text effects
etc.
Standard Toolbar
This toolbar contains buttons to allow you to perform the basic operations such as opening and
closing a document, moving and printing data.
Style menu: Allows you to make your text Bold, Italic, underlined… depending on the style
you choose.
Font: Allows you to change the font by clicking on the drop-down arrow on the right of the
font name box. You can view a list of fonts available, you can scroll down to view more
fonts and select the font name you wish to use by clicking on its name.
Font size: Allows you to change the font size by clicking inside the Font size box and entering
a value or by clicking on the drop-down arrow on the right of the box to view a list of sizes
available. Select then a size by clicking on it.
Note: A Font size of 11 or 12 is best for paragraphs of text.
Bold, Italic, Underline: Each button respectively allows you to make your text appear as bold,
italic or underlined.
Alignment: Each button respectively allows you to make your text aligned to the left, center or
right side of the page. You can also justify the text across the page using the justify button.
Line spacing: Allows you to set the amount of space that word puts when go to a new line.
Text orientation: Allows you to change the typing direction of your text, from left to right or
right to left manner.
Numbering, Bullets: Allows you to make your text appear as a bullets list or as a numbering
list.
Increase / Decrease indent: Allows you to increase or decrease the indentation of your
paragraph in relation to the side of the page.
Outside Border: Allows you to add a border around a text selection.
Highlight color: Allows you to change the color behind a text selection.
Font colour: Allows you to change the colour of the text.
Features of word processing
Word processors vary considerably, but all word processors support the following basic
features:
Insert text: Allows you to insert text anywhere in the document.
Delete text: Allows you to erase characters, words, lines, or pages as easily as you can cross
them out on paper.
Cut and paste: Allows you to remove (cut) a section of text from one place in a
document and insert (paste) it somewhere else.
Copy: Allows you to duplicate a section of text.
Search and replace: Allows you to direct the word processor to search for a particular word
or phrase. You can also direct the word processor to replace one group of characters with
another everywhere that the first group appears.
Word wrap: The word processor automatically moves to the next line when you have filled
one line with text, and it will readjust text if you change the margins.
Editing: Words or lines can be entered (inserted) or deleted in any part of the text with
proper alignment. Similarly, there is a facility to recover the text which is deleted by
mistake or accidentally. Another important facility is that any word can be replaced by a
new word through out the file, wherever the old word appears. In addition to these, a block of
text(which is frequently used) can be prepared and moved or copied wherever desired in the
file.
Print: Allows you to send a document to a printer to get hardcopy.
Formatting: The text formatting refers to the way the text is desired to appear on a page.
This includes following functions
setting left and right margins
paragraph settings
line spacing
selecting font specifications such as underline, bold, italics, superscripts and
subscripts
setting foot-notes
number of lines per page
printing page numbers and headings for Header and Footer
table of contents
• The opening word screen will get displayed as shown below. The opening screen of
word will automatically open a new document and the default name of that document will be
Document1.
• If you've already started Word, you create a new document by clicking New on the File
menu. In the New Document task pane that opens, click Blank document.
• In the upper-left corner of the document, or page, is the insertion point, a blinking vertical
line. Typed content will appear there.
• Keep typing continuously even if the end of the line encountered. With the help of the
word wrap property the lines will be automatically displayed in the next consecutive
lines.
• Press ENTER to start another paragraph.
Navigating Through Document
• Movement around the created document is achieved with the help of the following operations:
From the Edit menu select Paste option or click paste icon ( ) in the toolbar or press the
short cut key Ctrl+V
4. Find and Replace
Find searches for specified text in the active document
To find a specified text in the document go to Edit menu choose find option or click the find
icon ( ) on the toolbar or make use of the shortcut key combination Ctrl+F.
The Find and Replace dialog box will get displayed.
Clicking Find Next and Replace buttons the specified text will be replaced.
To replace all the instance of the text lecture with the text lecture schedule click
Replace All button in the Find and Replace window.
Then every instance of the text lecture in the document will get replaced with the text
lecture schedule.
5. Formatting the Document
Font
Font change font style, size, color and a large number of other features.
To change the font style, size of a selected text go to format menu and select
Font option or click the font icon ( ) in the format toolbar.
The Font dialog box will get displayed.
In the Font dialog box choose font face, font style, font size, font color etc.
Click OK button then the applied font effects will get reflected in the document.
Bold, Italic and Underline
Bold, Italic, Underline - Format selected text: Bold, Italic, or Underlined
To bold the text press Ctrl + B or click the bold icon ( ) on the toolbar
To underline the text press Ctrl + U or click the underline icon ( ) on the toolbar
To italics the text press Ctrl + I or click the italic icon ( ) on the toolbar
Paragraph
Paragraph under format menu indents a paragraph using either margin or place some
chosen amount of space before or after the paragraph.
Select the paragraph if already entered or simply go Format menu and choose
Paragraph option or click the paragraph icon ( ) in the toolbar.
Paragraph dialog box will get displayed.
In the paragraph window we can set Alignment, Indentation and Spacing for paragraphs.
Click OK will reflect the changes in the document accordingly.
Saving the document
To save the document for the first time click File MenuChoose Save As
Save As dialog Box will get displayed.
Select the directory where you want to save or create a new folder by clicking New
Folder icon.
Enter the file name in the File name box.
Save dialog box appears. Type the name and click Save.
PRACTICAL-7: MS WORD: Creating a table, merging of cells, column and row width
Creating a table
To create a table, you can use Word, Excel, or Microsoft Access. Excel and Word can automatically
format the table.
Inserting a table
• From the menus, choose Table – Insert – Table
• A dialogue box appears. Change the numbers to create a 4 X 4 table as below
• Type the data as shown using the TAB key to move between fields
Month Spades Wheelbarrows Genomes
Jan 1000 990 2489
Feb 876 754 1765
March 2000 1000 3456
Formatting a table
You can use the Table menu to select parts or the entire table.
You must position the cursor in the table, otherwise the Table menu options will be
unavailable
You can also select table objects by clicking & dragging, just as you would for normal text
You can format the text in your table by selecting the text, then applying formatting (for
example bold, italic, underline, different fonts) just as you would in any document
You can use one of the predefined AutoFormats by choosing Table Autoformat from the
Table menu
Electronic Spreadsheet
An electronic spreadsheet is the computer equivalent of a paper ledger sheet. It consists of a grid
made from columns and rows.
Spreadsheet program allows us to create professional spreadsheets and charts.
It performs numerous functions and formulas to assist us in our projects.
Electronic Spreadsheet Packages
Examples of spreadsheet programs are:
Lotus 1-2-3
Corel's QuattroPro
MS Excel
Excel is a spreadsheet program from Microsoft Office for data storage, data analysis and many
other applications.
Starting Microsoft Excel
Double click on the Microsoft Excel icon on the desktop or
Click on Start --> Programs --> Microsoft Excel
Concepts
Spreadsheets are commonly referred to as workbook in Excel and have many worksheets.
Each worksheet is made up of
columns
rows
intersections of row and columns called cells
Standard Toolbar
The Standard toolbar, located beneath the menu bar, has buttons for commonly performed
tasks like adding a column of numbers, printing, sorting, and other operations. Excel let's you
customize the toolbar or even display multiple toolbars at the same time. The Standard Excel XP
toolbar appears in the figure below.
Formatting toolbar
The Formatting toolbar, located beneath the Standard toolbar bar, has buttons for various
formatting operations like changing text size or style, formatting numbers and placing borders
around cells.
Name box
The Name box displays the reference of the selected cells in the form of column label
followed by row number.
Row, Column and Cell
The column is defined as the vertical space that is going up and down the window.
Letters are used to designate each column’s location.
The row is defined as the horizontal space that is going across the window. Numbers are
used to designate each row’s location.
The cell is defined as the space where a specified row and column intersect.
Each cell is assigned a name according to its column letter and row number.
The selected cell is highlighted.
The address or the name of the cell selected as B6 or A3 or Z12 etc.
A cell may contain any one of the following types of data:
text (labels)
number data (constants)
mathematical and statistical formulas
Editing Spreadsheet
To edit the contents of a cell
Select the cell, type the new contents and press enter. The new entry will be
replacing the existing contents
Or select the cell to be edited, click on the Formula bar or double click the cell then
edit the contents and press enter.
Saving Spreadsheet
Click on Save As from File menu.
In the Save As dialog box
Select the directory
Enter the file name
Click on Save button
Formatting Numbers:
Formatting data in a worksheet includes changing the number of decimal places, displaying dates,
times & fractions and adding currency symbols.
To format the number in a cell, the steps are: Format/Cell/N/umber/Decimal places/2
Formatting Text: Text can be formatted using the buttons on the formatting toolbar. Font of a
cell, font size can be changed. The font style can also be changed to bold, Italic etc.
Inserting Rows & Columns:
In Excel, rows & columns can be inserted or deleted without affecting the surrounding rows,
Department of Agricultural Statistics, OUAT Page-64
UG Practical Manual on Computer Application
B). Entering formula expressions through the formula tool bar and use of inbuilt functions -
SUM, AVERAGE and STDEV
In-built Functions
• A function is an in-built program, which is used to do a particular task.
• Functions take the input and will give the result as the output.
• Based on the input and output data the functions are categorized as
o String functions
o Arithmetic functions
o Date functions
o Logical functions
o Group functions
Function Wizard:
The Function Wizard is a tool in Excel through which a user can enter formulas in the correct
format without any errors. It contains all the functions according to the type such as
Mathematical, Statistical, Date/time, Financial etc.
Using the in-built function SUM() we can calculate the total scored by each and every
student in I-B. Sc. (Agri.).
Add Total column in the spreadsheet as shown below:
Department of Agricultural Statistics, OUAT Page-66
UG Practical Manual on Computer Application
Select SUM function and click OK button in the Insert Function dialog box.
The function Argument dialog box will be displayed with the automatically assumed
range of cells to be added(B3 to E3)
Click OK. The result is displayed as shown. We can even choose the range of cells
added manually.
The total marks scored by the other students have to added in the same way by making use
of the SUM() function.
Instead entering the same function for all the students in the example we can copy the
formula to the cells in the total column to add B4:E4, B5:E5, B6:E6 and so on.
When we copy the SUM() function formula from the cell F3 to F4 the SUM function will
automatically taking the input range of numbers to be added is B4:E4.
The same is applicable to the rest of the cells in the total column.
To copy down the formula place the mouse pointer at the bottom right corner of the cell
F3.
The mouse pointer now automatically changes into + symbol.
Now drag + symbol down the cells in the Total column.
We can see the total marks of all the students in the example as shown below.
Writing Expressions
The total marks can be calculated by writing expressions.
Place the cursor in the cell F3.
To enter expression, enter the equal sign first.
Press enter. The result will be displayed in F3. Copy the expression down the Total
column to find the total mark scored by all the students in the example.
To calculate the averages, place the G3.
Enter the equal sign first in the cell G3.
Enter F3/4 which is the average to be calculated.
Press enter. The average will be displayed. Copy the expression down the cells in the
Average column to calculate the rest of the averages.
Example
Suppose 10 tools stamped from the same machine during a production run are collected as a random
sample and measured for breaking strength. The sample values (1345, 1301, 1368, 1322, 1310, 1370,
1318, 1350, 1303, 1299) are stored in A2:E3, respectively. STDEV estimates the standard deviation
of these data.
STDEV(A2:E3) equals 27.46
PRACTICAL-9: MS EXCEL: Data analysis using inbuilt tool packs - tests of significance on F-
test, t-test for two sample means, Correlation & Regression
Data analysis using inbuilt tool packs
Most of Excel’s statistical procedures are part of the Data Analysis ToolPak. This option is available
in TOOLS menu and there are different tools for analysis of descriptive statistics, t-tests, F-test,
correlations, regression, etc.
Two-Sample for Variances dialog box is obtained from Tools Menu and then Data analysis as:
Alpha
Enter the confidence level for the test.
Output Range
Enter the reference cell of the output table.
The test is not significant indicating equal means of the two samples.
Correlation
To do the correlation we consider a problem of finding correlation coefficient of data
which relates to the Yield in grams (Y) and the Matured Pods (X) of 10 groundnut plants.
The data is entered in the Excel sheet as follows:
Choose Correlation from the Data Analysis window then click OK button.
Correlation window will get displayed as follows:
Enter the input range if you know the input range of data or else make use of the
address icon to mark the input range in the Excel sheet. In this example the input range is
A2:B12.
Since the data are grouped by column in this example, choose Grouped by Columns
option.
We can add the labels as the first row in the data range. So check the Labels in First Row.
In the output options choose where you want to display the output. In this example the
output range is given as D2.
Regression
The Regression procedure in the Data Analysis tools lets you choose one column as the
dependent variable, and a set of contiguous columns for the independents
It does not tolerate any empty cells anywhere in the input ranges.
Therefore, if there is any empty cells in the input range, delete the rows contain empty
cells.
Choose Regression from Data Analysis and click OK.
In the Regression window enter the Y and X ranges if you know the address values or else
the click the colored icon in the Y and X range tabs to fill the addresses.
If the first row of the data entered includes labels then check the Labels box in the
Regression window.
PRACTICAL-10: MS EXCEL: Creating and saving graphs with & without data
Graphs or Charts
The graphical representation of data is called graph or chart.
The data entered in the excel sheet can be represented by a graph or a chart.
MSEXCEL supports a wide variety of graphs.
Example of graphs: Column, Line, Bar, Pie, Scatter, Area, Doughnut, Radar, Surface,
Bubble, Stock etc.
Column Graph
It shows data change over a period of time or illustrates comparisons among items.
Categories are organized horizontally and values vertically.
It is an idel chart for showing the variation in the value of an item over period of time.
Bar Graph
Bar graph illustrates comparison among individual items.
Categories are vertically organized and values horizontally.
Line Graph
A line graph shows trends in data at equal intervals.
It is very useful to show the change in the value over a period of time.
It will show very clearly whether a value is ascending or descending.
Pie Chart
Pie chart is used to plot data for a single data series.
Each data point is represented by one piece of the circular pie chart.
The size of each piece is proportional to the value it represents, so all the data points
taken together will form circle.
Area Graph
Area chart is similar to line chart.
But plots series one above the other with different colors and shades.
It emphasizes the magnitude of change over a period of time.
XY (Scatter) Graph
It plots each point with a mark of two groups of numbers as one series of XY
coordinates.
It shows uneven intervals of data and it is commonly used for scientific data.
CREATING GRAPHS
Create a spreadsheet with data rice yield in tones from the year 1998 to 2004 as shown below:
The range is to conform that the chart is being prepared of the proper sheet of the file.
On confirming click on Next button.
A dialog box of chart wizard will appear, select the required type of chart from the chart type.
Second Step
Select the data range in this step.
To give enter data range move the cursor on excel sheet and
o by clicking select the data area you want or
o type cells position if you know exactly which area you want.
Click on the Next button.
the data range selected in our example is Sheet1!$A$1:$B$9
Sheet1 we are in sheet1 in MS Excel.
$ Sign is used to represent the absolute position of the data in MS Excel.
Third Step
Here the Chart title, Category and Value information are entered, which will be displayed when
the chart is viewed.
Moving Chart
If the chart needs to be placed in different position, then we can move the chart
wherever we want.
To move the chart select the chart by clicking on it without leaving the mouse button, drag in
the direction you want.
The chart will move and then release it where you want.
Changing the Chart Size
To change the chart size, select the chart by clicking on it.
You will get eight small rectangular boxes around the chart.
Now move the cursor to the border of the chart and the mouse pointer changes to
double headed arrow cursor.
Select the required chart type from the chart type window.
Click OK.
If the selected chart type is Area type then the chart will be as shown below:
Title Bar: The Title bar generally appears at the top of the screen. The Title bar displays the title of
the current presentation.
Menu Bar: The Menu bar displays the menu. You use the menu to give instructions to PowerPoint.
Standard and Formatting Toolbars
PowerPoint has several toolbars. Toolbars provide shortcuts to menu commands. The most
commonly used toolbars are the Standard and Formatting toolbars. You use the Standard toolbar to
do such things as open a file; save a file; print a file; check spelling; cut, copy, and paste; undo and
redo; or insert a chart or table. You use the Formatting toolbar to change the font, font size or font
color; bold, underline, or italicize text; left align, right align, center, or justify; bullet or number lists;
highlight; or decrease or increase the indent.
Rulers: Rulers are vertical and horizontal guides. You use them to determine where you want to
place an object. They are marked in inches.
Placeholders: Placeholders hold the objects in your slide. You use placeholders to hold text, clip art,
and charts.
Status Bar: The Status bar generally appears at the bottom the screen. The Status bar displays the
number of the slide that is currently displayed, the total number of slides, and the name of the design
template in use or the name of the background.
Outline Tab: The Outline displays the text contained in your presentation.
Slides Tab: The Slides tab displays a thumbnail of all your slides. You click the thumbnail to view
the slide in the Slide pane.
View Buttons: The View buttons appear near the bottom of the screen. You use the view buttons to
change between Normal view, Slider Sorter view, and the Slide Show.
Normal View
Normal view splits you screen into three major sections: the Outline and Slides tabs, the Slide
pane, and the Task pane. The Outline and Slides tabs are on the left side of your screen. They
enable you to shift between two different ways of viewing your slides. The Slides tab shows
thumbnails of your slides. The Outline tab shows the text on your slides. The Slide pane is
located in the center of your screen. The Slide pane shows a large view of the slide on which
you are currently working. The Task pane is located on the right side of your screen. The
Tasks pane enables you to select the task you want to perform.
Slide Sorter View
Slide Sorter view enables you to view thumbnails of all your slides. In Slide Sorter view you
can easily add, delete, or change the order of your slides. When you are in Slide Sorter view,
a special Formatting toolbar appears. It has options that allow you to make changes to your
slides
Slide Show
Use the Slide Show view when you want to view your slides, as they will look in your final
presentation. When in Slide Show view:
Esc Returns you to the view you were using previously.
Left- Moves you to the next slide or animation effect. When you reach the last slide, you
clicking automatically return to your last view.
Right- Opens a pop-up menu. You can use this menu to navigate the slides, add speaker
clicking notes, select a pointer, and mark your presentation.
Drawing Toolbar: The Drawing toolbar generally appears near the bottom of the screen. It contains
tools for creating and editing graphics.
Minimize Button: Use the Minimize button to remove a window from view. While a window is
minimized, its title appears on the taskbar.
Maximize/Restore Button: Use the Maximize button to cause a window to fill the screen. After you
maximize a window, if you click the Restore button, the window returns to its former size.
Close Button: You use the Close button to exit the window and close the program.
If you do not wish to use the Title Slide, choose Edit > Delete slide from the menu to delete it.
Create New Slides
After completing your title slide, you can create additional slides. To create a new slide:
1. Do one of the following:
o Choose Insert > New Slide from the menu.
The Apply Slide Layout pane will appear on the right side of the screen. The Apply Slide Layout
pane provides you with slide templates you can use when creating your PowerPoint presentation.
There are four types of Text Layout templates.
Title Slide - The Title Slide contains two text placeholders that you can use to display a title and a
subtitle of your presentation.
Title Only - The Title Only slide contains a single placeholder. You can use it to display a title.
Title and Text - The Title and Text template provides a placeholder for a title and a placeholder for
text.
Title and 2 Column Text - The Title and Text template provides a placeholder for a title and two
placeholders for text.
2. To select a layout, click the layout you want in the Apply Slide Layout pane. The layout will
then appear in the Slide pane.
You can use the backspace key to delete text. You can also delete text by highlighting the text and
pressing the Delete key.
Apply a Design Template
Design templates provide attractive backgrounds for your PowerPoint slides. There are a couple of
approaches you could take, depending upon your temperament and design skills for designing first
presentation.
1. You could jump right in and start typing text, adding background colors, and experiment with
your font colors and styles. (not recommended)
2. You could use a pre-configured template.
Unless you have great design skills, I recommend creating your first presentation using a pre-made
template. Microsoft has done us a favor … they’ve hired a team of artists and graphic designers,
people with experience with color-schemes and typography, to design a large collection of
“template” styles. These templates come complete with backgrounds, pictures, and pre-chosen fonts
and colors.
2. To apply a design template to all of the slides in your presentation do one of the following:
o Click on the design template.
o Right-click on the template. A menu will appear. Choose Apply to All Slides.
o Click on the down arrow next to the template. A menu will appear. Choose Apply to
All Slides.
Correct Spelling
Using the PowerPoint spell checker, you can check the spelling in you PowerPoint documents.
If there are possible spelling errors, the Spelling dialog box will open.
Task Procedure
Do not change spelling. Click Ignore.
Correct spelling. 1. Click the correct spelling in the Suggestions box.
2. Click Change.
Add to Dictionary. Click Add.
Word is Correct. Do not change Click Ignore All.
document.
Word is incorrect. Change entire Click Change All.
document.
Sorter View
After you have created your PowerPoint slides, you can move, cut, copy, paste, duplicate, navigate,
and view them in Sorter view. To view the slides in Sorter view, do one of the following:
1. Open PowerPoint.
2. Choose Blank Presentation on the Task pane. You will be presented with a Title slide.
3. Enter the information shown here. Type College Scholarships and Financial Aid in the Click
to Add Title text box. Type Paying for College in the Click to Add Subtitle text box.
3. Enter the information shown here. Type Here is what to do: in the Click to Add Title area.
Type the bulleted text in the Click to Add Text area.
Create a Hierarchy
1. Insert a new slide. Right-click the Title and Text icon. A context menu will appear. Choose
Insert New Slide from the context menu.
2. Enter the information shown here. Click the Increase Indent icon to indent the bullets for
Stafford Loans and PLUS Loans. If you ever need to decrease an indent, use the decrease
indent icon .
1. Right-click the Title and 2 Column Text icon. A context menu will appear. Choose Insert
New Slide.
2. Enter the information shown here. Type the information in the appropriate column.
2. Click the Outline tab to view the text of your presentation as an outline.
Characteristics of Database
Self-describing- a database gives description about itself.
Multiple users can access the same data.
Data exists permanently
Data security protects the data from unauthorized access with the help of the
passwords.
Many software are used as Database Management Systems. Example: MS-Access,
ORACLE etc.
Tables
The columns in the table are fields or attributes. Fields store the smallest unit of data.
The rows in the table are called tuple or record. The record is one complete set of relation.
Database concepts
Data is a known fact.
Data may be name of a student or mark scored by a student or age of a student or dat of birth of
a student. Thus the type of the data varies that if it is a name then it will contain only any
combination of the alphabets, if it a mark then it will be only a number, if it date of birth then it
will only be a date.
The data types supported by the DBMS are :
o Numeric - numbers
o Alphanumeric - letters and digits
o Date/Time - dates
o Logical - logical data
o Auto number - unique value
Numeric
Numbers only (no letters) includes numbers with decimal points.
Numeric field can contain:
o Only the numeric characters of 0 to 9
o The decimal point
Alphanumeric
Alphabets (letter), symbols and numbers
Alphanumeric data can be made up of the following characters:
o Numbers 0 to 9
o Alphabets A to Z, a to z
o Special characters #, /, $, * etc.
Department of Agricultural Statistics, OUAT Page-102
UG Practical Manual on Computer Application
Data/Time
Used to specify the field contains date
Logical
Logical data type used to store Yes or No and True or False
Auto number
A unique value generated for each record.
Components of database
Tables - contains data
Queries - selected information is displayed on the screen
Reports - formatted printed information
Forms - screen created to add, modify, and delete records
Primary Key
The primary key is a field in the table which uniquely identifies that particular record in
the table.
The primary key cannot have a duplicate value in the table.
Every table should have a primary key associated with it.
Tasks associated with the tables
Creating a table
o Specifying field names, data types, field sizes
Adding records to the table
Modifying data in the table
Deleting records from the table
Creating relationship between tables
Tasks associated with the queries
By using queries we can view, change and analyze data in different ways. You can also use
them as the source of records for forms and reports.
You can bring together data from multiple tables and sort it in a particular order.
You can perform calculations on groups of records.
MS Access
MS-Access is a Relational Database Management System (RDBMS) developed by
Microsoft Corporation.
It provides the software tools to organize the data in a flexible manner.
It provides facilities to add, modify or delete data from the database, ask questions or
Department of Agricultural Statistics, OUAT Page-103
UG Practical Manual on Computer Application
queries about the data stored in the database and produce reports summarizing
selected contents.
Creating Database
Click on Start button > Select All Programs > Click Microsoft Access
The opening screen of the MS-Access will get displayed
As we are going to create a new database, in the New File window click blank database.
File New Database dialog box will get displayed asking us to choose the location of the
database and the name of the database. Enter the name of the database as crop.
After choosing the data type of the field set the required field size in the field size tab.
Enter the description of the field in the Description column.
Following the above said instructions enter the other fields in the table.
To set Crop_ID as the primary key of the table right click the field Crop_ID.
From the right context menu choose Primary Key option.
The datasheet view of the Crop Detail table will get opened.
The field names are displayed as headings and a blank row is provided to enter data.
Enter the data in the corresponding fields. When all the records are added the screen will be
as shown below:
Access prompts the user for the final confirmation because the record once deleted cannot
be recalled back.
Click on ‘Yes’ if you are sure to delete it.
The Simple Query Wizard is the same as Create a query using the wizard mentioned above.
The other wizards permit us to generate special types of queries.
The Design view option has the same effect as the Create a query in Design view.
On entering the Query design we are firstly asked for which tables the query should extract the
data from:
Select the table from which we wish to extract the data and click on the Add button (or double-
clik on its name).
If we wish to extract data from another query, click on Queries tab an select it.
If we wish to extract data from various tables we should continue in the same manner.
Finally click on the Close button.
The query Design view window will appear.
PRACTICAL-13: Internet Browsing: Use of Internet Explorer, browsing a Web Page through
search engines:
Internet: World Wide Web (WWW), Concepts
Internet
Each web page has a unique address called Universal Resource Locator (URL).
Contains unique information about the server and the path on the server to find and retrieve the
information
Example: http://www.usd.edu/trio/tut/start/url.html
http:// protocol – rules through which transmission takes place over the internet
Search Engine
A web search engine is designed to search for information on the World Wide Web. The search
results are usually presented in a list of results and are commonly called hits.
Few examples of web search engines are: Google.com, Ask.com, Yahoo.com, Bing.com
Web browsing
Browse means reading superficially or at random.
Reading information contained in the WebPages on the Internet using browsers is called web
browsing.
A web browser is a software application for retrieving, presenting, and traversing
information resources on the World Wide Web.
Understand the browsers
In the address bar of the browser enter the address of the website or enter the address of the any
search engine.
If the address entered is a website then the corresponding webpage will get displayed.
If the address entered is of a search engine (For example Google) then the webpage of the
corresponding search engine will get displayed.
In the search tab enter the information about your search. For example if you want to browse
about computers enter the computers in the search tab.
Then click Search tab.
A set of pages with the links to the webpages which contain information about computer is
displayed.
Clicking the links desired by you will be taking you to those webpages.
To create an email account in any one of these email services the user need to enter the address
of the service in the browser first.
The service will prompt the user to know whether a new user or not.
If you are a new user then the service will guide step by step to create your own email id.
Email Addresses
Email addresses are made up of at least two parts. One part is the name of a mail domain that will
ultimately translate to either the recipient's host or some host that accepts mail on behalf of the
recipient. The other part is some form of unique user identification. Most e-mail addresses are set up
like this: it is your username, then an @ symbol, and then a domain name (something .com, .net, or
.org).
Using Email
Using e-mail is rather straightforward. Once you have an account set up, select the option that says
something like "new e-mail message" or "create a new message". The service will prompt with three
boxes (called fields):
To:
Subject:
Body
Attachment
To field: In the To field type the complete e-mail address of the person who will receive the e-
mail.
Subject and Body fields: Type anything you want in the subject and body fields, but remember
the length of the subject is limited.
Attachments: Click the Attach a file or Attachment link to add files to the message.
Sending the message
Once filling all the required fields and attaching files to the message click Send button to send the
message. You can forward (make a copy) of a message you receive from someone (if you have
their permission if necessary) and mail it to someone else with the forward option.
CC and BCC
CC stands for carbon copy. If you want to send a message to multiple people, add the extra people
in the CC: field (usually you separate their e-mail addresses by commas).
BCC stands for blind carbon copy. BCC works just like a carbon copy, except the e-mail addresses
you type in BCC do not show up to the other recipients. (Example: You send a message To: Mary
and BCC: Joey. Joey will see Mary's e-mail address, but Mary won't see Joey's e-mail address
because you "blinded" it by putting it in the BCC field.).