Annamalai University: Bachelor of Computer Applications
Annamalai University: Bachelor of Computer Applications
Annamalai University: Bachelor of Computer Applications
137E170
LAB - I
ANNAMALAI UNIVERSITY
DIRECTORATE OF DISTANCE EDUCATION
DDE
PROGRAMMING LAB – I
[C, C++ & MS-OFFICE]
Copyright Reserved
(For Private Circulation Only)
i
Table of Contents
Page No
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.
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.
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.
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
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
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.
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
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:
1.3. Insert another slide with the Bulleted List layout. Type the following text
under the title “Companies Profile”:
Circle
Cylinder
Rectangle
Exercise 2: -
2.1. Insert ClipArt in the slide, which has the title “Company Hierarchy”, and
drag it to center of the slide.
9
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.4. Move the Future Plans slide to the end of the presentation.
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
EmpNo Number
EName Text
Basic Number
DA Number
Deptno Number
10. Display all the Employee names and their department name.
11. Calculate the HRA (30% of basic) for all the Employee s.
15. Calculate the total salary (basic+DA) paid for each department.
17. Display the Average salary paid for all the Employees.
DDE
20. Delete the Employee whose number is 4.
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:
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
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.
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:
Exercise 4:
Solution 4.1.
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
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
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
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.
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.
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).
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
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:
Place the mouse pointer inside the Bevel. Click and drag the mouse on the slide to
draw the donut. Release the mouse key.
Place the mouse pointer inside the donut. Click and drag the mouse to draw the
can. Release the mouse.
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)
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
Exercise 3:
Solution 3.1
Move to the AUTO SHAPES slide
Choose InsertPictureFrom 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
Solution 3.3
Choose the AUTO SHAPES slide
Choose FileSave 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 ViewSlide 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.
DDE
Press the Delete key on the keyboard (OR) Choose Edit Delete Slide.
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 ShowSlide 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 ShowCustom 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.
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 FileSave 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 AutoShapesAction 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.
Save the Presentation and view the slide selecting Slide Show.
37
MS – ACCESS 2000
1.
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'
7. Select * from Emp where basic =(select Max (basic) from emp)
13. Select DeptName from Dept Where DeptNo Not In (Select DeptNo from
Emp)
22.
DDE
Delete from Emp Where Deptno=30
39
ADDITIONAL QUESTIONS
MS-OFFICE
Ms-word
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
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
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
Course
Courseid Number
CourseName Text
Stud
RollNo Number
Name Text
Courseid Number
Sex Text
DateOfBirth Date
Address Text
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
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);
}
DDE
printf("The factorial of %d is %d\n", current,
fact(current));
printf("Enter a positive integer [to terminate
enter non-positive] > ");
scanf("%d", ¤t);
}
}
/* 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 */
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);
}
int main(void) {
int n;
int i;
int current;
int next;
DDE
int 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);
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
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));
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();
}
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();
}
main()
{
54
DDE
55
C++ Programming
DDE
56
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
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();
}
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();
}
{
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;
}
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;
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.
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( );
}
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();
}
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
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
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
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