Annamalai University: Bachelor of Computer Applications

Download as pdf or txt
Download as pdf or txt
You are on page 1of 72

1

137E170
LAB - I

ANNAMALAI UNIVERSITY
DIRECTORATE OF DISTANCE EDUCATION

Bachelor of Computer Applications


First Year

DDE
PROGRAMMING LAB – I
[C, C++ & MS-OFFICE]

Copyright Reserved
(For Private Circulation Only)
i

Programming Lab – I (C, C++ and MS OFFICE )

Table of Contents

Page No

MS Word 2000 Questions 1


MS Excel 2000 Questions 6
MS Power Point 2000 Questions 8
MS Access 2000 Questions 11
MS Word 2000 Solutions 14
MS Excel 2000 Solutions 23
MS Power Point 2000 Solutions 29
MS Access 2000 Solutions 37
Additional Questions (MS-Word) 39
C Programming and Solutions 46
C++ Problems and Solutions 56

DDE
1

MS -Word 2000
Exercise 1: -
1.1 Open MS-Word. In the new document that appears, type the following:

Office Assistant
Asking for Help from the Office Assistant
When you have a question about a Microsoft Office program, you can ask the
Office Assistant. For example, to get Help about how to create a table, type, “How do I
create a table” in the Assistant.

If the correct topic doesn't appear in the Assistant balloon, click None of the
above, look for more help on the Web at the bottom of the list of topics. You will get
suggestions on how to phrase a question to the Office Assistant or how to narrow your
search by using keywords. If you still can't find the information you want, you can send
feedback to improve future versions of Help and be automatically connected to the
Microsoft Office Update Web site to search for help there.

The Assistant automatically provides Help topics and tips on tasks you perform as
you work before you even ask a question. For example, when you write a letter, the
Assistant automatically displays topics to help you create and format a letter.

The Assistant also displays tips on how to use the features in the Office programs
more effectively. Click the light bulb next to the Assistant to see a tip.

DDE
You can also select a different Assistant and set it to operate so that it meshes
with the way you work. For example, if you prefer using the keyboard to using the
mouse, you can have the Assistant display tips on shortcut keys. Because all Office
programs share the Assistant, any options you change will affect the Assistant in your
other Office programs.

Getting Help from the Help menu


Just click Microsoft Word Help on the Help menu. If the Assistant is turned on, it
appears. If the Assistant is turned off, the Help window appears. To type a question in the
Help window, click the Answer Wizard tab. To scroll through a table of contents for
Help, click the Contents tab. When you want to search for specific words or phrases,
click the Index tab.

To see a ScreenTip for a menu command, toolbar button, or screen region, click
What's This? on the Help menu, and then click the item you want information about.

To see a ScreenTip for a dialog box option, click the question mark button in the
dialog box, and then click the option. (If you don't see the question mark button, select
the option and then press SHIFT+F1.)
2

To see the name of a toolbar button, rest the pointer on the button until the name
appears.

After finishing typing, Switch to the Print Layout view, save the file as wordhelp.doc.
and close the file after saving the changes.

1.2. Open the wordhelp file. Change the position of each paragraph in the
document (i.e., rearrange the paragraphs) using the mouse.

Note:
Do not use the cut and copy option in the Edit menu or keyboard shortcuts for the
same.

1.3. Replace the existing text in each paragraph, with another text. That is the text
in the paragraph should get deleted automatically as the user types new text.

1.4. Start typing a new paragraph at the right side of the page using the click-and-
type feature in between the existing paragraphs. Insert a small picture at the right side of
the page in between any one of the paragraphs.

Note:
 Click-and-type feature will work only in Print Layout and Web Layout view.
Ensure that the document is in either one of these two views.
 In case if the feature does not work, check whether the feature has been enabled
or not on the Edit tab of the Options under the Tools menu.

Exercise 2: - DDE
2. Open the saved wordhelp.doc and do the following operations on it:

2.1. Place a header on the page that gives the page number and the name of the
file, i.e., Office Assistance. The page number must not be entered manually,
but must be added using the page number option.

2.2.Make the paragraphs into a picture bulleted list, i.e., each of the paragraphs
should start with a picture bullet. The bullet symbol should be.

2.3. Adjust the spacing so that within the paragraphs lines contain 1 spacing
and between paragraphs there is 1.5 spacing.
2.4. Convert the whole document into a two-column format.

2.5. Create a text box, which should contain the text – Asking for Help from
the Office Assistant and place the text box in the middle of the document.
3

2.6. Add a border for the entire page (draw a rectangle around the page), and
give gray-scale shading for the heading.
After these changes are made, the document must look like the one given in
the box as shown in the Figure 1.1.

2.7. Finally create an index for that document.

Office Assistant
When you have a question about a Microsoft Office program, you can ask the
Office Assistant. For example, to get Help about how to create a table, type How do I
create a table in the Assistant.
If the correct topic doesn't appear in the Assistant balloon, click None of the
above, look for more help on the Web at the bottom of the list of topics. You will get
suggestions on how to phrase a question to the Office Assistant or how to narrow your
search by using keywords. If you still can't find the information you want, you can send
feedback to improve future versions of Help and be automatically connected to the
Microsoft Office Update Web site to search for help there.

The Assistant automatically provides Help topics and tips on tasks you perform as
you work before you even ask a question. For example, when you write a letter, the
Assistant automatically displays topics to help you create and format a letter.

The Assistant also displays tips on how to use the features in the Office programs
more effectively. Click the light bulb next to the Assistant to see a tip.

DDE
You can also select a different Assistant and set it to operate so that it meshes
with the way you work. For example, if you prefer using the keyboard to using the
mouse, you can have the Assistant display tips on shortcut keys. Because the Assistant is
shared by all Office programs, any options you change will affect the Assistant in your
other Office programs.

Getting Help from the Help menu


Just click Microsoft Word Help on the Help menu. If the Assistant is turned on, it
appears. If the Assistant is turned off, the Help window appears. To type a question in the
Help window, click the Answer Wizard tab. To scroll through a table of contents for
Help, click the Contents tab. When you want to search for specific words or phrases,
click the Index tab.

To see a ScreenTip for a menu command, toolbar button, or screen region, click
What's This? on the Help menu, and then click the item you want information about.

To see a ScreenTip for a dialog box option, click the question mark button in the
dialog box, and then click the option. (If you don't see the question mark button, select
the option and then press SHIFT+F1.)
4

To see the name of a toolbar button, rest the pointer on the button until the name
appears.
Exercise 3:
3.1. Open the document wordhelp.doc. Notice the text underlined with thin wavy
lines? Make Word ignore all the errors. Convert the text of the document into a table so
that it looks as given below (Figure 1.2):

Office Assistant
Asking for Help from the Office Assistant
 When you have a question about a Microsoft Office program, you can ask the
Office Assistant. For example, to get Help about how to create a table, type How
do I create a table in the Assistant.
 If the correct topic doesn't appear in the Assistant balloon, click None of the
above, look for more help on the Web at the bottom of the list of topics. You will
get suggestions on how to phrase a question to the Office Assistant or how to
narrow your search by using keywords. If you still can't find the information you
want, you can send feedback to improve future versions of Help and be
automatically connected to the Microsoft Office Update Web site to search for
help there.
 The Assistant automatically provides Help topics and tips on tasks you perform as
you work before you even ask a question. For example, when you write a letter,
the Assistant automatically displays topics to help you create and format a letter.
 The Assistant also displays tips on how to use the features in the Office programs
more effectively. Click the light bulb next to the Assistant to see a tip.
 You can also select a different Assistant and set it to operate so that it meshes

DDE
with the way you work. For example, if you prefer using the keyboard to using
the mouse, you can have the Assistant display tips on shortcut keys. Because the
Assistant is shared by all Office programs, any options you change will affect the
Assistant in your other Office programs

Getting Help from the Help menu


 Just click Microsoft Word Help on the Help menu. If the Assistant is turned on, it
appears. If the Assistant is turned off, the Help window appears. To type a
question in the Help window, click the Answer Wizard tab. To scroll through a
table of contents for Help, click the Contents tab. When you want to search for
specific words or phrases, click the Index tab.
 To see a ScreenTip for a menu command, toolbar button, or screen region, click
What's This? on the Help menu, and then click the item you want information
about.
 To see a ScreenTip for a dialog box option, click the question mark button in the
dialog box, and then click the option. (If you don't see the question mark button,
select the option and then press SHIFT+F1.)
 To see the name of a toolbar button, rest the pointer on the button until the name
appears.
5

3.2. Highlight all occurrences of the word “Help” by making it Courier New, 10,
Bold. Write a macro for achieving this.

3.3. Assuming that you are going to send copies of this document to all your
friends, type their names and addresses on the bottom left corner of the document. This
has to be done using mail merge.

Exercise 4:
4.1. Open an existing file wordhelp. Create a new file and type in it the text:
Getting Help from the Help menu

Getting Help from the Office Update Web site


Save the file as link. Close this file.
In the file wordhelp, create a hyperlink from a text to the new file created.
4.2. In the last paragraph of the document, create a footnote for the word habit.
The text for the footnote must be:
Use Help to make things look better.

Exercise 5: -
5.1. Working with the Table.
5.2. Find and Replace Word Document.
5.3. Inserting Picture.
5.4. Spelling and Grammar.
5.5. Mail Merge.

DDE
6

MS - Excel 2000
Exercise 1:
1.1. Enter data in the following sequence for months as Jan,Feb.Using Fill Handle
Method display the sequence as Jan,Feb,…….etc.

1.2. Consider the table given below.


Name Salary Date of joining
Shalini 12000 11-01-80
Vijay 13000 13-11-81
Bhaskar 14000 09-12-87
Valli 16000 26-01-88
Jai 19000 01-02-89

Perform the following operations on the table:

1.2.1. Delete the row that contains the name Bhaskar.


1.2.2. Insert a row between the rows that has the names “Valli” and “Jai”.
1.2.3. Insert a column “Dept” between the columns “Name” and “Salary”.

Exercise 2: -
2.1. Consider the following table.
Medicine Name Actual amount(1 strip) Tax Total amount
Crocin 15 2

DDE
Dolo 20 1
ColdAct 35 3
Anasin 22 1
Zeecuf 33 4

Calculate the Total Amount using AutoSum, Relative Addressing.


2.2. Use the above table to perform the following:
2.2.1. Name the column “Actual amount” using the Name box.
2.2.2. Align the entries in the “Actual amount”, ‘Tax” and “Total amount”
columns to the center.
2.2.3. Hide the “Tax” column.
2.2.4. Apply number format to the column “Total amount” to display two
decimal places.
7

Exercise 3: -
3.1. Using the table given below, create a Pivot Table to summarize the given
source table. Filter the list for the customer “Balu” using AutoFilter and conceal all the
other records in the table.
Cust_Name Cust_Id Order_date Prod_Name Quantity Unit_Price
Shalini 201 12-1-2001 A 12 $230
Vijay 102 14-2-2000 B 35 $760
Valli 103 20-7-2001 C 67 $700
Mal 104 28-5-2000 F 10 $800
Bhaskar 105 18-6-2001 G 38 $420
Jai 106 23-7-2000 K 18 $610
Inder 107 23-9-2001 J 56 $230
Ajith 108 29-7-2000 H 36 $470
Deepa 201 18-9-2001 O 65 $780
Sundar 202 27-9-2000 T 50 $800
Saro 234 22-2-2001 U 66 $460
Balu 878 05-11-2000 F 40 $540
Ram 345 14-7-2001 X 23 $890
Swamy 467 18-6-2000 Y 34 $459
Sasi 68 13-1-2001 Z 54 $790
Murali 167 27-12-2000 S 80 $860

Exercise 4: -

DDE
4.1. Using the table given below, plot a chart against the data.
Name Salary Gross Comm
Shalini 12000 12000 500
vijay 13000 13000 400
srivalli 14000 14000 350
balu 16000 16000 200
Isha 19000 19000 500

4.2. Create an excel document with data(s) that could be used for an annual report
of a company or a list of student details of software training institute or monthly salary
details of a company or customer details of a company. Then convert this document to
HTML format, so that it can be published as a web page on the Intranet or Internet.
Finally, open the page to view it in a browser.
8

MS - PowerPoint 2000

Exercise 1: -
1.1. Open a Blank presentation with the Title Slide layout. Give the title as
“Company Hierarchy”

1.2. Open the Slide Master and set the Design Template as “Capsules”. Set
the bullets and the style in the subtitle area (for the 5 levels) as follows:

Click to edit Master text styles


Second level
Third level
Fourth level
Fifth level

1.3. Insert another slide with the Bulleted List layout. Type the following text
under the title “Companies Profile”:

XYZ Company was formed on 1999.


Consists of 2 branches.
Deals in Customized development
Deals in Hardware sales & Service
Hardware partners HCL & Samsung
1.4. Insert a new slide with the title “ AUTO SHAPES” and draw the following
shapes in it:

DDE 5-Fun Face

Circle

Cylinder

Rectangle

How can we view all the slides in a single screen?

Exercise 2: -
2.1. Insert ClipArt in the slide, which has the title “Company Hierarchy”, and
drag it to center of the slide.
9

2.2. Create an Organizational Chart with the following specifications:

a. Title to the chart “x y z Hierarchy” with the size 48.


b. Create an Organizational chart with following specifications:

Dr. Saravanan Managing Director(MD). Font size should be 28.


Add two subordinator under (MD). Font size should be 26.
(i) Mr. Bhaskar General Manager, Marketing (GM)
(ii) Mr. Jai General Manager, Projects (GM)

Add one subordinators to each of them. Font size should be 24.


(i) Mr. Inder Assistant General Manager, Marketing (AGM)
(ii) Mr. sasi Assistant General Manager, Projects (AGM)

Add one subordinators under each of them. Font size should be 22.
(i) Mr. Ram Manager, Marketing.
(ii) Mr. Ajith Manager, Projects.

Add two subordinators under each of them. Font size should be 20.
(i) Mr. Mal Assistant Team Member, Marketing.
(ii) Mr. Valli Assistant Team Member, Projects.
(iii) Mr. Vijay Assistant Team Member, Projects.
(iv) Mr. Shalini Assistant Team Member, Marketing.

2.3. Create a table and enter the following text in it. Name it as projects

Project Name
Human Resource Automation
MIS Reports
DDE Platform
Visual Basic, Oracle
ASP, SQL Server
Online Testing ASP, Oracle
Payroll Automation Visual Basic, Oracle
In pass Automation Java, Oracle

Exercise 3: -
3.1. Import the circles.bmp file in the windows directory to the AUTO SHAPES
slide created in the first chapter.

3.2. Create a .RTF file with the following lines as its contents:

Future Plans
Investors

Save the file in the name Details.rtf and import the file as an outline.
10

3.3. Save the AUTO SHAPES slide as a Windows metafile

3.4. Move the Future Plans slide to the end of the presentation.

3.5. Delete the AUTO SHAPES, Future Plans and Investors

3.6. Set the Slide transition to Random Transition

3.7. In the Introduction slide, set the animation as follows:


For the Title set the animation as Fly From Left
For the remaining text set the animation as Spiral

3.8. Create a custom show named “show1” in which only the Introduction and
the Projects slides appear. How can we view the custom show?

3.9. Save the presentation as a Web page. View the Web page in the Internet
Explorer

3.10. Create an action button “Click to enter your comments” in the last slide
that opens the Notepad application, when clicked.

DDE
11

MS-Access 2000
Exercise 1:
1. In the database created, Create a table Dept
Dept Table Structure:

Deptno Number
DeptName Text
Location Text

Insert the following values:


DeptNo DeptName Location
10 Admin Chennai
20 Marketing Mumbai
30 Sales Delhi
40 Purchase Bangalore
2. In the database created,Create a table Emp

Emp Table Structure:

EmpNo Number
EName Text
Basic Number
DA Number
Deptno Number

Insert the following values:


EmpNo
1
EName
Sundar
DDE Basic
2400
DA
500
Deptno
10
2 Vijay 3500 650 20
3 Saravanan 4600 780 30
4 Sethu 5700 890 20
5 Raja 6100 950 10
6 Surendar 7300 560 30
7 Vivek 6500 430 20
8 Raman 5400 230 10
9 Jain 3300 460 10
10 Ajay 7800 660 20
3. Display all the Employee details.

4. Display the basic salary of Sundar.

5. Display the gross salary (basic+DA) of raja.

6. Display the details of Employee whose Empno is 3.


12

7. Display the Employee details who is getting the maximum basic.

8. Display the Employee details who is getting the minimum DA.

9. Display the department name for the Employee Sethu.

10. Display all the Employee names and their department name.

11. Calculate the HRA (30% of basic) for all the Employee s.

12. Calculate the PF (12% of basic) for all the Employee s.

13. Display the department name where no Employee exists.

14. Display the department name and number of Employee s in it.

15. Calculate the total salary (basic+DA) paid for each department.

16. Display the Employee names in descending order.

17. Display the Average salary paid for all the Employees.

18. Change the basic salary of Jain to 4500.

19. Change the department number of Raman to 20.

DDE
20. Delete the Employee whose number is 4.

21. Change the Employee name of Vivek to Vivek kumar.

22. Delete the Employee details where the department number is 30 from Emp
table.
Try the following:
1. Create a table to hold the following book details of a library:

Bcode character 5 (Book Code)


BTitle character 25 (Book Title)
BAuthor character 25 (Book Author)
BPub character 25 (Publisher)
BCost number (Book Cost)
No. of Co number (Number of copies)

2. Design a report for viewing the department details

3. View the report for the employee database.


13

DDE
14

MS Word 2000
Exercise 1:
Solution 1.1
Follow these points to complete this exercise:
 To create a new document, press Ctrl + N, or click on the New button on the
standard toolbar.
 Type the first line of the document – Office Assistant.
 Make it Bold, Underlined and Centered by pressing the key combination, Ctrl +
B, Ctrl + U and Ctrl + E respectively. Or press the appropriate buttons on the
formatting toolbar.
 Type in the rest of the text, without pressing Enter. Wherever a new paragraph
starts, press Enter.
 After typing, switch to the Print Layout view by choosing Print Layout from the
View menu.
 Save the document by pressing Ctrl + S. The Save As dialog box appears. Specify
the name of the file as wordhelp – in the File Name box and press enter.
 Close the file by pressing Ctrl + W or by choosing Close from the File menu.

Solution 1.2
 Open the saved wordhelp file.
 Position the cursor at the beginning of any one of the paragraph and then block
the paragraph using the mouse.
 Press the left mouse button on the paragraph without releasing the mouse button.
 A small dotted rectangle will appear at the bottom of the cursor. Now drag the

DDE
paragraph to the place where the user wants to move and then release the mouse
button.
 This will place the paragraph at the specified place.

Solution 1.3
 Place the cursor at the beginning of any one of the paragraphs.
 Press the Insert button in the keyboard or enable the OVR button in the status bar
by double clicking on it.
 Start typing the new paragraph. This will replace the text character by character as
the user types the text till end of the paragraph.
 Follow the same method for the remaining paragraphs.

Solution 1.4
 Place the mouse cursor at the right side of the page just before the last paragraph
by double clicking the mouse.
 Then start typing the text. The text will get right aligned as the user types the text.

To insert a picture in between the paragraphs at the center or right side of the page,
15

follow the steps given below:

 Double click the mouse at the place where the picture needs to be inserted. Select
Picture  From File on the Insert menu. This brings Insert Picture dialog box
on the screen. Select a picture file (the file can be a bitmap or gif etc.,) and click
Insert. This places the picture at the place where the mouse cursor is blinking.

Exercise 2:
Solution 2.1
Follow these points to complete this exercise:

 To insert a header, choose View  Header and Footer. A dotted rectangle appears
for the header and footer and the insertion point appears at the top left corner of
the header. Press Tab once to bring the insertion point to the center, and type out
the text “Office Assistance”. Choose Insert Page Number from the Header and
Footer toolbar, and the page number is inserted.

Solution 2.2
 Place the insertion point in the first paragraph, and choose Format  Bullets and
Numbering. The Bullets and Numbering dialog box appears. Click Picture
button, and from the Picture Bullet dialog box, click Pictures tab, if it has not
been selected. Choose the desired picture bullet and click OK.

 Repeat the procedure for the other paragraphs. As a shortcut, place the insertion
point on each of the other paragraphs and press Ctrl + Y (remember, Ctrl + Y

DDE
repeats the previous action).

Solution 2.3
 Choose Format  Paragraph. The Paragraph dialog box appears. From the Line
Spacing box, choose Single. Click OK. Repeat the same procedure for the other
paragraphs.

 Place the insertion point on the line between two paragraphs and choose Format
 Paragraph. From the Line Spacing box, choose 1.5. Click OK. Repeat the same
for the space between other paragraphs.

Solution 2.4
 Select the text that is to be converted into the two-column format. Choose Format
 Columns. Choose two from the Presets group. Click OK.

Solution 2.5
 Choose Insert  Text Box. Place the text box in the middle of the document.
Enter the text “Asking for Help from the Office Assistant” inside the text box and
center the text. Right click on the text box and from the pop up that appears,
choose Order  Bring Forward. Right click again on the text box and choose
16

Format Text Box. The Format Text Box dialog box appears. From the Color box,
choose No Line.
Solution 2.6
 Choose Rectangle from the Drawing toolbar (if the toolbar is not visible, right
click on one of the other toolbars and from the popup that appears, choose
Drawing). Draw the rectangle so that it covers the entire page. Initially, the text
inside the rectangle will not be visible. Right-click on the rectangle and from the
popup, choose Order  Send Behind Text. The text will appear now.

 Select the heading and choose Format  Borders and Shading. From the Borders
and Shading dialog box, select the Shading tab folder. From the style drop down
box, choose Gray-25%. Click OK.

Solution 2.7
To create an index for the above document, follow the steps given below:

 Open the document first and place the insertion point at the beginning of the file.
Choose Index and Tables from the Insert menu.

 The Index and Tables dialog box appears on the screen. Choose the Index tab, if
it has not been selected. Select a format for the index from the Formats option in
the lower left corner of the Index and Tables dialog box. Specify the type whether
the index should be Indented or Run-in.

 In the Columns option, specify the number of columns in which the index has to

DDE
be created. Choose Mark Entry option to bring the Mark Index Entry dialog
box. Select a word or phrase in the document and place the cursor over the dialog
box or in the Mark entry field. This places the selected text in the Mark Entry
field. Click the Mark button to mark the selected text as an index entry. Continue
this process till all the words or phrases in the document gets selected. Then click
the Close button to close the dialog box.

 To view the list of words selected for the index entries alphabetically, move to the
end of the document. Choose Index and Tables on the Insert menu. The Index
and Tables dialog box appears on the screen. Click the OK button to generate
index in that file.

 Save the document and close it.

Exercise 3:
Solution 3.1
The steps to be followed are:
 Open the document wordhelp.doc. The thin wavy lines are the possible errors
identified by the Spelling or the Grammar checker. Right click on the underlined
17

text and choose Spelling (depending on the type of error). Choose Ignore All
from the dialog box that appears.

 Certain text may still remain underlined even after choosing Ignore All. This is
because the nature of the error chosen to ignore is different from the nature of the
error that has been identified.

 Select the text of the entire document (except the heading) and choose Columns
from the Format menu. In the dialog box that appears, choose one from the
Presets group and choose OK. The whole document is converted into a single
column format.

 Select the text again and choose Convert Text to Table... from the Table menu.
The entire text of the document is converted into a table, with paragraph in a row.
Delete the extra, empty rows that appear in the table, by selecting the row and
choosing Table  Delete Rows.

Solution 3.2.

 Select the first occurrence of the word “Help”, and choose Tools  Macro 
Record New Macro. The Record Macro dialog box appears. Choose the
Keyboard option from the Assign macro to group and in the Customize
Keyboard dialog box, press any key combination that has to be assigned to the
macro (for example, Ctrl + Q). Click Assign and then click Close. The macro
recording starts.


DDE
Now make the changes to the selected text. Make it Courier New, 10 and Bold.
Click Stop Recording on the Macro Recorder.

 Press Ctrl + F to find the word and type in the word Help and press Enter. The
word is selected. Bring the focus to the window containing the selected word.
Press Ctrl + Q. Repeat this procedure until all occurrences of the word are
highlighted.

Solution 3.3.

 To perform a mail merge, a data source must be created first. Open a new
document, and type the names and addresses of all the persons to whom the
document has to be sent, preferably in the following format:

First Name Last Name Address City Pin


Vijay Raman 24,swamy Chennai 600053
St.
... ... ... ... ...
 Save and close the document.
18

 Open the document, which contains the information to be sent.


 To perform mail merge, choose Tools  Mail Merge, and in the dialog box that
appears, choose Form Letters from the Create drop down list. Word asks
whether the form letter must be the active document window or a new document
window. Choose Active Window.
 Choose Open Data Source from the Get Data drop down list. The Open Data
Source dialog box appears. Select the name of the data source file saved and
choose open.
 A dialog box appears asking you to choose Edit Main Document button to insert
merge field into your main document. Click Edit Main Document button
 The mail merge toolbar appears. Place the cursor at the bottom left corner. From
the Insert Merge Field drop down list, choose the merge fields like first name,
last name, address etc. and after all the merge fields are inserted, choose Mail
Merge from the mail merge toolbar. Save the merged document as a separate file.

Exercise 4:
Solution 4.1.

To complete the above exercises, follow these steps:


 Open a new document and type in it the text:
Getting Help from the Help menu
Getting Help from the Office Update Web site

Save the file as link.doc and close it.

DDE
 Open the file wordhelp.doc. Navigate to the text box and select a text.
 Choose Hyperlink from the Insert menu or press Ctrl + K.
 In the Insert Hyperlink dialog box, click on File… below Browse for:
 The Link to File dialog box appears subsequently, and from the list of files,
choose link (the name of the hyperlink destination file), and click OK.
 The hyperlink is created.

Solution 4.2.

 To place a footnote, position the insertion point after the word habit and choose
Footnote... from the Insert menu. The Footnote and Endnote dialog box appears.
 Choose Options, and after ensuring that we are in the All Footnotes tab, choose
Beneath Text in the Place At box. Choose OK.
 The separator line appears immediately after the line where the text ends in the
page. Type in the text of the footnote, and to come back to the original text in the
document, use the mouse.
 Save the document and close it.
19

Exercise 5:
Solution 5.1.
Working with the Table

Regna. Name Mark1 Mark2


1 Arun 95 97
2 Balaji 96 97
3 Chandra Sekar 85 90
- To create a table click
Table -> Insert -> Table
- Specify number of rows as 4 and columns as 4 to create table.
- Click Select Column on the Table menu to select a column, and then
click Insert Columns on the Table menu to insert columns.
- Click Select Rows on the Table menu to select a column, and then
click Insert Rows on the Table menu to insert Rows.

5.1.1. Merging Cells


- Block the cells going to be merged.
- Click Merge Cells option on Table menu
5.1.2. Splitting a Cell
- Select the cell.
- Click Split Cells option on Table menu
- Enter the Number of Columns and Number of Rows to Split.
5.1.3. Splitting a Table
- Select the Row where you want to split.

DDE
- Click Split Table option on Table menu.

Solution 5.2.
Find and Replace Word Document
- Type the following content in a new document:
(Word can find and replace the grammatically inflected forms of a
word.)
- Click Replace option on Edit menu

- Click Replace All to Replace the Text.


20

Solution 5.3.
Inserting Picture

- Double click the mouse at the place where the picture needs to be
inserted.
- Select Picture -> From File on the Insert menu. This brings Insert
Picture dialog box on the screen.
- Select a picture file (the file can be a bitmap, GIF, or JPEG etc.,) and
click Insert.
- This places the picture at the place where the mouse cursor is blinking.

Solution 5.4.
Spelling and Grammar
- Click the Spelling and Grammar option on the Tools menu.

DDE
 Click the Ignore button if you want to leave it unchanged.
 Click the Ignore All button to leave all instances of the word unchanged
during the current Word session.
 Click the Change button to replace the highlighted word by the word in
the Suggestions box, after selecting it.
 If the Suggestions box is empty, the Change button is displayed as
Delete. Use Delete to delete the selected word.
 Click the Change All button to replace all instances of the highlighted
word by the word in the Suggestions box.
 If the Suggestions box is empty, the Change All button is displayed as
Delete All. Use Delete All to delete all instances of the selected word
from the document.
21

Solution 5.5
Mail Merge
Create a Letter Document dated with current date for each of the following
recipients in the table given below using mail merge. (Use the details
given below for the letter).

From Address
AU Computer Training Center,
Chennai – 6.

To Address

Enroll No. Name Address


101 Raja 1, New Street, Chennai –8
102 Roja 2, Old Street, Chennai – 9.
103 Sivakami 3, Monitieth Road, Chennai – 8.
104 Omar 4, Mosque Street, Chennai – 5.
Body:
Sir/Madam,
This is to inform you that you will be having a test on MS office Tools on Sunday 26-
03-2003.

DDE
Thanks and Regards,
Authorized Signatory.
Solution:
 Open a New document.
 Type the content as given above except the table. Leave space below the
to address.
 Click Mail Merge option on Tools menu. Mail Merge Helper document
window will open.
 Inside Main document category click Create button and select Form
Letters. Then click Active Window.
 Inside Data Source category click Get Data and select Create data
source (If you already have the table then select Open Data Source.)
 Set of Field name list will be displayed inside Field names in header row
box. Remove unwanted field by selecting and clicking Remove Field
Name button.
 If you want to enter new field name, type the field name inside Field
Name: text box and click Add Field Name button.
 After inserting the field press Ok button and give the name to save the
table (this table will be stored in MS-Word format).
 Click Edit Data Source button to enter the records (The data Form
window will open as show below)
22

 Click Add New button to insert new records. After entering four records (Records
are given above in the table) press Ok button to quit the screen.
 Mail Merge toolbar will appear in the toolbar area.
 Click Insert Merge Field option on Mail Merge Toolbar.

 Keep the cursor below the To Address in the document and click any one of the

DDE
field one by one from Insert Merge Field option
 In the same toolbar click Merge to New document option to merge the records in
the document.
23

MS Excel 2000

Exercise 1:
Solution 1.1.
 Enter the months Jan and Feb in the consecutive cells (row wise or column wise).
 Select the two cells. Position the cursor on the bottom right corner of the cell till a
‘+’ sign appears.
 Drag the Fill Handle to 10 columns (if cells are filled row wise or column wise)
and then release the mouse button.

Solution 1.2.
1.2.1. The steps to be followed are:
 Click the cell in the row where name is Bhaskar.
 Right-click the mouse and select the Delete… option.
 Choose Entire row option in the dialog box that appears and click OK.

1.2.2. The steps to followed are:


 Click the cell on the row that has the name Jai.
 Right-click the mouse and select the Insert… option.
 Choose Entire row option to insert a row.

1.2.3. The steps to be followed are:


 Click the cell on the column that has the column name Salary.
 Right-click the mouse and Select the Insert… option.

DDE
Choose Entire Column option to insert a column.
Exercise 2:
Solution 2.1.
By using Auto Sum
 Click the cell below the column name Total amount.
 Click the AutoSum option and and press Enter. It will display the Total Amount.
(Repeat this for all the columns).

To calculate the total amount using the Relative Addressing:


 Click the cell, where you want to enter the formula.
 Type an equal sign (=) to begin the formula.
 Type the formula, and then using the Fill handle, copies the formula to the
adjacent cells.
(All the above operations are done in the column Total Amount).
Solution 2.2
2.2.1. The steps to be followed to name the “Actual amount” column are:
 Select the column “Actual amount”.
 Click the Name box.
 Type amt_amt and press Enter.
24

2.2.2. To align the entries, select the columns “Actual amount”, ‘Tax” and “Total
amount” and click the Centre alignment button.

2.2.3. To hide the “Tax” column, right-click the column header and then select Hide from
the pop-up menu.

2.2.4. Follow the steps given below to apply number format:


 Select the cells of the Actual amount column and select Format  Cells.
 Click the Number tab in the dialog box that appears.
 Select Number from the Category list box and click OK.

The final output is as shown in Fig1.1


Medicine Actual Tax Total
Name amount Amount
(1 strip)
Crocin 15 2 17.00
Dolo 20 1 21.00
ColdAct 35 3 38.00
Anasin 22 1 23.00
Zeecuf 33 4 37.00

Exercise 3:
Solution 3.1.
The steps to be followed when using the Pivot Table wizard are:

DDE
 Select the source table.
 Choose the Pivot Table and Pivot Chart Report… from the Data menu.
 Select the Microsoft Excel list or Database option and select the kind of report to
be created and click next.
 Specify the data source range in the list range box and click Next.
 A dialog Box appears whether you want to put the pivot table in the existing sheet
or in the new sheet.select the Option New sheet and click Finish.
 Drag cust_Id into Drop Page field Here, Cust_Name into Drop Row Field Here,
drag the other fields and drop it in the drop column fields and then drag Unit price
and drop it in the drop data items.
 Select the format and data options, as well as the page layout (down, then over)
from the drop down list
 With the generated Pivot Table, analyze the data field with the corresponding
base (page) field and records.
 Select the entry i.e. the customer “babu” in the table and filter the records using
AutoFilter from the Data menu.
 Write a relevant key factor for which the list has to be filtered.
25

Exercise 4:
Solution 4.1
The steps to be followed using the chart wizard are:
 Select the range of values against which the chart has to be drawn.
 Click the chart icon and select the type of chart (select Column).
 Give a title to the chart.
 Using the wizard, enter the required details and click Finish. The chart is created
as shown below:

Solution 4.2.
Follow the steps to publish an excel document as a web page on the Intranet or WWW
 lick Start  Programs  Microsoft Excel

DDE
 The Excel opening screen appears displaying a blank workbook labeled Book1.
 Type the data(s) as given in the table or type your own data(s).

Customer Phone List


Customer Company Phone Fax
Name Name
Vijay Sharp Tech 020-85674 030-0076545
Raghavan
Srivalli Hard Core 040-22492 (5) 555-3745
Publishers.
Bhaskar Sharp Tools 044-7890
Ajith Ofset Tech 80-7890 0621-08924
Sundar Bye Computers 020-65467

 Select Save as Web Page from the File menu. The Save As dialog box appears as
shown in Fig. 1.3
26

Note
 If the Add interactivity option has not been chosen, then the selected item i.e., the
entire workbook will be published as a static page without any interactive
functionality. After publishing the page the user cannot make any modifications
on this page.
 In the Save in list, select the location on which the user wants to save the
workbook.
 In the File Name box, type a name with an extension (.htm).
 Click the Change Title button to apply or change a title for the web page.
 To save the entire workbook, select Entire Workbook and click save.
 To save a part of the workbook, such as a worksheet or a chart or a table, choose
Save as web Page and select the option Selection and click Publish. The Publish
as Web Page dialog box appears as shown in Fig 1.4.

DDE

 Select the item to be published from the Choose box. The item could be a range
of cells or items on the sheet1, sheet2 or sheet3. Here we are going to choose a
range of cells, so choose Range of cells from the Choose list.
27

 The action displays another field below the Choose field, wherein the user has to
select the range of cells to be published.
 Click the button on the right side of the field to select range of cells on the
worksheet.
 Select the range of cells to be published on the worksheet by clicking and
dragging the mouse from the place where the data starts and ends as shown in the
Fig

 DDE
Click the button again on the right side of the Publish as Web Page – Range
Dialog box as shown in the above figure to go back to the Publish as Web Page
dialog box.
 Now the user can see the range of cells selected to be published in the field.
 Check the Add interactivity with option under Viewing options, then select the
type of interactivity we want for our web page.

Spreadsheet functionality: This allows us to enter, update, copy, move, delete, sort and
filter data.

Pivot Table functionality: This allows us to change the layout of a PivotTables data or
sort, filter and change the data as well.

 By default, Spreadsheet functionality will be selected in the box. Let the option
be as it is.
 Click the Change button to change the title of the web page.
 To view the web page in a web browser, enable the open published web page in
browser check box.
28

 Finally, click the Publish button to view our web page (as shown in the Fig. 1.6)
in a browser.

DDE
29

MS Power Point 2000


Exercise 1:
Solution 1.1
 Open the PowerPoint application. Choose Blank Presentation from the dialog
box and click OK. If the PowerPoint application is already open, choose File
New…. The New Presentation dialog box will appear. Choose Blank
Presentation and click OK.
 In the New Slide dialog box choose Title Slide layout and click OK.
 Choose the placeholder that says, “Click to add title” and type “Company
Hierarchy”. Set its font style to Tahoma, 44 and Bold. On completion, click
anywhere outside the placeholder. Thus the first slide appears as shown in Fig 1.7.

DDE
Fig 1.7
 Choose File Save As…. In the File Name text box of the Save As dialog box,
enter the name of the presentation as Company profile. In the Save as type
textbox select Presentation. Click the Save button.

Solution 1.2
 Choose View Master Slide Master. This opens the Slide Master.
 Choose Format Apply Design Template. The Apply Design Template dialog
box opens.
 Select the “Capsules” design and click Apply.
 In the Master slide, click on the design and move it up and then increase the area
for the subtitle (if necessary).
 Type the following in the “Click to edit master subtitle style” placeholder:
Click to edit Master text styles
30

Second level
Third level
Fourth level
Fifth level
 Set the corresponding bullets for each level. The bullets should be 100% of the
text. If desired, the colour of the bullets could be changed.
 Select the first two levels and set the font style to Bold.
 Save the presentation
On completing the above steps, the screen appears as shown in Fig 1.8.

Solution 1.3
DDEFig 1.8

 Choose Insert New Slide…. The New Slide dialog box appears.
 Choose Bulleted List layout and click OK.
 In the “Click to add title” placeholder type “Company's Profile”. Set its font style
to Bold.
 In the “Click to add text” placeholder, type the following at the corresponding
levels:

XYZ Company was formed on 1999.


Consists of 2 branches.
Deals in Customized development
Deals in Hardware sales & Service
Hardware partners HCL & Samsung
 Save the Presentation.
Solution 1.4
 Choose Insert New Slide….
 In the New Slide dialog box choose the Blank layout.
31

 Choose AutoShapesBasic ShapesBevel from the Drawing toolbar


 Place the mouse on the slide. Click and drag the mouse to draw the Bevel. (If the
Drawing toolbar is not visible, right click on any toolbar to see the popup menu
and select the Drawing toolbar option). Release the mouse.
 Choose AutoShapesBasic Shapesdonut from the Drawing toolbar.

 Place the mouse pointer inside the Bevel. Click and drag the mouse on the slide to
draw the donut. Release the mouse key.

 Choose AutoShapesBasic ShapesCan from the Drawing toolbar.

 Place the mouse pointer inside the donut. Click and drag the mouse to draw the
can. Release the mouse.

 Choose AutoShapesBasic ShapesSmiley Face from the Drawing toolbar.

 Place the mouse pointer near the drawn figure. Click and drag the mouse on the
slide to draw Smiley Face. Release the mouse.

On completing the above steps, the slide will appear as shown in Fig 1.9.

DDE

Fig 1.9
The Slide Sorter View helps us to see all the slides in a single screen. The Slide Sorter
View can be opened in two ways:
 Click the Slide Sorter View button in the lower left corner of the screen. (OR)

 Choose View Slide Sorter


32

The screen appears as shown in Fig 1.10.

Fig 1.10

Exercise 2:
Solution 2.1.
 Open the slide that has the title “Company Hierarchy”
 Choose Insert  Picture  ClipArt.
 Choose the category Dividers & Décor
 Choose compasses and insert it.
 Close the Clip Gallery.
 Enlarge the clip art and drag it to center of the slide.
 Save the slide.

Solution 2.2

DDE
 Open the slide to which the Organizational chart has to be attached.
 Choose Insert  Picture  Organization Chart or click the Insert Org Chart
button on the Standard Toolbar. Organization chart starts automatically.
 Change the title as XYZ Hierarchy. Select Text Font. Choose Monotype
corsiva, set the font size as 48.
 Type Dr. Saravanan.in first line and Managing Director (MD) in second line of
top box.
 Choose Text Font. Set the font size as 28 and choose Italic style.
 Add other designations and names as per the hierarchy.
 Choose File  Exit and Return to Presentation.
 A dialog box asks ”Do you want to update object in Presentation before
proceeding”?
 Click Yes. Microsoft Organization chart closes and returns to PowerPoint.
 Choose Insert Pictures WordArt. Choose the style and type Company
Hierarchy.
 Place the WordArt in top of the slide and save the slide.

Solution 2.3
 Open the slide to which the table has to be attached
33

 Choose Insert Table


 Enter the Number of Columns as 2 and Rows as 6
 In the First Row first column type Project Name and in the Second Column type
Platform then type records as given in the table in the next rows

Exercise 3:
Solution 3.1
 Move to the AUTO SHAPES slide
 Choose InsertPictureFrom File…
 Select the C:\Windows directory
 Select the Circle.bmp file
 Click Insert. The picture will appear in the center of the slide.
 Select the picture and enlarge it and move it to a suitable position on the slide.

On completing the above steps, the slide will appear as shown in Fig 1.11.

DDE
Fig 1.11

Solution 3.2
 Open the WordPad application
 Type the following:

Future Plans
Investors

 Save the file as Details.rtf in the C:\ directory.


 Close the WordPad application.
 Open the Company profile presentation in the PowerPoint application
 Select the last slide.
 Choose InsertSlides from Outline…. The Insert Outline dialog box is
opened.
34

 Move to the C:\ directory and select the Details.rtf file.


 Click on the Insert button. Two slides will be created with titles Future Plans
and Investors respectively.

Solution 3.3
 Choose the AUTO SHAPES slide
 Choose FileSave As to open the Save As dialog box.
 Select the C:\ directory.
 Enter AutoShapes.wmf in the File Name textbox.
 From the Save As Type list select Windows Metafile.
 Click Save.

Solution 3.4
 Click the Slide Sorter View button in the lower left corner of the screen (OR)
Choose ViewSlide Sorter. All the slides in the presentation will be displayed.
 Click on the Future Plans slide.
 Drag the slide and drop it after all the slides. Thus the Future Plans slide is set as
the last slide in the presentation.

Solution 3.5
The Slides can be deleted by using both the Outline View and the Slide Sorter View.

To delete the slides in the Slide Sorter View:


 Choose ViewSlide Sorter.
 Select the three slides by Pressing Ctrl Key which are to be deleted.

DDE
 Press the Delete key on the keyboard (OR) Choose Edit Delete Slide.

To delete the slides in the Outline View:


 Choose the Outline View in the lower left bottom of the screen.
 Select the AUTO SHAPES slide in the Outline pane.
 Press the Delete key (OR) Choose Edit Delete Slide.
 Repeat the above steps for the other two slides.

Note
 If the slide is deleted using the delete key, then a dialog box appears as shown in Fig
1.12. Click on the OK button to confirm the deletion.

Fig 1.12
35

Solution 3.6
 Choose Slide ShowSlide Transition…. The Slide Transition dialog box
appears.
 Select Random Transition option in the list box under the Effect frame.
 Click on the Slow option.
 Click the Apply to All button. The Random Transition will be applied to all the
slides in the presentation.

Solution 3.7
 Choose either the Outline View or the Slide View or the Normal View.
 Choose Slide Show Custom Animation…. The Custom Animation dialog
box appears.
 Check the Title1 check box in the Check to animate slide objects frame.
 Select Effects tabs and in the Entry Animation and Sound frame, select Fly in
the first list box and From Left in the second list box.
 Check the Text 2 check box in the Check to animate slide objects frame.
 In the Entry Animation and Sound frame select Spiral in the first list box (The
other list box is disabled for this option).
 Click the Preview button to view the effect.
 Click OK to accept the settings.

In the Slide sorter view, a transition symbol appears in the lower left corner of the slide.
On clicking it, a preview of the animation is shown.
Solution 3.8
 Choose Slide ShowCustom Shows…. The Custom show dialog box opens.

DDE
 Click the New button. The Define Custom Show dialog box appears. In this
dialog box the user can arrange the slides in a unique order for later playback.
 In the Slide Show name text box type Custom1.
 Select the slides (by pressing the Shift key and clicking on each of the slides).
 Click the Add button to copy them to the window on the right.
 Click OK.
 Click the Close button to close the Custom Shows dialog box.

To view the custom show:


 Choose Slide ShowCustom Shows…. The Custom Shows dialog box appears.
 Select Custom1.
 Click Show

Note
 If a slide has to be removed from the Custom show, select the appropriate slide
and click the Remove button.
 The order of the slides in the custom show can be rearranged by clicking the
desired slide and by using the up and down arrows at the right edge of the
window.
36

Solution 3.9
 Choose FileSave as Web Page…. The Save As dialog box is opened.
 Save the presentation as comp_pro.htm file (The Save As type should be Web
Page) in the C:\ directory.
 Click Save. This generates the Web page.
 Open the Internet Explorer.
 Type C:\comp_pro.htm in the Address textbox.
 Press Enter key.

Solution 3.10
 Select the last slide.
 Choose AutoShapesAction Buttons from the Drawing toolbar.
 Select the Custom action button.
 Place it on the slide. The Action Settings dialog box opens.
 Select the Run Program option in the Mouse Click tab.
 Click the Browse… button. The Select a Program to Run dialog box appears.
 Change the directory to C:\Windows.
 Select Notepad.exe from the resulting dialog box.
 Click OK.
 Click OK to close the Action Settings dialog box.
 Right click the mouse to view the popup menu.
 Select the Add Text option.
 Type the text - Click to enter your comments in the button.
 Click outside the button to end the typing.
 Click and drag the yellow handle to change the shape of the button.

To change the color of the button: DDE


 Right click the mouse to view the popup menu.
 Select Format AutoShape… in the popup menu. The Format AutoShape dialog
box opens.
 Select the Colors and Lines tab.
 Change the Fill color and the Line color as desired.
 Click OK.

Save the Presentation and view the slide selecting Slide Show.
37

MS – ACCESS 2000
1.

DeptNo DeptName Location


10 Admin Chennai
20 Marketing Mumbai
30 Sales Delhi
40 Purchase Bangalore

2.
EmpNo EName Basic DA Deptno
1 Sundar 2400 500 10
2 Vijay 3500 650 20
3 Saravanan 4600 780 30
4 Sethu 5700 890 20
5 Raja 6100 950 10
6 Surendar 7300 560 30
7 Vivek 6500 430 20
8 Raman 5400 230 10
9 Jain 3300 460 10
10 Ajay 7800 660 20

3.

4.
Select * From Emp
DDE
Select basic From Emp where Ename='Sundar'

5. Select basic+da From Emp where Ename='Raja'

6. Select * From Emp where Empno=3

7. Select * from Emp where basic =(select Max (basic) from emp)

8. Select * from Emp where DA =(select Min (da) from emp)

9. Select deptname from emp,dept where dept.deptno=emp.deptno and


Emp.name=’sethu’
38

10. Select ename, deptname from emp, dept where dept.deptno=emp.deptno

11. Select Basic*0.3 from Emp

12. Select basic*0.12 from Emp

13. Select DeptName from Dept Where DeptNo Not In (Select DeptNo from
Emp)

14. Select deptname, count (ename) from EMP, dept


Where emp.deptno=dept.deptno group by deptname

15. Select deptname, sum (basic+da) From dept, EMP


Where dept.deptno=emp.deptno Group By deptname

16. Select ename from EMP Order by ename desc

17. Select Avg (Basic+DA) From Emp

18. Update Emp SET Basic=4500 Where EName='Jain'

19. Update Emp SET Deptno=20 Where EName='Raman’

20. Delete from EMP Where Empno=4

21. Update Emp Set Ename=’Vivek Kumar’ Where Ename=’Vivek’

22.
DDE
Delete from Emp Where Deptno=30
39

ADDITIONAL QUESTIONS
MS-OFFICE
Ms-word

1. Create a formatted resume, which must be above 1 page.


2. Create a document, type two or more paragraph about Internet and it must be
formatted apply watermark “Confidential ” and current date.
3. Create a web page about Annamalai University and apply designs.
4. Create two documents use hyperlink to navigate these two documents
5. Create a document with above 5 paragraphs create an index.
6. Create a document with 5 paragraphs you must perform following tasks.
a. Apply different style for paragraph headings.
b. Apply picture bulleted list
7. Create a document with 4 paragraphs set first line spacing as 0.3”, set spaces
between each paragraphs is 1.5 pt, set line pacing as 1 line. And Convert the
document as 3-column format.
8. Create a mark sheet with tables. The table must be drawn manually.

DDE
9. Create a document add page border, page numbers, insert an image into the
document.
10. Create a document for employee details embed a MS-Excel employee detail
worksheet in the document. Whatever the changes made in the excel worksheet it
must be reflected in the document.
11. Create an invitation for your birthday party to your friends (use mail merge).
12. Create a document with five or more paragraphs and show that the usage of
Macros.
13. Create a document about company employee details and import an employee
table from the MS-Access. Employee number must be in sorted for and who have
get more than Rupees 2000 salary.
40

14. Create a document which contains two frames, left side of the document contains
contents of the frame, if we click the content the corresponding details in the
frame 2 will be shown.
15. Create a word application to print 8 addresses
16. Paste a bmp in a word document and add handouts about it.
17. Create a document which uses wordart
18. Create a document and add a header and a footer to it
19. Create a word document and perform spell check and grammar check
20. Create a word document that uses bulleted list
21. Create two documents and merge them
22. Create a document that calls dynamic help

MS-Excel
1. Create a excel sheet for student mark list, Find the total, average using relative
addressing using a conditional format differentiate field who have lesser than 40
marks.

DDE
2. Create a excel sheet with following format

Sno Name Lang Major


L1 L2 M1 M2 M3 M4
01 Mohamed 88 55 45 65 90 88
02 Jennifer 89 66 54 87 88 60
03 Ram 77 49 66 85 99 90

 Insert 2 student details between Jennifer and Ram.


 Insert 3 more columns after marks total, average and class and calculate
the total, average and class.
 Sort the records according to serial no.

3. Create a sales report for your company and show that growth of your company by
Chart.
41

4. Create a excel sheet about employee details import an employee table from the
oracle.
5. Create an excel sheet which shows the list of employees in an organization
6. Create an excel sheet to print the pay slip of an employee
7. Create an excel sheet that contains the course details
8. Create an excel sheet which contains pie chart that shows the monthly expense of
an organization
9. Create an excel sheet that contains students mark list. Sort it
1. Ascending order of names.
2. Ascending order of total marks.
3. Descending order of grades.
10. Create a custom view for your excel sheet to navigate excel sheet.
11. Create a form to enter supplier details in an excel sheet
12. Create an excel sheet and illustrate maximum, minimum, sum, count, average and
square functions
13. Create excel sheet for student marklist. Calculate the class average and individual
rank

DDE
14. Create an Excel sheet for student it contains Roll No, Name, Course, Date of
Joining, Sex columns insert 5 student details through Form (Data  Form).
15. Create a excel sheet for Employee Detail Maintenance which has empno, name,
Date of birth, Department, Salary. Name must be 25 characters long, Date-Of-
Birth must be valid date. (Use Data Validation).
16. Create an excel sheet with a custom header and footer
17. Create an excel sheet that contains formatted headings
18. Create a macro in excel that to increase the font size of the cell
19. Create an excel sheet that uses paste special and paste link options
20. Create an excel sheet that stores the addresses
42

Ms-Power Point
1. Create a Slide Show using Design template and with different animation effects
about your XYZ Company.
2. Create birthday greeting for your friend.
3. Create a Slide Show for your Course content in semester-wise .You must use
different effects and transition to your slide.
4. Create a slide show with four slides. Each slide should have slide number,
heading. USE slide master for formatting

5. Create a slide show which makes of clip art


6. Create a slide show that illustrates the various shapes with examples
7. Create a slide show about your company. Apply transitions
8. Create a slide show using different design templates about your XYZ Company.0
9. Create a Slide Show to explain traffic signals. Use necessary clip arts.
10. Create a slide show that contains slides with charts and clip arts
11. Create a slide show and set auto timings
12. Create a slide show with organization chart
13. Create a slide show with two column text
14. Create a slide show copying the content from word document
15. Create a slide show and save it as an exe file

DDE
Ms-Access
1.a. Create dept table with following structure and insert 5 records
Deptno number
Dname text
b. Design a query to display all the records of dept table
2.Create emp table with following structure
empno number
ename text
deptno number
basic number
doj date Insert 5 records into the table using form
3.Display the employee working in the given department. Accept department from user
4. Design a report to retrieve employee details department wise
43

5. a. Display the employee receiving maximum salary


b. Create a report displaying the employee database sorted by ascending order of
doj
6. a. Create course table and insert 5 records

Course
Courseid Number
CourseName Text

b. Display the course details in tabular form


7. Create student database and insert five records using form. Declare constraints

Stud
RollNo Number
Name Text
Courseid Number
Sex Text
DateOfBirth Date
Address Text

8. a. Display students according to courseid


b. Display students sorted by age ascending
9.

10.
DDE
a. Create address database and enter 5 records
b. Display address in label format in a word document
a. Design a form to enter records into address data base
b. Display the addresses available for a given city. Accept city at runtime
11. Create the Supplier table in the following format.
Supplier
S# SuppName City
S1 John Paris
S2 Alex London
S3 Mohamed Porto Novo
S4 Ram Berlin
S5 Ahad Calcutta
44

a. Design the form to enter the data.


b. Design the query to display supplName in ascending order.
12. Create Item table in the following structure.
ItemNo Number
ItemName Text
Color Text
Cost Number
 Itemno must be a primary key
 Insert ten records
13. Create Item table in the following structure.
ItemNo Number
ItemName Text
Color Text
Cost Number
14. Create a supplier table in the following format.
Sno Number
ItemNo Number

DDE
Sname Text
City Text
 Relate the two tables.
 Insert 10 records.
 Create the report Supplier number group by item no.
15. Import an EMP details from a excel Sheet into your EMP table.
 Display all the details of the EMP.
 Display the employee who is getting more than 5000 as salary.
16. Import a student detail table from text file into access database.
 Display the student in course wise.
 Create a report for the student detail.
 Add more records using forms
45

C Programming
DDE
46

C Programming
1. Write a Program to print “Hello World”.
#include <stdio.h>
int main (void)
{
printf ("Hello World! \n");
}

OUT PUT:
Hello World!
2. Write a Program to Print powers of 2: 1, 2, 4, 8, up to 2^N
#include <stdio.h>
#define N 16
int main(void)
{
int n;
int val = 1;
printf("\t n \t 2^n\n");
printf("\t================\n");
for (n=0; n<=N; n++)
{
printf("\t%3d \t %6d\n", n, val);
val = 2*val;

DDE
}
return 0;
}

OUT PUT:
n 2^n
================
0 1
1 2
2 4
3 8
4 16
5 32
6 64
7 128
8 256
9 512
10 1024
11 2048
12 4096
13 8192
47

14 16384
15 32768
16 65536

3. Write a program Add two numbers and print them out with their sum.
#include <stdio.h>
int main(void)
{
int first, second;
printf("Enter two integers > ");
scanf("%d %d", &first, &second);
printf("The two numbers are: %d %d\n", first, second);
printf("Their sum is %d\n", first+second);
}

4. Write a program to find the factorial of an integer.


#include <stdio.h>
int fact(int n);
int main(void)
{
int current;
printf("Enter a positive integer [to terminate enter non-positive] > ");
scanf("%d", &current);
while (current > 0)
{

DDE
printf("The factorial of %d is %d\n", current,
fact(current));
printf("Enter a positive integer [to terminate
enter non-positive] > ");
scanf("%d", &current);
}
}
/* n is a positive integer. The function returns its factorial */
int fact(int n) {
int lcv; /* loop control variable */
int p; /* set to the product of the first lcv
positive integers */

for(p=1, lcv=2; lcv <= n; p=p*lcv, lcv++);


return p;
}
5. Write a program to find the given number is Prime Number or not.
#include <stdio.h>
int main(void) {
int n;
int i;
48

int flag;
printf("Enter value of N > ");
scanf("%d", &n);
for (i=2, flag=1; (i<(n/2)) && flag; ) {
if ((n % i) == 0)
flag = 0;
else
i++;
}

if (flag)
printf("%d is prime\n", n);
else
printf("%d has %d as a factor\n", n, i);
}

6. Write a program to find first N Fibonacci Numbers.


#include <stdio.h>

int main(void) {
int n;
int i;
int current;
int next;

DDE
int twoaway;

printf("How many Fibonacci numbers do you want to compute? ");


scanf("%d", &n);
if (n<=0)
printf("The number should be positive.\n");
else {
printf("\n\n\tI \t Fibonacci(I) \n\t=====================\n");
next = current = 1;
for (i=1; i<=n; i++) {
printf("\t%d \t %d\n", i, current);
twoaway = current+next;
current = next;
next = twoaway;
}
}
}

OUTPUT:
How many Fibonacci numbers do you want to compute? 9
I Fibonacci(I)
49

=====================
1 1
2 1
3 2
4 3
5 5
6 8
7 13
8 21
9 34
7. Write a program using function declarations, definitions.
#include <stdio.h>
void square1(void);
void square2(int i);
int square3(void);
int square4(int i);
int area(int b, int h);

/* Main program: Using the various functions */


int main (void) {
square1(); /* Calling the square1 function */
square2(7); /* Calling the square2 function using
7 as actual parameter corresponding to
the formal parameter i */

printf("The value of square3() is %d\n", square3());

DDE
printf("The value of square4(5) is %d\n", square4(5));
printf("The value of area(3,7) is %d\n", area(3,7));
}
/* Definitions of the functions */
/* Function that reads from standard input an integer and prints it out together
with its sum */

void square1(void){
int x;
printf("Please enter an integer > ");
scanf("%d", &x);
printf("The square of %d is %d\n", x, x*x);
}
/* Function that prints i together with its sum */
void square2(int i){
printf("The square of %d is %d\n", i, i*i);
}
/* Function that reads from standard input an integer and returns its square */
int square3(void){
int x;
50

printf("Please enter an integer > ");


scanf("%d", &x);
return (x*x);
}
/* Function that returns the square of i */
int square4(int i){
return (i*i);
}
/* Function that returns the area of the rectangle with base b and hight h */
int area(int b, int h){
return (b*h);
}
OUTPUT:
Please enter an integer > 3
The square of 3 is 9
The square of 7 is 49
Please enter an integer > 4
The value of square3() is 16
The value of square4(5) is 25
The value of area(3,7) is 21

8. Write a program to display the reverse number.


#include <stdio.h>
main()
{

DDE
int n,reverse;
clrscr();
printf("Enter any positive number");
scanf("%d",&n);
while (n!=0)
{
reverse=n%10;
printf("%d",reverse);
n=n/10;
}
getche();
}
9. Write a program on Operations on arrays to accessing array elements in different
ways.
#include <stdio.h>
#include <conio.h>
main()
{
int num[] = {24,34,12,44,56,17};
int i=0;
clrscr();
51

while (i < 6)
{
printf("\nAddress = %u %u", &num[i],num+i);
printf("\nElement = %d ", num[i]);
printf(" %d ", *(num+i));
printf(" %d ", *(i+ num));
printf(" %d ", i[num]);
printf(" %d\n", *(num + (i + 1)));
i++;
}
getch();
}
10. Write a program using Simple string operations:
String literals:
printf, scanf, %s, %c
strlen
strcpy
strcmp
#include <stdio.h>
#define MAXBUFF 128

int main(void) {
char c[] = "012345";
char line[MAXBUFF];
int lcv;
int cmp;

DDE
printf("sizeof(c)= %d\n", sizeof(c));
printf("sizeof(line)= %d\n", sizeof(line));

for (lcv=0; lcv<=strlen(c); lcv++)


printf("c[lcv]= %d = %c\n",c[lcv],c[lcv]);
printf("Please enter a string : ");
scanf("%s",line);
printf("strlen(line) = %d\n", strlen(line));
printf("line = [%s]\n",line);
cmp = strcmp(c,line);

if(cmp<0)
printf("%s is less than %s\n", c, line);
else if (c==0)
printf("%s is equal to %s\n", c, line);
else
printf("%s is greater than %s\n", c, line);
strcpy(line,c); /*copy the string c into line */
cmp = strcmp(c,line);
52

if(cmp<0)
printf("%s is less than %s\n", c, line);
else if (cmp==0)
printf("%s is equal to %s\n", c, line);
else
printf("%s is greater than %s\n", c, line);
}

OUTPUT:
sizeof(c)= 7
sizeof(line)= 128
c[lcv]= 48 = 0
c[lcv]= 49 = 1
c[lcv]= 50 = 2
c[lcv]= 51 = 3
c[lcv]= 52 = 4
c[lcv]= 53 = 5
c[lcv]= 0 =
Please enter a string: roses are red
strlen(line) = 5
line = [roses]
012345 is less than roses
012345 is equal to 012345

11. Write a program to find weather the given string is PALINDROM or Not.

DDE
#include<stdio.h>
#include<string.h>
#include"youdei.h"
main()
{
char string[100];
int i,len,check;
frontend("PROGRAM TO FIND WHETHER A STRING IS
PALINDROME");
printf("Enter a string =>");
scanf("%[^\n]",string);
len=strlen(string)-1;

for(i=0;i<=len/2+1;i++)

if (string[i]==string[(len-i)]) check=1;
else
{
check=0;
i=len;
}
53

if (check==1)
printf("\n%s is a palindrome",string);
else
printf("%s is not a palindrome",string);
getche();
}

12. Write a program to illustration of pointer to pointer to pointer.


#include <stdio.h>
main()
{
int i;
int *j;
int **k;
int ***l;
int ****m;
clrscr();
j = &i;k=&j;l=&k;m=&l;
printf("Address of i = %u %u %u %u %u \n", &i,j,*k,**l,***m);
printf("Address of j = %u %u %u %u \n", &j,k,*l,**m);
printf("Address of k = %u %u %u \n", &k,l,*m);
printf("Address of l = %u %u \n", &l,m);
printf("Address of m = %u \n", &m);
i = 100;
printf("Contents of i = %d %d %d %d %d %d \n",i,*(&i),*j,**k,***l,****m);
printf("Contents of j = %u %u %u %u %u %u \n",&i,j,*(&j),*k,**l,***m);

DDE
printf("Contents of k = %u %u %u %u %u \n",&j,k,*(&k),*l,**m);
printf("Contents of l = %u %u %u %u \n",&k,l,*(&l),*m);
printf("Contents of m = %u %u %u \n",&l,m,*(&m));
*j = 200;
printf("Contents of i = %d %d %d %d %d %d\n",i,*(&i),*j,**k,***l,****m);
**k = 300;
printf("Contents of i = %d %d %d %d %d %d\n",i,*(&i),*j,**k,***l,****m);
***l = 400;
printf("Contents of i = %d %d %d %d %d %d \n",i,*(&i),*j,**k,***l,****m);
****m = 500;
printf("Contents of i = %d %d %d %d %d %d\n",i,*(&i),*j,**k,***l,****m);
getch();
}

13. Write a program Illustration of function with pointer arguments


#include <stdio.h>
#include <conio.h>

main()
{
54

int i1 = -5,i2 = 66,*p1 = &i1,*p2=&i2;


clrscr();
printf("i1 and i2 before call to function test :\n i1 = %d i2 = %d
\n\n",i1,i2);
exchange(p1,p2);
printf("i1 and i2 after call to 1st exchange :\n i1
= %d i2 = %d \n", i1,i2);
exchange(*p1,*p2);
printf("i and j after call to 2nd exchange :\n i1 =
%d i2 = %d \n", i1,i2);
getch();
}
exchange(ptr1,ptr2)
int *ptr1,*ptr2;
{
int tmp;
tmp = *ptr1;
*ptr1 = *ptr2;
*ptr2 = tmp;
}

DDE
55

C++ Programming
DDE
56

C++ Lab Manual


1. Write a simple program that prints a string on the screen.
Solution
#include<iostream.h>
#include<conio.h>
main ()
{
cout << "Welcome to C++ lab Exercise";
getch();
}

2. Write a program to find the average of two numbers.


Solution
#include<iostream.h>
#include<conio.h>
main ()
{
float num1, num2, sum, avg;
cout << "Enter two numbers :";
cin >> num1;
cin >> num2;
sum = num1+num2;
avg=sum/2;
cout << "Sum = " << sum << "\n";

DDE
cout << "Average = " << avg << "\n";
getch();
}

3. Write a program to get the Name, Age, address, phone number from the user and
display them by using the class function.
Solution
#include<iostream.h>
#include<conio.h>
class sample
{
char name[30];
int age;
char add[30];
int phone;
public :
void getdata(void);
void display(void);
};
void sample :: getdata(void)
{
57

cout << " Enter your Name : " ;


cin >> name;
cout << " Enter your Age :";
cin >> age;
cout << " Enter your Address :";
cin >> add;
cout << " Enter your Phone Number :";
cin >> phone;
}
void sample :: display(void)
{
cout << "\n Name : " << name;
cout << "\n Age : " << age;
cout << "\n Address : " << add;
cout << "\n Phone Number : " << phone;
}
void main()
{
sample s;
s.getdata();
s.display();
getch();
}

4. What is the output of the following code?

DDE
Solution
#include<iostream.h>
#include<conio.h>
int a=10;
void main()
{
int a=15;
cout<<a<<::a<<endl;
::a=20;
cout<<a<<::a;
getch();
}
5. Write a program to get the input from the user and display the out what he\she has
entered.
58

Solution
#include<iostream.h>
#include<conio.h>
void main(void)
{
char a[999];
cout << "Type something :" << endl;
cin >> a;
cout << "You have typed :" << a << endl;
getch();
}

6. What is the output of the following code?


Solution
#include<iostream.h>
#include<conio.h>
void main()
{
int a=5,x;
int b=6;
x=++a+b++;
cout<<x<<a<<b;
getch();
}
7. Write a program to convert the alphabet from lower case to uppercase.

DDE
Solution
#include<iostream.h>
#include<ctype.h>
#include<conio.h>
void main(void)
{
char mydata=’a’;
char s=toupper(mydata);
cout<<”Mydata in ASCII is :”<<s<<”.”<<endl;
getch();
}

8. What is the output of the following code?


Solution
#include<iostream.h>
#include<conio.h>
class c
{
volatile x;
public:
void show()
59

{
x=9.899;
cout<<x;
}
};

void main()
{
c c1;
c1.show();
getch();
}

9. Write a program to input a text string and count the length of it using get() and
put().
Solution
#include<iostream.h>
#include<conio.h>
main()
{
int count = 0;
char c;
cout<< "Input text\n";
cin.get(c);
while(c != '\n')

DDE
{
cout.put(c);
count ++;
cin.get(c);
}
cout <<"\nNumber of characters = "<< count << "\n";
getch( );
}
10. Write a program to multiply numbers by taking assigned default values (First assign
default values 3 and 10 and then substitute 3 with 4 and 10 and then substitute 4&10
with 4 and 5).
Solution
#include<iostream.h>
#include<conio.h>
int multiply ( int x=3, int y=10);
void main(void)
{
int iresult;
iresult = multiply();
cout << "\n When using multiply ( ) : iresult="<< iresult << endl;
iresult = multiply( 4 );
60

cout << "\n When using multiply (4 ) : iresult="<< iresult << endl;
iresult = multiply( 4, 5 );
cout << "\n When using multiply (4 5 ) : iresult="<< iresult << endl;
getch( );
}
int multiply ( int x, int y)
{
return x*y;
}

11. Find the error in the program and explain it.


Solution
#include <iostream.h>
void main()
{
for (int i=1; i<3; i++)
{
int j=3;
cout << i;
}
cout<<i;
cout<<j;
}

When you execute the program you get an error j is not declared. But you have declared
j. The problem is that you have declared the variable j with in the for( ) loop. Thus the

DDE
scope is only in between the braces({}) of the for () loop. Declare the j variable outside
the for() loop as you have declared the i variable.

12. Write a program to display two variables by declaring them as local and global
variables and show the result has follows.
Solution
#include<iostream.h>
#include<conio.h>
int a=200;
void main (void)
{
cout<<"\n Results :";
cout<<"\n ----------";
int a =100;
cout<<"\n Local variable is :"<<a;

cout<<"\n global variable is :"<< a<<endl;


}
61

13. Find if any error exists and correct the parameter list.
Solution
Int showit ( int s);
Float showit ( int s);

Since there cannot be two identical list of Parameters even if the returned values
is different. So we can change the parameter list as follows.

Int showit ( int s, int t);


Int showit ( int s);

14. Write a program to find the inverse of a number.


Solution
#include<iostream.h>
#include<conio.h>
void main()
{
float a;
char b;
do
{
cout<<"Enter a number:";
cin>>a;
if(a= =0)
break;
cout<<"Inverse of the number is :"<<1/a;
cin>>b;
}while(b!='n');
getch( );
}
DDE
15. Write a program to find the square of the numbers less than 100.
Solution
#include<iostream.h>
#include<conio.h>
void main()
{
int a;
char b='y';
do
{
cout<<"Enter a number :";
cin>>a;
if(a>100)
{
cout<<"The number is greater than 100, enter another number :"<<endl;
62

continue;
}
cout<<"The square of the numbers is :"<<a*a<<endl;
cout<<"Do you want to enter another (y/n)";
cin>>b;
}while(b!='n');
getch( );
}

16. Find the output of the following statements.


Solution
#include<iostream.h>
#include<conio.h>
void main()
{
int i;
for(i=0;i<10;i++);
cout<<i;
getch();
}

17. Find the output of the following program


Solution
#include<iostream.h>
#include<conio.h>
void main()
{
int a=12,b;
b=++a;
DDE
cout<<"a ="<<a<<"b="<<b<<endl;
getch( );
}

17. Write a program to get the input from the user and check if the input value is "y"
or "n", if it is other than these values return a message " Invalid option". If it is
right choice return a message "Right choice".
Solution
#include<iostream.h>
#include<conio.h>
void main()
{
char a;
cout<<"Enter y or n";
cin>>a;
if(a = = 'y' | | a = = 'n' )
{
63

cout<<"Right choice";
}
else
{
cout<<"Invalid choice";
}
getch();
}

18. Write a program to convert temperature from farenheit to Celsius.


Solution
#include<iostream.h>
#include<conio.h>
void main()
{
float a;
cout<<"Enter the temperature in Farenheir:";
cin >>a;
float b=(a-32)*5/9;
cout<<"The equivalent temperature in Celsius is:"<<b<<endl;
getch( );
}

19. Write a program to input two numbers and find the largest of them using nesting
member function.

DDE
Solution
#include<iostream.h>
#include<conio.h>
class set
{
int m,n;
public:
void input(void);
void display(void);
int largest(void);
};
int set :: largest(void)
{
if(m>=n)
return (m);
else
return(n);
}
void set :: input(void)
{
64

cout<<"Input values of m and n" << "\n";


cin >> m >>n;
}
void set :: display(void)
{
cout<<"Largest value ="<< largest( ) << "\n";
}
main( )
{
set A;
A.input( );
A.display( );
getch( );
}
20. Write a program to calculate the square of the first ten natural numbers.
Solution
#include<iostream.h>
#include<conio.h>
void main()
{
int a;
for(a=1;a<=10;a++)
{
cout<<a*a<<" ";
}
getch( );

DDE
}
21. Write a program using function to add two numbers.
Solution
#include<iostream.h>
#include<conio.h>
int add(int,int);
void main()
{
int a,b,c;
cout<<"Enter two numbers:"<<endl;
cin>>b;
cin>>c;
a=add(b,c);
cout<<"The sum of the two numbers is :" <<a<<endl;
getch();
}
int add(int x, int y)
{
return x+y;
}
65

22. Write a program to accept two numbers and find the greatest number among
them.
Solution
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b;
cout<<"Input the first number:";
cin>>a;
cout<<"Input the second number:";
cin >>b;
if(a>b)
{
cout<<"a is greater than b" <<endl;
}
else
{
cout<<"b is greater than a" <<endl;
}
getch();
}

23. Write a program to find whether the input number is an even or odd number.
Solution
#include<iostream.h>
#include<conio.h>
void main()
{
int a;
DDE
cout<<"Enter a number:";
cin>>a;
if((a!=0)&&((a%2) = = 0))
{
cout<<"Even number";
}
else
{
cout<<"Odd number or the number is Zero";
}
getch();
}

24. Write a program to accept strings into a two-dimensional array and display them
(User can enter five strings).
66

Solution
#include<iostream.h>
#include<conio.h>
void main()
{
char name[5][21];
int i;
for(i=0; i<5; i++)
{
cout<<"Enter Name "<<(i+1)<<" : ";
cin>>name[i];
}
for (i=0; i<5; i++)
{
cout<<"Name"<<(i+1)<<" is : "<<name[i]<<endl;
}
getch();
}

25. Write a program that calculates the sum of two or three numbers.
(The first two numbers are 25 35 and the second set of numbers 12 13 45)
Solution
#include<iostream.h>
#include<conio.h>
int add(int, int);
int add(int, int, int);
void main()
{
DDE
cout<<"Sum of two Numbers is : " << add(25,35)<<endl;
cout<<"Sum of three Numbers is : " << add(12,13,45)<<endl;
getch();
}
int add(int a, int b)
{
return a+b;
}
int add( int a, int b, int c)
{
return a+b+c;
}

26. Write a program to print hi followed by the name of the user entered at the
command line.
Solution
#include<iostream.h>
#include<conio.h>
67

void main ( int argc, char *argv[])


{
if (argc!=2)
{
cout<<" You have not typed your name"<<endl;
}
else
{
cout<<" Hi "<<argv[1]<<endl;
}
getch();
}

27. Write a program to input three students Name and Age and display them.
Solution
#include<iostream.h>
#include<conio.h>
class student
{
char name[30];
float age;
public:
void getdata(void);
void putdata(void);
};
void student :: getdata(void)
{
DDE
cout << "Enter Name :";
cin >> name;
cout << "Enter Age:";
cin >> age;
}
void student :: putdata(void)
{
cout << "Name :" << name << "\n";
cout << "Age :" << age << "\n";
}
const int size = 3;
main()
{
student info[3];
for(int i=0; i<size; i++)
{
cout<<"\nDetails of Students" << (i+1) << "\n";
info[i].getdata();
}
68

cout << "\n";


for (int i=0; i< size; i++)
{
cout <<"\nStudent"<< (i+1) << "\n";
info[i].putdata();
}
getch();
}

28. Write a program to find the mean of two numbers (25,40) using the friend
function.
Solution
#include<iostream.h>
#include<conio.h>
class sample
{
int a;
int b;
public:
void setvalue ( ) { a = 25; b =40; }
friend float mean(sample s);
};

float mean(sample s)
{
return float(s.a + s.b)/2.0;
}

main()
{
DDE
sample x;
x.setvalue();
cout << "Mean value = " << mean(x) << "\n";
getch();
}

29. Write a program to display Roll number and marks of Tamil and English subjects
and the total marks scored, using multilevel inheritance.
Solution
#include<iostream.h>
#include<conio.h>
class student
{
protected:
int roll_number;
public:
69

void get_number(int);
void put_number(void);
};
void student :: get_number(int a)
{
roll_number =a;
}
void student :: put_number()
{
cout << "Roll Number :" << roll_number << "\n";
}
class test : public student
{
protected:
float tamil;
float english;
public:
void get_marks(float, float);
void put_marks(void);
};
void test :: get_marks(float x, float y)
{
tamil = x; english=y;
}
void test :: put_marks()
{

DDE
cout<<"Marks scored in Tamil = " <<tamil << "\n";
cout<<"Marks scored in English = " <<english << "\n";
}
class result : public test
{
float total;
public:
void display(void);
};
void result :: display(void)
{
total = tamil+english;
put_number();
put_marks();
cout<<"Total = " << total << "\n";
}
main()
{
result student1;
student1.get_number(222);
student1.get_marks(90.0, 90.0);
70

student1.display();
getch();
}
Do it yourself: -
1. Write a program to input city names and ask a question from the user whether he
wants to add more cities.
2. Write a program to find the volume of a cube, cylinder, and rectangle. For the given
values (cube length = 10, cylinder radius =2.5 and height = 8, rectangle length = 100,
breath = 75 and height = 15).
3. Write a program to perform the following, a vendor wants to place an order with a
dealer to purchase provision items, by providing the following details such as the
code number and price of each item. The user has to perform adding an item to the
list deleting an item from the list and printing the total value of the order.
The output of the screen should be as follows (ask the option from the user)
You can do the following : Enter appropriate number
1. Add an item
2. Display total value
3. Delete an item
4. Display all items
5. Quit
4. Write a program to construct a matrix of size m x n.
5. Write a program to swap the input numbers.
6. Write a program to accept the invoice number and rate of an item from the user

DDE
and display “ The amount for the Invoice no (Invoice no) is amount.
7. Write a program to find who is the elder person from the given data and display
their name and age as given in the output format.
Name Age
1. vijay 27
2. sundar 28
3. saro 32
Output format
Elder person is
Name :
Age:

137E170
ANNAMALAI UNIVERSITY PRESS 2019– 20

You might also like