grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

67
PRACTICAL NO. :- 1 Program to generate Fibonacci series. IDENTIFICATION DIVISION. PROGRAM-ID FIB. DATA DIVISION. WORKING-STORAGE SECTION. 01 A PIC 99 VALUE 0. 01 B PIC 99 VALUE 1. 01 ANS PIC 999. 01 CNT PIC 99. PROCEDURE DIVISION. P1. DISPLAY " " A. DISPLAY " " B. DISPLAY "ENTER THE NUMBER OF THE TERMS=". ACCEPT CNT. LOOP. ADD A B GIVING ANS. DISPLAY ANS. SUBTRACT 1 FROM CNT. MOVE B TO A. MOVE ANS TO B. IF CNT>2 GO TO LOOP. STOP RUN. Output:- Page 1

Transcript of grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

Page 1: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

PRACTICAL NO. :- 1

Program to generate Fibonacci series.

IDENTIFICATION DIVISION. PROGRAM-ID FIB. DATA DIVISION. WORKING-STORAGE SECTION. 01 A PIC 99 VALUE 0. 01 B PIC 99 VALUE 1. 01 ANS PIC 999. 01 CNT PIC 99. PROCEDURE DIVISION. P1. DISPLAY " " A. DISPLAY " " B. DISPLAY "ENTER THE NUMBER OF THE TERMS=". ACCEPT CNT. LOOP. ADD A B GIVING ANS. DISPLAY ANS. SUBTRACT 1 FROM CNT. MOVE B TO A. MOVE ANS TO B. IF CNT>2 GO TO LOOP. STOP RUN.

Output:-

Page 1

Page 2: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

PRACTICAL NO. :- 2

Program for multiplication of two numbers. IDENTIFICATION DIVISION. PROGRAM-ID. MULM. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 A PIC IS 99. 01 B PIC IS 99. 01 C PIC IS 999. PROCEDURE DIVISION. MAIN-PARA. DISPLAY "PROGRAM FOR MULTIPLICATION OF TWO NUMBERS.".

DISPLAY "************************************* ". DISPLAY "ENTER 1ST NO: ". ACCEPT A. DISPLAY "ENTER 2ND NO: ". ACCEPT B. MULTIPLY B BY A GIVING C. DISPLAY "RESULT IS: " C. DISPLAY "*********** END OF PROGRAM ***********". STOP RUN.

Output:

Page 2

Page 3: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

PRACTICAL NO. :- 3

Program to calculate the salary of an employee.

IDENTIFICATION DIVISION. PROGRAM-ID SALARY OF EMPLOYEE. DATA DIVISION. WORKING-STORAGE SECTION. 77 BP PIC 9999 VALUE 5000. 77 HRA PIC 9999V99. 77 DA PIC 9999V99. 77 INC PIC 9999V99. 77 INS PIC 9999V99. 77 PF PIC 9999V99. 77 NET PIC 9999V99 VALUE ZERO. PROCEDURE DIVISION. START-PROGRAM-HERE. DISPLAY "--NET PAY OF THE EMPLOYEE--". MULTIPLY 0.15 BY BP GIVING HRA. MULTIPLY 0.30 BY BP GIVING DA. MULTIPLY 0.05 BY BP GIVING INC. MULTIPLY 0.125 BY BP GIVING PF. MULTIPLY 0.10 BY BP GIVING INS. ADD BP TO NET. ADD HRA TO NET. ADD DA TO NET. ADD INC TO NET. SUBTRACT PF FROM NET. SUBTRACT INS FROM NET. DISPLAY "NET PAY: " NET. STOP RUN.

Output:

Page 3

Page 4: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

PRACTICAL NO. :- 4

Program for covert Fahrenheit to Celsius. IDENTIFICATION DIVISION. PROGRAM-ID FTOC. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 77 F PIC IS 99. 77 C PIC IS 99. PROCEDURE DIVISION. P1. DISPLAY " ENTER TEMP IN FAHRENHEIT ". ACCEPT F. COMPUTE C = ( F - 32 ) * 0.56. DISPLAY C. STOP RUN.

OUTPUT:

Page 4

Page 5: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

PRACTICAL NO. :- 5 Program for addition of two numbers.

IDENTIFICATION DIVISION. PROGRAM-ID. ADDM. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 A PIC IS 99. 01 B PIC IS 99. 01 C PIC IS 999. PROCEDURE DIVISION. MAIN-PARA. DISPLAY "PROGRAM FOR ADDITION OF TWO NUMBERS.". DISPLAY "************************************* ". DISPLAY "ENTER FIRST NUMBER: ". ACCEPT A. DISPLAY "ENTER SECOND NUMBER: ". ACCEPT B. ADD A B GIVING C. DISPLAY "RESULT IS: " C. DISPLAY "*********** END OF PROGRAM ***********". STOP RUN.

Out put:

Page 5

Page 6: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

PRACTICAL NO. :- 6

Program to find the factorial of a number.

IDENTIFICATION DIVISION. PROGRAM-ID ABC. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 FACT PIC 999 VALUE IS 1. 01 N PIC IS 99. PROCEDURE DIVISION. P1. DISPLAY "ENTER THE NO.". ACCEPT N. LOOP.

MULTIPLY N BY FACT GIVING FACT. SUBTRACT 1 FROM N. IF N > 0 GO TO LOOP. DISPLAY "FACTORIAL IS= " FACT.

STOP RUN.

Output:-

Page 6

Page 7: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

PRACTICAL NO. :- 7

Program to find average of two numbers.

IDENTIFICATION DIVISION. PROGRAM-ID AVG. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 A PIC IS 99. 01 B PIC IS 99. 01 C PIC IS 999. PROCEDURE DIVISION. P1. DISPLAY "PROGRAM FOR FINDING GREATER BETWEEN TWO NUMBERS.". DISPLAY "************************************* ". DISPLAY "ENTER 1ST NO: ". ACCEPT A. DISPLAY "ENTER 2ND NO: ". ACCEPT B. COMPUTE C = ( A + B ) / 2. DISPLAY " AVERAGE IS " C. DISPLAY "*********** END OF PROGRAM ***********". STOP RUN.

OUTPUT:

Page 7

Page 8: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

PRACTICAL NO. :- 8

Program to find whether a number is even or add.

IDENTIFICATION DIVISION. PROGRAM-ID. EVOD. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 A PIC IS 99. 01 C PIC IS 99. 01 D PIC IS 99. PROCEDURE DIVISION. MAIN-PARA. DISPLAY "PROGRAM FOR CHECKING A NO. IS EVEN OR ODD.". DISPLAY "************************************* ". DISPLAY "PLZ ENTER A NUMBER: ". ACCEPT A. DIVIDE A BY 2 GIVING C REMAINDER D. IF D=0 DISPLAY "NUMBER IS EVEN.". IF D NOT = 0 DISPLAY "NUMBER IS ODD. ". DISPLAY "*********** END OF PROGRAM ***********". STOP RUN.

Output:-

Page 8

Page 9: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

PRACTICAL NO. :- 9

Program to find whether a number is positive or negative.

IDENTIFICATION DIVISION. PROGRAM-ID POS. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 77 A PIC IS S999. PROCEDURE DIVISION. P1. DISPLAY " ENTER NO ". ACCEPT A. IF A IS POSITIVE DISPLAY " POSITIVE ". IF A IS NEGATIVE DISPLAY " NEGATIVE ". STOP RUN.

Output:-

Page 9

Page 10: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

PRACTICAL NO. :- 10Introduction to COBOL:

COBOL (COmmon Business Oriented Language) was one of the earliest high-level programming languages. It was developed in 1959 by a group of computer professionals called the Conference on Data Systems Languages (CODASYL). Since 1959 it has undergone several modifications and improvements. In an attempt to overcome the problem of incompatibility between different versions of COBOL, the American National Standards Institute (ANSI) developed a standard form of the language in 1968. This version was known as American National Standard (ANS) COBOL. In 1974, ANSI published a revised version of (ANS) COBOL, containing a number of features that were not in the 1968 version. In 1985, ANSI published still another revised version that had new features not in the 1974 standard. The language continues to evolve today. Object-oriented COBOL is a subset of COBOL 97, which is the fourth edition in the continuing evolution of ANSI/ISO standard COBOL. COBOL 97 includes conventional improvements as well as object-oriented features. Like the C++ programming language, object-oriented COBOL compilers are available even as the language moves toward standardization.

COBOL Features:

COBOL is self-documenting:One of the design goals for COBOL was to make it possible for non-programmers such as supervisors, managers and users, to read and understand COBOL code. As a result, COBOL contains such English-like structural elements as verbs, clauses, sentences, sections and divisions. Readers who are familiar with C or C++ or Java might want to consider how difficult it becomes to maintain programs written in these languages. C programs that you have written yourself are difficult enough to understand when you come back to them six months later.

COBOL is Simple:

COBOL is a simple language (no pointers, no user defined functions, no user defined types) with a limited scope of function. It encourages a simple straightforward programming style. Curiously enough though, despite its limitations, COBOL has proven itself to be well suited to its targeted problem domain (business computing). We noted above that COBOL is a simple language with a limited scope of function. And that is the way it used to be but the introduction of OO-COBOL has changed all that. OO-COBOL retains all the advantages of previous versions but now includes - User Defined Functions Object Orientation National Characters - Unicode Multiple Currency Symbols Cultural Adaptability (Locales) Dynamic Memory Allocation (pointers)

Page 10

Page 11: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

Data Validation Using New VALIDATE Verb Binary and Floating Point Data Types User Defined Data Types

COBOL is Portable:

The COBOL standard does not belong to any particular vendor. The vendor independent ANSI COBOL committee legislates formal, non-vendor-specific syntax and semantic language standards. COBOL has been ported to virtually every hardware platform - from every favour of Windows, to every falser of Unix, to AS/400, VSE, OS/2, DOS, VMS, Unisys, DG, VM, and MVS.

COBOL is Maintainable:

COBOL has a 30 year proven track record for application maintenance, enhancement and production support at the enterprise level. Early indications from the year 2000 problem are that COBOL applications were actually cheaper to fix. One reason for the maintainability of COBOL programs have been given above - the readability of COBOL code. COBOL programmers know that the parts of the program that will have to be altered to accommodate these changes will be isolated in the Environment Division. In COBOL programs, programmers have no choice. COBOL's rigid hierarchical structure ensures that these items are restricted to the Environment Division.

COBOL coding sheet:

Page 11

Page 12: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

The structure of COBOL programs:

COBOL programs are hierarchical in structure. Each element of the hierarchy consists of one or more subordinate elements. The hierarchy consists of Divisions, Sections, Paragraphs, Sentences and Statements. A Division may contain one or more Sections, a Section one or more Paragraphs, a Paragraph one or more Sentences and a Sentence one or more Statements. We can represent the COBOL hierarchy using the COBOL metalanguage as follows;

 

 

Divisions :

A division is a block of code, usually containing one or more sections, that starts where the division name is encountered and ends with the beginning of the next division or with the end of the program text.

Sections:

A section is a block of code usually containing one or more paragraphs. A section begins with the section name and ends where the next section name is encountered or where the program text ends. Section names are devised by the programmer, or defined by the language. A section name is followed by the word SECTION and a period. See the two example names below -

Page 12

Page 13: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

SelectUnpaidBills SECTION.FILE SECTION. Paragraphs:

A paragraph is a block of code made up of one or more sentences. A paragraph begins with the paragraph name and ends with the next paragraph or section name or the end of the program text. A paragraph name is devised by the programmer or defined by the language, and is followed by a period. See the two example names below -PrintFinalTotals.PROGRAM-ID.Sentences and statementsA sentence consists of one or more statements and is terminated by a period.For example: MOVE 45 TO A.   MOVE 34.76 TO Pcost   COMPUTE B = Pcost * A.

Four Divisions of COBOL:

At the top of the COBOL hierarchy are the four divisions. These divide the program into distinct structural elements. Although some of the divisions may be omitted, the sequence in which they are specified is fixed, and must follow the order below.

IDENTIFICATION DIVISION. Contains program information. ENVIRONMENT DIVISION. Contains environment information. DATA DIVISION. Contains data descriptions. PROCEDURE DIVISION. Contains the program algorithms.

Page 13

Page 14: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

1. IDENTIFICATION DIVISION:

The IDENTIFICATION DIVISION supplies information about the program to the programmer and the compiler. The IDENTIFICATION DIVISION has the following structure: IDENTIFICATION DIVISION. PROGRAM-ID. NameOfProgram. [AUTHOR. YourName.] other entries here 2. ENVIRON MENT DIVISION: The ENVIRONMENT DIVISION is used to describe the environment in which the program will run. The purpose of the ENVIRONMENT DIVISION is to isolate in one place all aspects of the program that are dependant upon a specific computer, device or encoding sequence. In the ENVIRONMENT DIVISION, aliases are assigned to external devices, files or command sequences. Other environment details, such as the collating sequence, the currency symbol and the decimal point symbol may also be defined here

3. DATA DIVISION: The DATA DIVISION has two main sections: the FILE SECTION and the WORKING-STORAGE SECTION. Additional sections, such as the LINKAGE SECTION (used in subprograms) and the REPORT SECTION (used in Report Writer based programs) may also be required. The FILE SECTION is used to describe most of the data that is sent to, or comes from, the computer's peripherals. The WORKING-STORAGE SECTION is used to describe the general variables used in the program.The DATA DIVISION has the following structure and syntax:

4. PROCEDURE DIVISION:

The PROCEDURE DIVISION contains the code used to manipulate the data described in the DATA DIVISION. It is here that the programmer describes his algorithm. The PROCEDURE DIVISION is hierarchical in structure and consists of sections, paragraphs, sentences and statements.

Page 14

Page 15: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

PRACTICAL NO. :- 11Introduction to word processors like ms word/word pad.

WHAT IS WORD-PROCESSING?

Word Processor is a Software package that enables you to create, edit, print and save documents

for future retrieval and reference. Creating a document involves typing by using a keyboard and

saving it. Editing a document involves correcting the spelling mistakes, if any, deleting or

moving words sentences or paragraphs.

Advantages of Word Processing

1. One of the main advantages of a word processor over a conventional typewriter is that a word

processor enables you to make changes to a document without retyping the entire document.

2. Increased office efficiency resulting in improved secretarial support for all word originators.

3. Higher quality output resulting from advanced equipment.

4. Improved human resource utilization with better control and supervision of secretarial

personal through a word processing center.

Features of Word Processing

Most Word Processor available today allows more than just creating and editing documents.

They have wide range of other tools and functions, which are used in formatting the documents.

The following are the main features of a Word Processor:-

1. Text is typing into the computer, which allows alterations to be made easily.

2. Words and sentences can be inserted, amended or deleted.

3. Paragraphs or text can be copied /moved throughout the document.

4. Margins and page length can be adjusted as desired.

5. Spelling can be checked and modified through the spell check facility.

6. Multiple document/files can be merged.

7. Multiple copies of letters can be generated with different addresses through the mail-merge

facility.

Page 15

Page 16: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

Some Common Word Processing Packages

The followings are examples of some popular word processor available:-

Softword

WordStar

Word perfect

Microsoft word

MS-WORD

MS-WORD is a part of the bigger package called MS OFFICE, which can do much more than

word processing. In fact when you open up MS OFFICE you will find four main components in

it. They are MS-WORD (for word processing), MS EXCEL (for spreadsheet), MS ACCESS (for

database management) and MS POWERPOINT (for presentation purposes).

IMPORTANT FEATURES OF MS-WORD

It is the most effective tool available for editing text, images and graphics. It provides the user

with some features which make the task very easy.

1. AutoComplete: - Entering duplicate data:- As you type, word will automatically offer

suggestions to complete the rest of a word or phrase you are typing after you have typed

the first three or more letters of a common word or phrase. This can greatly increase the

speed when using common word or phrase such as current date, the day of the week, any

month, your name or company name etc.

2. AutoCorrect: - With autocorrect you can type a word or abbreviation and word will

replace it with the text or graphics you specified in the auto correct dialog box. This

feature makes legal, medical or other specialized typing more productive.

3. AutoText: - The autotext feature is like word processing shorthand. It saves your time by

storing frequently used text or graphics for you to use repeatedly. If you have text or

graphics that you use over and over, creating an autotext entry may save your hours of

time.

4. Document Map: - The document map is a very functional way to move quickly through

long or online documents. It will also keep track of your current location. When you use

Page 16

Page 17: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

the document map, a vertical pane is displayed to the left of your document window.

5. Spell Check: - With Word’s dictionary, you can check the spelling of one word, a

selected section of the document, or the entire document. Microsoft office applications all

use the same spelling checker and dictionaries. You also can check against a custom

dictionary that contains abbreviations or words specific to your clients or industry.

6. Graphics: - is a small word used here to describe a large block of topics that

encompasses clipart, custom colors, drawings, graphs, movies, pictures, photos and

sound. Word graphics, pictures, graphs and drawings typically float on the page and text

flows around them.

GETTING STARTED WITH MS-WORD

We have already told you that for working in Ms-Word you should be familiar with WINDOWS.

If you have not covered WINDOWS so far then read that first and then go through MS-WORD.

By now you must be aware of the fact that a software package is improved from time to time.

These improvements are sold in the market as new versions of the same software. Thus you will

find many versions of MS-WORD being used in different offices. In this lesson we will cover

the version MS-WORD 97, which is latest in the market and contain many improvements over

the older versions. However, you do not have to worry if you have an older version such as

WORD 6.0 or WORD 95. All the commands available in these older versions are also available

in WORD 97 and they are compatible.

While working in MS-WORD you have to work with a mouse. Also one can work, to some

extent, through the keyboard. The use of mouse is simpler as it is fully menu driven. In MS-

WORD every command is available in the form of ‘icons’.

You can go inside MS-WORD by the following way

Take the mouse pointer to START button on the task bar. Click the left mouse button. The

monitor will show like as follows:

Page 17

Page 18: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

Move the pointer to programs. You will notice another menu coming up to the right.

In that menu identify where Microsoft word is placed. Move the cursor horizontally to come

out of programs.

Move into the rectangular area meant for Microsoft word. Click the left mouse button there.

The computer will start MS-WORD. You will find the screen as follows.

Page 18

Page 19: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

Let us discuss the important components of the screen.

Title Bar

The title bar displays the name of the currently active word document. Like other

WINDOWS applications, it can be used to alter the size and location of the word

window.

Tool Bars

Word has a number of tool bars that help you perform task faster and with great ease. Two of the

most commonly tool bars are the formatting tool bar and the standard tool bar. These two

toolbars are displayed just below the title bar. At any point of time any tool bar can be made ON

or OFF through the tool bar option of View Menu.

Ruler Bar

The Ruler Bar allows you to format the vertical alignment of text in a document.

Status Bar

The Status Bar displays information about the currently active document. This includes the page

number that you are working, the column and line number of the cursor position and so on.

Page 19

Page 20: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

Scroll Bar

The Scroll Bar helps you scroll the content or body of document. You can do so by moving the

elevator button along the scroll bar, or by click in on the buttons with the arrow marked on them

to move up and down and left and right of a page.

Workspace

The Workspace is the area in the document window was you enter/type the text of your

document.

Main Menu

The Word main menu is displayed at the top of the screen as shown in the Fig. 9.1. The main

menu further displays a sub menu. Some of the options are highlighted options and some of them

appear as faded options. At any time, only highlighted options can be executed, faded options are

not applicable. Infect if the option is faded you will not be able to choose it. You may not that

any option faded under present situation may become highlighted under different situation.

MAIN MENU OPTIONS

The overall functions of all the items of main menu are explained below.

File

You can perform file management operations by using these options such as opening, closing,

saving, printing, exiting etc. It displays the following sub menu.

Page 20

Page 21: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

Edit

Using this option you can perform editing functions such as cut, copy, paste, find and replace etc.

It displays the given sub menu.

View

Word document can be of many pages. The different pages may have different modes. Each

mode has its limitations. For example in normal mode the graphical picture cannot be displayed.

They can only be displayed in page layout mode. Using the option "View" you can switch over

from one mode to other. It displays the following Sub menu.

Insert

Using this menu, you can insert various objects such as page numbers, footnotes, picture frames

etc. in your document. It displays the following Sub menu.

Page 21

Page 22: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

Format

Using this menu, you can perform various type of formatting operations, such as fonts can be

changed, borders can be framed etc. It displays the following Sub menu.

Tool Submenu

Using this menu, you can have access to various utilities/tools of Word, such as spell check,

macros, mail merge etc. It displays the following Sub menu.

Table

This menu deals with tables. Using this menu you can perform various types of operations on the

table. It displays the following Sub menu.

Page 22

Page 23: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

Window Sub menu

This menu allows you to work with two documents simultaneously. This would require two

windows to be opened so that each one can hold one document. Using this menu, you can switch

over from one window to another. It displays the following Sub menu.

Help

Using this menu, you can get on-line help for any function.

Subscripting and superscripting a text in MS WORD

Subscripts: - When you write indexed variables in mathematics, you need to write subscripts

with the variables. Instead of writing the names of variables as x1, x2 etc. It is more natural

to write x1, x2 etc. This number or expression or text, which appears relative to the normal

text a) in a smaller size and b) at a lower level is known as a subscript.

Page 23

Page 24: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

Superscripts: - When a smaller size text appears at the top end of a normal sized text is

called a superscript. To write square of sum of two variables A and B, you write (A+B) 2 .

Here 2 is a superscript.

Creating subscripts and superscripts: - For creating the sub/superscript, you need to

switch over to sub/superscript font effect. There are three ways:-

1. Using Keyboard Shortcuts

Subscript-> ctrl+=

Superscript-> ctrl+shift+=

2. Using the font dialog box and checking the sub/superscript check box in the

effects group box.

Format>font or ctrl+D.

3. Using the subscript x2 and superscript x2 on the formatting toolbar.

MAIL MERGE

Mail merge is a 3-step process

1. Define the Main Document.

This can be a letter that is already created or a blank document.

2. Create or open the Data Source.

The data source is the database where the information is stored. A database can be Word, Excel,

the Outlook Address Book or Access.

3. Merge Main Document with the Data Source.

This is the final product that will be printed.

Page 24

Page 25: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

Word uses Merge Fields to represent the data that will go into the main document. These merge

field’s come directly from the database.

Merge Fields will look similar to this:

«FirstName» « MiddleName » «LastName»

This is an example of the table:

FirstName        MiddleName LastName

Joy M. Edwards

David   Tillman

Bradley Aaron Pitt

Catherine   Douglas

The result would be:

Joy M. Edwards

David Tillman

Bradley Aaron Pitt

Catherine Douglas

Mail Merge

1. Open Microsoft Word.

2. Open the Letter that will become the main document for the Mail Merge.

(If a letter has not been created, create a letter at this time.)

3. Click the Tools Menu.

4. Select Mail Merge.

Page 25

Page 26: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

  

5. The Mail Merge Helper dialog box will appear.

6. Click Create.

7. Choose Form Letters.

 

8. If the letter that will be sued in the Mail Merge is already open, click Active Window. If

the letter has not been created yet, select New Mail Document.

9. The box will look similar to the picture below.

10. For step 2, click Get Data.

11. Click Open Data Source. 

12. By Default MS Word will look for a document in MS Word format, however, click the

Files of Type drop-down arrow to choose an MS Excel spreadsheet or MS Access

database.

13. Click Open.

14. A box will appear with the message below. Click Edit Main Document to add merge

fields to the document.

15. The Mail Merge Toolbar will appear in the document window.

Page 26

Page 27: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

16. Click Insert Merge Field in the Mail Merge toolbar.  These are the Merge Fields from the

Database.

17. To insert a Merge Field into the Main Document, place the cursor/insertion point in the

document where the Merge Field should go.

18.

19.

20. When all of the necessary merge fields have bee added to the document, click the Merge

Button on the Mail Merge toolbar. 

21. The Merge dialog box will appear.

22. To merge all records at once to a new document, Click Merge (right side of the box).

Merged records may also be sent to a printer or to output as email.

23. The merged information will appear in a new document.

24. Save the new document.

25. Close the Main Document.

Page 27

Page 28: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

Word Pad

WordPad is a simple word processor that is included with almost all versions of Microsoft

Windows from Windows 95 upwards. It is more advanced than Notepad, which is rather a basic

text editor, but not at all as advanced as Microsoft Word. It originated in Windows 1.0x as

Write.

It has facilities to format and print text, but lacks intermediate features such as a spell checker ,

thesaurus, support for tables etc. As such, it is suitable for writing letters or short authorships,

but underpowered for such tasks as long reports (which usually rely heavily on graphics) or large

authorships, such as books or manuscripts.

WordPad natively supports the Rich Text Format and uses Microsoft's RichEdit control,

version 4.1 of which ships with Windows XP SP1 and later operating systems ,including

Windows Vista. Older versions also supported the "Word for Windows 6.0" format, which is

forward compatible with the Microsoft Word format.

WordPad was introduced for the first time in Windows 95, replacing the Windows Write

application, which came bundled with all previous versions of Windows (version 3.1 and

earlier). The source code to WordPad was also distributed by Microsoft as a Microsoft

Foundation Classes example application with MFC 3.2 and later, shortly before the release of

Windows 95. It is still available for download from the MSDN Web site today.

To date, WordPad is the only officially supported Microsoft application (apart from Microsoft

Word) that can read (or import) the WRI files produced by Windows Write. However, it cannot

save files in the WRI format.

WordPad for Windows XP added multilingual text editing. It can open Microsoft Word

(versions 6.0-2003) files, although sometimes with incorrect formatting. However, it cannot save

files in the .doc format (only .txt or .rtf), unlike WordPad for earlier Windows versions.

Windows XP Service Pack 2 disabled the legacy support for viewing .wri files (produced by the

early version of WordPad, called Windows Write) for security purposes. In Windows Vista,

support for reading Word files was removed because of the incorrect rendering and formatting

Page 28

Page 29: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

problems. However, it supports speech recognition and the Text Services Framework (TSF).

For viewing legacy (97-2003) as well as newer (Open XML) Microsoft Word documents,

Microsoft has released the free Word Viewer.

The various features of word pad are:-

1. Formatting: - To enhance the appearance and improve readability of your documents,

you can format the text in paragraphs either before or after you enter the text. You can

change the fonts or apply attributes such as italic, underline, borders, patterns and colors.

You can also insert special characters or symbols.

2. Tabs: - Changing default tabs:- Tabs are important when placing text in documents. Tabs

can align text on its left edge, right edge, centered on a defined point or you can align

numeric data on its decimal point for best visual clarity.

3. Tables: - A table is a series of rows and columns. The intersection of a row and a column

is called a cell. The layouts of a table looks like a small spreadsheet, similar to what you

see in Microsoft excel.

4. Outputting: - Word provides many ways for you to produce output. You can print letters

and envelopes with the mail merge feature and even select specific records to limit the

number of form letters you send. After you have previewed your data, you can send the

data directly to a printer. You can print the current page, a group of pages or the whole

document. You can compress a document to fit on one page.

5. Documents: Previewing: - When you are ready to print your document, using print

preview first allows you to see the layout of the pages. You can then make any necessary

corrections before you print the document.

6. Copying: Information between applications: - You can use the clipboard to easily copy

and paste data between windows applications. The Clipboard is a temporary storage area

for cut or copied items. When you cut or copy text or objects in one of the programs,

windows places that item on the clipboard. You can then paste that item to the same

document, a different document or a different program.

Page 29

Page 30: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

PRACTICAL NO. :- 12 Introduction to dbms:

Visual FoxPro is a data-centric object-oriented and procedural programming language produced by Microsoft. It is derived from FoxPro (originally known as FoxBASE) which was developed by Fox Software beginning in 1984. Fox Technologies merged with Microsoft in 1992 and the software acquired further features and the prefix "Visual". The last version of FoxPro (2.6) worked under Mac OS, DOS, Windows, and Unix: Visual FoxPro 3.0, the first "Visual" version, dropped the platform support to only Mac and Windows, and later versions were Windows-only. The current version of Visual FoxPro is COM-based and Microsoft has stated that they do not intend to create a Microsoft .NET version.FoxPro originated as a member of the class of languages commonly referred to as "xBase" languages, which have syntax based on the dBase programming language. Other members of the xBase language family include Clipper and Recital. (A history of the early years of xBase can be found in the dBASE entry.)Visual FoxPro, commonly abbreviated as VFP, is tightly integrated with its own relational database engine, which extends FoxPro's xBase capabilities to support SQL query and data manipulation. Unlike most database management systems, Visual FoxPro is a full-featured, dynamic programming language that does not require the use of an additional general-purpose programming environment. It can be used to write not just traditional "fat client" applications, but also middleware and web applications

Starting of FoxPro:

Page 30

Page 31: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

Features:

In FoxPro we can link up multiple databases to give rise to pyramidal structure of database.

Queries can be made on a single or multiple databases being grouped by a field sorted on the fields meeting user defined criteria.

We can generate reports with fields of choice from a single or multiple databases grouped by some column with suitable headings. We can make use of view window to view selected fields from single or multiple databases. We can design customized screens with FoxPro screen designer. We can save this and retrieve respectively next time. We can generate our own applications and projects with FoxPro application generator We can organize our application through catalogues. We can import data from other databases and can export FoxPro database.

ConvEntions:

FoxPro provides various data types to store data of various sizes in the data bases some of these are discussed here.

Data Types:

Character: It is used to store characters (A to Z, a to z). It has width up to 254. Numeric: It is used to store numeric values that include numbers & decimal values. It has width up to 20.Float: It is also used to store numeric values & floating values. It has width up to 20.Double: It has width up to 8. It can store numerical, floating values. Date: This data type is used to store date in (dd/mm/yy) format. It has width up to 8.Integer: It used to store integer values and it has width up to 4.Logical: This data type is used to store the result of some condition which is either true/false. It has width of 1. Memo: This data type can store numeric & alphanumeric values. It can handle very large data

12.1 Understanding data bases:

Page 31

Page 32: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

In this practical we will discuss various components of FoxPro .

Objectives: Familiarization with Database and various components. Data Base: It is defined as large collection of coherent, meaningful & interrelated data that is stored or organized in such a way so that it can be accessed and process by authorized user at any time. Data in data base is secure, less redundant & shared by multiple users. A data base contains number of tables.

Tables: A table is a database object that holds users data. It consists of rows and columns. Information is stored in tabular form a row make a record. Column contains same kind of attribute of an entity.

Records: A record is a collection of fields. It consists of all the attribute of an entity. A row makes a record.

FoxPro main Window:

Page 32

Page 33: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

FoxPro window description:

View window: It is used to see the content of tables or the results of queries which are entered by user. It shows the information rows and columns wise along with the column headings.

Command window: This window is used to enter commands/queries to access information from the labels. This window can be moved to any place in main window and can be resized.

Menu bar: This bar conation various menu items (eg. file, edit, view, format, tool, program, window, help) and there sub menus. These menus have various options to create/design database, manage database, compiling queries etc.

Tool bar: This bar contains various ready to use tools to create and manage database or to do others tasks. These are like shortcuts to the options available in menu items.

Creating Tables: FoxPro provides a very convenient way to create tables. The procedure is discussed step by step.

1. Click on File Menu then on New. There are various option to create project, database, tables etc as shown in the following picture. Then click on the new file. A create dialog box will appear. Then enter the table name and click on save.

Page 33

Page 34: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

2. Then a table designer window will appear where we can specify attribute/column name there data type and there size. Then a massage box will appear which will ask to enter entries at that time or later click yes to enter entries.

Page 34

Page 35: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

Page 35

Page 36: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

3. On clicking yes following record entry window will appear and one by one record can be entered. Record can be later added by using append command.

Page 36

Page 37: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

12.2 Retrieving & Editing Databases:

To access record from FoxPro & view specific information from specific tables.

Objective: To use the commands related to access & view records from FoxPro tables. We have following commands.

1. Display: This command is used to display the current record which is pointed by record pointer.

1.1 DISPLAY: This command displays single record which is pointed by record pointer.

1.2 DISPLAY NEXT: This command is used to display specific number of records starting from current record pointer position.

Page 37

Page 38: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

1.3 DISPLAY REST: This command is used to display all records up to last record starting from current position of record pointer.

1.4 DISPLAY ALL: This command is used to display the all record in the specified table. If all record could not come in single window then it provide option for hit any key to continue the display the record. It displays record with column name.

Page 38

Page 39: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

2. LIST: This command is used to display record in a table. It has various options as following are given. 2.1 LIST: To display all record in a table this command is used but it can only display record which comes in single window. It doesn’t have option like in display all command to continue show of record in next window.

2.2 LIST FIELD: This command is used to display specified column/fields in a table.

Page 39

Page 40: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

Page 40

Page 41: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

2.3 LIST FOR: This command is used to display a specific record based on the condition given in the command.

2.4 LIST OFF: This is used to display record with out Record# field.

Page 41

Page 42: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

3. EDIT: This command is used to update in the record of a table. It is desirable some time to change the previously stored information. It has following options. 3.1 EDIT: It use index number to find specific record then it will display then it can be modified.

3.2 EDIT FOR: In this command some value with column name can be specified to find a record that is to be updated.

Page 42

Page 43: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

4. MODIFY STRUCTURE: This command can be used to made changes in the structure of table and when we save these changes these become permanent. We can add new fields or can increase the size of there data types.

Page 43

Page 44: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

5.RECORD POINTER: This is special feature which is provided by FoxPro to indicate the current control on the record. This is helpful to make any operation on the specific record such as to display, to edit, to view. We can move the record pointer in forward or backward position to make any changes.

GOTO: This command is used to move pointer on any record specified in the command. Then we can see the location of pointer using browse command a arrow is used to indicate the position of the pointer.

Page 44

Page 45: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

SKIP: This is also used to move record pointer in some specific steps in the forward direction

Page 45

Page 46: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

BROWSE: This command is used to view the record of table in tabular form. It also display record pointer’s current position.

Page 46

Page 47: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

12.3 Removing data from Databases:

To familiarize with the operation which are done to remove data from tables.

Objective: To use commands to delete data from tables. Fox provide various commands to mark record for deleting, recovering records & permanent deleting.

1. DELETE: This command is used for marking any record which we want to delete. Marked record can be identified when we use browse command, this kind of marking can be removed.

2. RECALL: This command is used to recall the marked record. If by mistake we have marked any wrong record then this command can recover that record.

Page 47

Page 48: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

3. PACK: This command is use to delete only those records permanently which are marked for deletion. If we execute this command than that record can never be recovered.

REPPLACE: This command is used to make changes in the field values it is kind of editing operation. We can specify some column name and corresponding value to be changed.

Page 48

Page 49: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

12.4 Managing Databases:To manage database entries in ascending / descending order and assigning some index value so that record can be identified easily and searched at fast speed.

Objective: To use sorting and indexing command available in FoxPro.

SORT: This command is used to sort the element of a column in either ascending / descending order which is mentioned in the command. Sorted values are stored in the new table.

Page 49

Page 50: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

Page 50

Page 51: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

INDEX: This command is used to provide a index value on some specified column of a given table. Index value is stored in new table.

Page 51

Page 52: grasphub.comgrasphub.com/wp-content/uploads/2012/08/ibsidrees.d… · Web viewgrasphub.com

12.5 Searching for the record in the Database:

To use the operation of locate to search record in the record.

Objective: To use searching records using locate.

LOCATE: This command is used to search a particular record based on some condition.It has various options which are given below.

Page 52