Sunteți pe pagina 1din 62

SRI VENKATESWARA COLLEGE OF ENGINEERING

SRIPERUMBUDUR
DEPARTMENT OF INFORMATION TECHNOLOGY
LAB MANUAL
GE2115 - COMPUTER PRACTICE LABORATORY - I
I SEMESTER
ANNA UNIVERSITY REGULATION 2008

Prepared by Approved by
Signature
Name Ms. P. Sharon Femi
Ms. L. Anita Elizabeth Dr .G.Sumathi
Designation Assistant Professor !D"#$
Date %&.'(.)'%' %&.'(.)'%'
%
TABLE OF CONTENTS
)
E*er+ise ,o E*er+ise ,ame
%
Word Processing
Do+ument +reation- $e*t manipulation .ith S+ientifi+
notations.
)
Word Processing
a. $able +reation- $able formatting and /onversion
b. $o +reate an advertisement in 0ord.
1
Word Processing
$o illustrate the +on+ept of mail merging and letter
preparation.
2
Word Processing
Dra.ing " flo. /hart
3
Spread sheet
/hart " Line- 45- 6ar and Pie.
7
Spread sheet
Formula " formula editor.
8
Spread sheet
#n+lusion of ob9e+t- Pi+ture and graphi+s- prote+ting the
do+ument and sheet. Auto Filtering
(
Spread sheet
Sorting and #mport : E*port features.
&
Data types, Expression Evaluation, Condition
Statements.
a. ;ound of an integer
b. <uadrati+ e=uation
+. Armstrong number
d. Palindrome ,umber
e. $o .rite a program for ele+tri+ity bill preparation.
f. $o .rite a simple menu driven +al+ulator program
using s.it+h statement
g. $o .rite a program to find the largest digit of a
number
h. $o .rite a program to print the sine and cosine
series.
i. $o .rite a program to generate prime numbers.
TABLE OF CONTENTS
1
E*er+ise ,o E*er+ise ,ame
%'
Arrays
a. Linear Sear+h
b. 6ubble sort
+. Matri* addition
d. $o .rite a program to perform Matri*
multipli+ation.
e. $o .rite a program to input a 1*1 Matri* and
display it .ith the sum of the ro.s and +olumns.
f. $o .rite a program to perform string
manipulation fun+tions li>e string +on+atenation-
+omparison- find the length and string +opy
.ithout using library fun+tions.
g. $o .rite a program to arrange names in
alphabeti+al order
%%
Structures and Unions
a. $o print the mar> sheet of n students using
stru+tures.
b. $o print the differen+e bet.een t.o dates using
stru+tures
$o print the employee payroll using unions.
%)
Functions
a. $o .rite a / program to +al+ulate the mean-
varian+e and standard deviation using fun+tions.
b. $o .rite a / program to perform se=uential and
binary sear+h using fun+tions
+. $o .rite a program to print the Fibona++i
series using re+ursion
d. $o +al+ulate the fa+torial of the given number
using re+ursion
Ex no: 1
DOCUMENT CREATION, TEXT MANIPULATION WITH SCIENTIFIC NOTATIONS
PART-A
Perform the follo.ing in MS"0ord
i. Create a new word document and type the following text:
A ;!6!$ #, $E !?SE
@/orre+tion. 5ou are in error. 5ou are miss informing your father. /orre+tion. $he .or>
has not been done. 5our +omputer has not been used. E;;!;- E;;!;A. $he robotBs
voi+e .as metalli+.
$A;?,C 5ou are so lu+>y AdytaD Man>u +an do so many things. #t +an +lean the house.
#t +an ans.er the telephone- +all the do+tor and it +an even open the door.
AD#$#C 0aitD $here are so many things it +anBt do. #t +anBt laugh. #t +anBt do M5
!ME0!;E F!; ME. #t +anBt even help me de+ide .hat should # .ear for the party.
ii. Save the document as DOCUMENT.DOC
Go to file menu .ith +ursor- sele+t option @saveB- then type @do+ument.do+B then
+li+> save.
$he do+ument is saved under that name
iii. Insert the following text before the conversation between Aditi and Tarun
F!hD Stop interrupting- Man>uA. Aditi said angrily. F5ouBre are not supposed to
parti+ipate in every +onversationA
/li+> the +ursor in bet.een the +onversion
/li+> enter and type the paragraph given
iv. Make the story heading bold, italic and 14 pts.
Mar> the heading .ith +ursor and then +li+> on the bold- itali+ and the letter size
i+ons.
v. Change the font style of entire story to MS-Comic Sans
/li+> on the font i+on and +li+> on ms +omi+ sans. $he +hange is made.
2
vi. Select the heading of the document, cut and paste it at the end of the
document
Sele+t the heading and +li+> the right button of +ursor and +hoose +ut
Move the +ursor to the end of the do+ument- again +li+> the right >ey and +li+>
past.
vii. Undo the previous action
Sele+t the headingG press the right button mouse- +li+> +ut.
Move +ursor to the top of the do+ument and +li+> paste.
viii. Select the first two lines of the paragraph and convert it to uppercase
Sele+t lines .ith +ursor- then go to format
/li+> +hange +ase and +hoose upper +ase
ix. Change all the uppercase letters to lowercase and vice-versa
Sele+t all the upper+ase- goto format +hoose +hange +ase to lo.er +ase and vi+e
versa
x. Change the font style of the last paragraph 12 pts bold italic
Sele+t the last para and +li+> on the %) size and itali+ i+on
xi. Copy this format to the first paragraph using format painter
Sele+t the para and +li+> on format painter i+on
xii. Highlight the second paragraph (Hint: use highlighter or formatting toolbar)
Sele+t )
nd
para and +li+> on the hightlight i+on
xiii. Change the font size of the entire text to 14 pts
Sele+t the .hole te*t and +li+> on the size i+on to %2 pt
xiv. Make a copy of this document with a different name (MYBOOK.DOC)
Sele+t file from main menu and +li+> on @save asB and types the name- the
do+ument is +opied.
xv. Select the second paragraph of DOCUMENT.DOC and delete it
Sele+t the para- +li+> on the left >ey of the +ursor then delete
3
xvi. Undo the above action and see the effect
/li+> on undo- the se+ond para appears
xvii. Redo the above action and see the effect
/li+> on redo- the se+ond para disappears.
xviii. Delete the entire document (DOCUMENT.DOC)
Sele+t file from main menu. /li+> on do+ument.do+ and +li+> delete.
xix. Open the document MYBOOK.DOC
/li+> the open menu and +hoose myboo>.do+
xx. Show all the nonprinting characters in this document.
/li+> on FPA to sho. the non"printing +hara+ters.
PART-B
Open document MYBOOK.DOC and perform the following task.
i. Note down the default margins of MYBOOK.DOC
Sele+t format from main menu
/li+> on @ParagraphB.
A .indo. opens stating the margins
ii. Format the first paragraph with the following measurements:
Alignment: justified
Indentation: Left:0. 4, Right:0. 4
Special: First line by 0.5
Line spacing: 1.5 lines
Sele+t Format and then Paragraph- ma>e the re=uired +hanges spe+ified above
iii. In the end of MYBOOK.DOC type:
~MANKU IS A ROBOT NOT A HUMAN BEING.A
$he +ursor is brought do.n to the end of the do+ument and the senten+e is
typed.
Make 12 copies of the statement written above and apply all the text
Attributes
7
ighlight the statement- right +li+> the mouse button- sele+t +opy HorI sele+t +opy
from @editB
?sing paste option %) +opies are made
/hoose the @FontB option from format and give te*t attributes li>e style- +hange in
style et+.
iv. Using different tab stops type the following data in the next page of
MYBOOK.DOC
APEX POLYMERS
S.,o EmpJ Employee ,ame Address Salary
% E''% Aditi 1%:&-Dr.Mu>her9ee ,agar 2'''
) E'') 6harti %)&)- Ka.ahar /olony 1'''
1 E''1 Pradeep %&:%)-Dr.Mu>her9ee ,agar 1'3'
2 E''2 Arora A"&%-Ka.ahar /olony ('''
3 E''3 ,arula 71:)-Patel ,agar 2'''
7 E''7 Eaur 8):&-!utram Lines )'3'
8 E''8 Savita %&:AL- Dr.Mu>her9ee ,agar 1'3'
( E''( Gaurav A7:)%)-Pan+ha>ula 783'
& E''& Avneet %'%:67-!uterm lines 3'''
%' E'%' Eriti )(:)))-,iran>ari /olony 2'''
Sele+t format from main menu and +hoose tabs after going to the ne*t page using
the +ursor
Fill the option @$ab stop positionB to be set for ea+h heading and +li+> set and
then o>
So e=ual spa+ing .ill be given a++ording to the position filled
v. Give a border to the above written text
ighlight the .ritten te*t
Sele+t the border i+on from the format menu.
en+e border is formed
vi. Search for the word ROBOT and replace it with ROBOT machine`
Sele+t Edit from menu and +hoose Find
A .indo. opens and fill the Find and ;epla+e options respe+tively
/li+> ;epla+e All
vii. Write the following text in the next page of the same document
(MYBOOK.DOC)
8
Sele+t $oolbasr from Mie. N +li+> on Dra.ing
#+ons appear at bottom. Sele+t Autoshapes and then /allouts
Sele+t the +loud shape and fill the senten+es inside
viii. Insert a page break before the conversation between Tarun and Aditi
Sele+t the line bet.een the +onversation
Sele+t brea> from insert menu
Sele+t page brea>- +li+> o>
ix. Open a new document and insert the table with the following data:
First Name Last Name Phone Address
Sangeeta Mali> 3)17&(8 1):(-Dr.Mu>her9ee ,agar
Preeti Ahu9a %238(&7 A"E:)7&-Shalimar 6agh
Meenu Eataria 1)'37)1 6"P:(%-6.P./olony
Mandeep Eaur 238&7(% )3:E&-!utram Lines
$eena Gulati %)38&17 S?")1-Dr.Mu>her9ee ,agar
Sele+t Dra. table from $able options and dra. a table in the do+ument
/hoose Split +ells from $able- fill in ;o.s and /olumns- fill in the data.
x. Save and close the document with address.doc
/li+> on Save i+on and give the name and then +li+> /lose in File menu
(
#f you +ry nobody .ill +ry .ith you but
#f you laugh everybody .ill laugh .ith
you.

S! AL0A5S LA?G
S! AL0A5S LA?G
xi. Again open the document MYBOOK.DOC and got the end of the
document in one step
/li+> the !pen menu- type the name- .hen do+ument appears- +li+> /trlOEnd
xii. Print preview the page containing the drawing features and use the zoom
feature to view this in different percentages.
Sele+t File N +hoose Print Previe.
$he pages appear in miniature
?se zoom lens to ma*imise
xiii. Use the auto correct feature of work to add short forms for:
#. AP Ape* Polymers
##. M N A Mi+>y N Asso+iates
###. 6PL 6ritish Petroleum Limited
#M. PA/E PA/E A+ademy of /omputer Edu+ation
M. #P #nformati+s Pra+ti+es
Sele+t $ools from main menu and +hoose Auto +orre+t
#n the .indo. fill ;epla+e option .ith the respe+tive .ord
xiv. Provide headers and footers in MYBOOK.DOC (headers should be
different for first page, even and odd pages). For first page give header
~A ROBOT IN THE HOUSE. For even page give header ~MY
DOCUMENT and right align it, for odd pages give header ~ODD
PAGE page and left align it. Also provide page numbers as footer
(centrally align)
Sele+t eader and Footer option from Mie.
/hoose Page Setup from the opened +olumn
Give spe+ifi+ headers to the spe+ifi+ page- for alignment use the i+on in des>top
For footers +hoose page no. #n the +olumn and fill it respe+tively
xv. Type in the following contents in the same document MYBOOK.DOC
A word processor (such as MS Word) is a computer program that enables
you to create, edit, print and save documents for future retrieval and
revision.
In case of typewriter, input and output are inseparable. It means,
whenever a key is depressed i.e., input is fed to machine, a character is
printed on the sheet i.e., and an output is generated. Thus, one is denied
the facility to shape the output separately. Even in the case of electronic
typewriters with memory, the storage capacity for text and facilities for
&
its manipulation are extremely limited. Facility for storing the input to
some external medium before producing the output provided an ideal
solution to this problem.
/onvert the above te*t in t.o"+olumn te*t.
Sele+t /olumns from Format in main menu and +li+> on ) +olumns.
xvi. Spell check your document an correct all the grammatical as well as
spelling mistakes
Sele+t $ools- +li+> Spellings and Grammer.
xvii. Close your document
Sele+t /lose from the File- do+ument is +losed
Part C
Edit the follo.ing do+uments
Sele+t #nsert menu and +li+> the ob9e+t
#n+lude the Formula Editor
Edit the above formulas
Save the do+ument
/lose the do+uments
%'
Ex no: 2a
Table creation, Table formatting and Conversion
i. !pen a ne. do+ument and insert a table .ith the follo.ing dataC
First ,ame Last ,ame Phone Address
Sangeeta Mali> 3)17&(8 1):(-Dr.Mu>her9ee ,agar
Preeti Ahu9a %238(&7 A"E:)7&-Shalimar 6agh
Meenu Eataria 1)'37)1 6"P:(%-6.P./olony
Mandeep Eaur 238&7(% )3:E&- !utram Lines
$eena Gulati %)38&17 S?")1-Dr.Mu>her9ee ,agar
Sele+t Start menu
Sele+t Programs option
Sele+t Microsoft Word from Programs Sub menu.
Sele+t New option from the File menu of MS 0ord 0indo..
!r /li+> on the ne. do+ument i+on found on the standard toolbar.
!n the Table menu- point to Insert- and then +li+> Table option.
$ype the number of ro.s and +olumns in the #nsert $able dialogue
bo*.
!r you +an use the Draw Table tool from Table menu to +reate a
table. First- dra. a line from one +orner of the table to the +orner
diagonally opposite in order to define the boundary of the entire table-
and then dra. the +olumn and ro. lines inside.
$ype the given data.
ii. Save the do+ument .ith address.do+
!n the File menu- sele+t Save option.
$ype the do+ument name as address.doc in Filename te*tbo*.
/li+> the Save button.
iii. Sele+t the first ;o. and 6old the $e*t.
Sele+t the te*t- .hi+h you .ant to ma>e as 6old- from the table by
dragging the mouse a+ross it.
/li+> on Bold button on Formatting tool bar.
!r use short+ut >eys CONTROL+B.
!r on the Format menu- sele+t Font option.
Sele+t Font Style as Bold in the Font tab.
/li+> OK button.
%%
iv. Align the te*t in the first ro. to F/enterA and align the te*t in the
remaining ro.s to FLeftA.
6lo+> the te*t in the first ro. of the table by dragging the mouse
a+ross it.
/li+> on Center button on the Formatting toolbar.
6lo+> the te*t in the remaining ro.s.
/li+> on Align Left button on the Formatting toolbar.
!r on the Format menu- sele+t Paragraph option.
Sele+t the options from the Alignment +ombo bo* in the Indents and
Spacing tab.
/li+> OK button.
v. #nsert a ,e. /olumn to the beginning of the table .ith the follo.ing data.
S.No
%
)
1
2
3
?se a mouse to pla+e the +ursor at the beginning +olumn of the table.
!n the Table menu- point to Insert- and then +li+> Columns to the
Left.
$ype the given data in the inserted +olumn.
vi. Add a ,e. ;o. to the End of the $able.
?se a mouse to pla+e the +ursor at the end ro. of the table.
!n the Table menu- point to Insert- and then +li+> Rows Below
option.
vii. #nsert a ,e. ;o. bet.een 1 and 2.
Pla+e the mouse +ursor at the 1
rd
ro. of the table.
!n the Table menu- point to Insert- and then +li+> Rows Below
option.
viii. #nsert a ,e. /olumn bet.een 2
th
and 3
th
/olumn.
Pla+e the mouse +ursor at the 2
th
+olumn of the table.
!n the Table menu- point to Insert- and then +li+> Columns to the
Right option.
i*. /hange the size of the se+ond +olumnBs .idth.
Pla+e the mouse +ursor on the +olumn of the table .here you .ant to
+hange.
!n the Table menu- point to Table properties- and then sele+t
Column tab.
Sele+t the re=uired .idth from the Preferred width +ombo bo*.
%)
/li+> OK button.
*. Sort the data a++ording to alphabeti+al order of FFirst ,ameA.
Sele+t the /olumn or +ells you .ant to sort.
!n the Table menu- +li+> Sort.
Sele+t the sort options you .ant.
/li+> Options.
Sele+t Column Only +he+> bo*.
/li+> OK button.
*i. Delete the third ro. and third /olumn from the table.
Pla+e the mouse +ursor on the 1
rd
ro..
!n the Table menu- point to Delete- and then sele+t Rows.
Pla+e the mouse +ursor on the 1
rd
/olumn.
!n the Table menu- point to Delete- and then sele+t Columns.
*ii. /reate a ne. ro. at the top of your table- merge the +ells- and add a title
to the table.
Pla+e the mouse +ursor on the first ro..
!n the Table menu- point to Insert- and then +li+> Rows above.
6lo+> that ro.- by dragging the mouse a+ross it.
!n the Table menu- +li+> Merge Cells.
$hen type the title of the table.
*iii. /onvert the given te*t into a table.
#tem /olor- Style-
6us 6lue- A&('-
Man ;ed- 4')1-
/ar Green- 5L8)2
Sele+t the te*t u .ant to +onvert- by dragging the mouse a+ross it.
!n the Table menu- point to Convert- and then +li+> Text to
Table.
?nder Separate text at- +li+> the option for the separator +hara+ter
you .ant and then +li+> OK.
*iv. Split the above table into t.o tables
Pla+e the mouse +ursor on the table .here you .ant to split it.
!n the Table menu- sele+t Split Table.
*v. Apply 6orders- Shading and /olor to the table.
%1
Sele+t the +ell- ro.s- or +olumns you .ant to add borders- shading
and +olor.
Either right +li+> .ithin your table and +hoose Table properties or
+li+> .ithin your table and go to Table on the menu bar and +hoose
Table properties.
$he Table properties dialog bo* .ill open.
/li+> on the Borders and Shading button.
/hoose the setting style- the +olor and the .idth that you .ant.
/li+> OK then ne. settings .ill be added to the table.
!r on the Table menu- +li+> Table AutoFormat.
#n the Formats bo*- +li+> the format you .ant.
$hen +li+> OK button.
*vi. Spell +he+> your do+ument and +orre+t all the grammati+al errors as
.ell as spelling mista>es.
!n the Tools menu- +li+> Spelling and Grammar Check option.
$he errors are sho.n in red +olour.
From the list of Suggestions +hoose one.
/li+> change or ignore.
/ontinue till all errors are re+tified.
*vii. Save the above do+ument as table.do+
Sele+t File menu.
Sele+t Save option.
$ype the do+ument name as Ftable.do+A in Filename te*tbo*
/li+> the Save button.
*viii. /lose your do+ument.
Sele+t File menu.
Sele+t Close option.
Sele+t Exit from File menu to =uit the appli+ation.
%2
Ex no: 2b
ADVERTISEMENT
A BRIGHT CAREER IN INFORMATION TECHNOLOGY
TREND REPORT: The Hybrid ModelSolution for Challenges in Managing an
Offshore Captive Center
Abstract
A re+ent survey +ondu+ted 9ointly by
!utsour+ing /enter and 0ipro
$e+hnologies indi+ates +ompanies still
have signifi+ant +hallenges in managing
their +aptive offshore +enters.
$he survey- .hi+h .as not a s+ientifi+
study- polled visitors at the !utsour+ing
/enter portal during May )''7. #t as>ed
/#!s and Global Sour+ing Managers to
+hoose .hi+h of the follo.ing four
fa+tors is their >ey +hallenge in
managing an offshore +aptive +enterC
P;apid s+alability of .or>for+e and
infrastru+ture .hile maintaining the +ost
advantage
PAligning the offshore team .ith your
organizationBs +ulture and business
imperatives
PLa+> of a long"term strategy or vision
for your +aptive offshore operation
PLa+> of ade=uate management
band.idth to effe+tively manage the
model
$his dis+usses the surveyBs findings as
.ell as some best pra+ti+es to +ombat the
+hallenges of a +aptive offshore +enter. #t
also dis+usses the trend of using a hybrid
modelQ part +aptive- part outsour+ingQ
as the solution for these +hallenges.
%3
$o +reate the advertisement in .ord.
!pen a ne. .ord do+ument.
$ype the heading and sele+t the font as $imes ,e. ;oman- font style as $itle +olor and
the font size as appropriate.
Sele+t #nsert "R Pi+ture "R /lipArt and sele+t the pi+ture.
Sele+t $ools "R /ustomize "R $oolbars "R Dra.ing and 0ord Art.
Sele+t any one 0ordArt Style and insert in the do+ument.
$ype the given arti+le and sele+t Format "R /olumns and sele+t t.o +olumns.
#nsert the given shapes by sele+ting Auto shapes from the Dra.ing $oolbar.
Apply border to the entire page by sele+ting Format "R 6orders and Shading.
Sele+t Mie. "R eader and Footer and add the ne+essary details.
Save the do+ument as advertisement.do+.
Ex no: 3
Mail merge and Letter preparation
i !pen a ne. do+ument and type the follo.ing letter.
Sep '%-)''(-
/hennai.
From
VENKATESH .P
Sri ;anga Apartments-
,oC %)'- ## Avenue-
$. ,agar.
/hennai"%8.

$o
Dear Sir:Madam-
0ith the +urrent slo. do.n in hiring .ithin the high" te+h field- you must be flooded .ith
resumes from out"pla+ed soft.are engineers su+h as myself. Please ta>e a moment to +onsider
my =ualifi+ations. # believe in parti+ular is highly mar>etable in this tight mar>etC

# .or>ed on the team that pioneered the te+hnology that put the PalmPilot on the map.
#n todayBs in+reasingly mobile so+iety- this te+hnology has pla+es to go- and # have ideas that
+ould ta>e us to the ne*t step in offi+e independen+e.
Please +all me .ith prospe+tive 9ob opportunities. # am interested in a pro9e+t management
position in the S&3E range.
$han> youD
Men>atesh. P
En+losureC ;esume.
Sele+t Start menu
Sele+t Programs option
Sele+t Microsoft Word from Programs Sub menu.
Sele+t New option from the File menu of MS 0ord 0indo..
ii. Save the do+ument as FLetter.do+.A
Sele+t File menu.
Sele+t Save option from File menu.
$ype the do+ument name as FLetter.do+A in Filename te*tbo*.
/li+> the Save button.
iii Send the do+ument to %' re+ipients using Mail merge.
H?se %' different addressesI
!n the Tools menu- sele+t Mail Merge option.
/li+> on Create and sele+t Form Letter.
/li+> on Active Window in the appearing dialogue bo*.
!n Data source menu- point to Get Data- then sele+t Create Data
Source.
/hoose the fields you .ish to in+lude in your data sour+e from a list of
default field names.
$o add a field name- type the name in the Field Name bo* and +li+> the
Add Field Name>> button. $o remove a field name- +li+> on the name to
highlight it and then +li+> on the Remove Field Name button.
/li+> the OK button
Save your mail merge data sour+e as a do+ument.
Sele+t Edit Data Source in the appearing dialogue bo*.
Enter the information for ea+h person in ea+h of the fields
After entering all of the desired re+ords- +li+> the OK button.
$o insert a merge field +li+> Insert Merge Field on the Mail Merge
toolbar. And you .ill need to insert any pun+tuation or spa+es in the field
layout.
$ype the given letter.
!n the Tools menu- +li+> the Merge +ommand on the Mail Merge option.
Sele+t New Do+ument from the Merge To: drop list.
/hoose All radio button to merge all re+ords.
$hen +li+> Merge button in the dialogue bo*.
$his .ill set all the form letters into a ne. do+ument- .hi+h you +an save
and:or print.
iv /lose the do+ument.
Sele+t File menu.
Sele+t Close option.
Sele+t Exit from File menu to =uit the appli+ation.
Ex no: 4
Drawing Flowcharts
1.Draw a flowchart to find the sum of first 50 natural numbers
).Dra. a flo.+hart to find the largest of three numbers A-6- and /.
1.Dra. a flo.+hart for +omputing fa+torial , H,DI 0here ,D T % 4 ) 4 1 UU , .
;ight +li+> on the tool bars
/li+> and in+lude the dra.ing tool bar
/li+> Auto shape
Sele+t flo. +hart
/li+> on the symbol .Drag on the do+ument. Add te*t
Flowchart
A flo.+hart illustrates the steps in a pro+ess. 6y visualizing the pro+ess- a flo.+hart +an =ui+>ly
help identify bottlene+>s or ineffi+ien+ies .here the pro+ess +an be streamlined or improved.
Alternate DefinitionC
$he flo.+hart is a means of visually presenting the flo. of data through an information
pro+essing systems- the operations performed .ithin the system and the se=uen+e in .hi+h they
are performed
MEANING OF A FLOWCHART
A flo.+hart is a diagrammati+ representation that illustrates the se=uen+e of operations to
be performed to get the solution of a problem.
Flo.+harts are generally dra.n in the early stages of formulating +omputer solutions.
Flo.+harts fa+ilitate +ommuni+ation bet.een programmers and business people.
$hese flo.+harts play a vital role in the programming of a problem and are =uite helpful
in understanding the logi+ of +ompli+ated and lengthy problems.
Basic Flowcharting Shapes
Flo.+harts use spe+ial shapes to represent different types of a+tions or steps in a pro+ess. Lines
and arro.s sho. the se=uen+e of the steps- and the relationships among them.
Guidelines in Flowcharting:
a. #n dra.ing a proper flo.+hart- all ne+essary re=uirements should be listed out in logi+al
order.
b. $he flo.+hart should be +lear- neat and easy to follo.. $here should not be any room for
ambiguity in understanding the flo.+hart.
+. $he usual dire+tion of the flo. of a pro+edure or system is from left to right or top to
bottom.
d. !nly one flo. line should +ome out from a pro+ess symbol.
H!;I
e. !nly one flo. line should enter a de+ision symbol- but t.o or three flo. lines- one for
ea+h possible ans.er- should leave the de+ision symbol.

f. !nly one flo. line is used in +on9un+tion .ith terminal symbol.

g. #f the flo.+hart be+omes +omple*- it is better to use +onne+tor symbols to redu+e the
number of flo. lines. Avoid the interse+tion of flo. lines if you .ant to ma>e it more
effe+tive and better .ay of +ommuni+ation.
h. Ensure that the flo.+hart has a logi+al start and finish.
i. #t is useful to test the validity of the flo.+hart by passing through it .ith a simple test
data.
ADVANTAGES OF USING FLOWCHARTS
%. /ommuni+ationC Flo.+harts are better .ay of +ommuni+ating the logi+ of a system to all
+on+erned.
). Effe+tive analysisC 0ith the help of flo.+hart- problem +an be analysed in more effe+tive
.ay.
1. Proper do+umentation are made
2. Effi+ient /oding are developed
3. Proper Debugging are made.
7. Effi+ient Program Maintenan+e is a+hieved.
LIMITATIONS OF USING FLOWCHARTS
%. /omple* logi+C Sometimes- the program logi+ is =uite +ompli+ated. #n that +ase-
flo.+hart be+omes +omple* and +lumsy.
). Alterations and Modifi+ationsC #f alterations are re=uired the flo.+hart may re=uire re"
dra.ing +ompletely.
E*ample of a 6asi+ Flo.+hartC
Exercises On Flowcharting:
%. Dra. a flo.+hart to find the sum of first 3' natural numbers.
). Dra. a flo.+hart to find the largest of three numbers A-6- and /.
1. Dra. a flo.+hart for +omputing fa+torial , H,DI
0here ,D T % V ) V 1 V UU , .
Ex no: 5
Charts- Line, XY, Bar and Pie.
Problem 1:
$ype the follo.ing dataC
Sales report for the first quarter 2004
A 6 / D E
% Vehicle 1an Feb Mar Total
) /ar )3' 1'' 1%'
1 Auto 32 &) )'
2 Keep &% %)' %%
3 Man %)3 %%& 8(
7 $otal
%. Ma>e sure that appropriate formulas are entered in +olumn E so that total sales of ea+h
vehi+le is sho.n properly. Similarly- in ro. 7 type +orre+t formulas so that total sales for
ea+h month is sho.n in respe+tive +olumns.
!pen a ne. .or>boo> .indo..
6uild the above table- starting from +ell A%.
$ype the Formula HT sum H6)CD) II in +ell E) to +al+ulate $otal.
Drag through the range HE) to E3I and then press enter >ey.
Similarly type the formula in +ell 67 and drag up to D7 to +al+ulate the total for every
month.
). Dra. a Pie /hart to sho. vehi+le .ise total sales made bet.een Kan and Mar )''2.
$otal sales of ea+h vehi+le must be sho.n as a se+tor.
Sele+t the data to be +harted.
/hoose Chart from the Insert menu or +li+> on the ChartWizard button.
Sele+t the +hart typeC Pie and +li+> on the Next button.
;ead the dialog bo*- ma>e sure the range is +orre+t and then +li+> the Next button.
Enter the Chart title, Category (x) axis, value (y) axis and +li+> on next button to
+ontinue.
/li+> on+e on the As object in radio button and spe+ify the ob9e+t name.
/li+> on the finish button and get the desired +hart on the .or>boo>.
Pie chart
48%
10%
18%
24%
Car
Auto
Jeep
Van
1. Dra. a bar graph:+olumn +hart to sho. sale of vehi+les for ea+h month.
ighlight the data to be +harted.
/hoose Chart from the Insert menu.
/hoose the +hart typeC Column and then sele+t the desired +hart sub"type from the
samples on display. +li+> on the Next button.
#n the dialog bo*- the default radio button for Columns .ould be sele+ted. #f the
range is +orre+t- +li+> on the Next button.
Sele+t titles tab from the dialog bo* and enter the Chart title, Category (x) axis,
value (y) axis.
/li+> on the legend folio and sele+t the desired pla+ement .here the legends should
be displayed ./li+> on the next button
/li+> on+e on the As object in radio button and spe+ify the ob9e+t name.
/li+> on the finish button and get the desired +hart on the .or>boo>.
column chart
0
500
1000
Car Auto Jeep Van Total
vehicles
t
o
t
a
l
Series1
Series2
Series3
Series4

2. Dra. a sta+>ed bar graph to sho. the sale of ea+h vehi+le in +omparison .ith the total
sales for the month.
ighlight the data to be +harted.
/hoose Chart from the Insert menu.
/hoose the +hart typeC Bar and then sele+t the desired +hart sub"type from the
samples on display. +li+> on the Next button.
#n the dialog bo*- the default radio button for Columns .ould be sele+ted. #f the
range is +orre+t- +li+> on the Next button.
Sele+t titles tab from the dialog bo* and enter the Chart title, Category (x) axis,
value (y) axis.
/li+> on the legend folio and sele+t the desired pla+ement .here the legends should
be displayed ./li+> on next button.
/li+> on+e on the As object in radio button and spe+ify the ob9e+t name.
/li+> on the finish button and get the desired +hart on the .or>boo>.
Stacked Bar graph
0 500 1000 1500 2000
Car
Jeep
Total

e
h
i
c
l
e
s
!otal
Series1
Series2
Series3
3. Dra. a Line graph to sho. the sales trend over the first =uarter of the year )''2.
ighlight the data to be +harted.
/hoose Chart from the Insert menu.
/hoose the +hart typeC Line and then sele+t the desired +hart sub"type from the
samples on display. +li+> on the Next button.
#n the dialog bo*- if the range is +orre+t- +li+> on the Next button.
Sele+t titles tab from the dialog bo* and enter the Chart title, Category (x) axis,
value (y) axis.
/li+> on the legend tab and sele+t the desired pla+ement .here the legends should be
displayed ./li+> on next button.
/li+> on+e on the As object in radio button and spe+ify the ob9e+t name.
/li+> on the finish button and get the desired +hart on the .or>boo>.
"ine #hart
0
500
1000
1 2 3 4
months
!
o
t
a
l
Car
Auto
Jeep
Van
Total
7. $ype the follo.ing data in +olumn F
F
% Cost
) )'''''
1 8'''''
2 &'''''
3 %''''''
Dra. an 45 W graph +omparing t.o numeri+al variables viz.- +ost of the vehi+le and
sale of the vehi+le.
Enter the above data to the .or>sheet .
Sele+t the total and cost +olumns from the .or>sheet.
/hoose Chart from the Insert menu.
/hoose the +hart typeC xy(scatter) and then sele+t the desired +hart sub"type from the
samples on display. +li+> on the Next button.
#n the dialog bo*- if the data range is +orre+t- +li+> on the Next button.
Sele+t titles tab from the dialog bo* and enter the Chart title, Category (x) axis,
value (y) axis.
/li+> on the legend tab and sele+t the desired pla+ement .here the legends should be
displayed ./li+> on next button.
/li+> on+e on the As object in radio button and spe+ify the ob9e+t name.
/li+> on the finish button and get the desired +hart on the .or>boo>.
$% chart
0
500000
1000000
1500000
0 500 1000
!otal
#
o
s
t
Series1
Problem 2:
/reate title for the graph as @Sales ;eport for the first =uarter W )''2B
%. /reate legends for all the data ranges in the graphs:+harts dra.n in problem %.
/li+> on the +hart to .hi+h- you .ish to apply legend .
/hoose chart options from the chart menu or right"+li+> the +hart to sele+t chart
options
Sele+t the titles tab from the dialog bo* and give the chart title as spe+ified above.
Sele+t the legends tab from the same dialog bo* and +he+> the show legend option .
+hoose the desired placement .here the legends should be displayed on the +hart.
Sample chart with legends
"ine chart
0
500
1000
Car Auto Jeep Van Total
vehicles
t
o
t
a
l
Series1 Series2 Series3 Series4
). Display horizontal verti+al grids.
/li+> on the +hart to .hi+h- you .ish to apply gridlines .
/hoose chart options from the chart menu or right"+li+> the +hart to sele+t chart
options
Sele+t the gridlines tab from the dialog bo* and +he+> the ma9or and minor gridlines
option for * and y"a*is.
$hen press o> button to dra. gridlines on the +hart
Sample chart with Gridlines
Stacked Bar graph
0 500 1000 1500 2000
Car
Jeep
Total

e
h
i
c
l
e
s
!otal
Series1
Series2
Series3
Problem 3:
0rite ma+ros for the follo.ingC
%. $o auto fill a range viz.- A%../3 .ith values starting from %- in+reasing in steps of 3.
). $o dra. graphs automati+ally for the problem given in problem %.
ighlight the data to be +harted.
Press F11 >ey to dra. the graph automati+ally.
Ex no: &
Formula - Formula editor
PROBLEM 1:
GL!6AL S!F$ /ompany >eeps the employeesB payroll data in a .or>sheet as sho.n belo..
A 6 / D E
% GLOBAL SOFT COMPANY
) Emp No. Name Salary
1 % Meena )23''
2 ) Mishal %'3''
3 1 Elisa %28&'
7 2 ;i+ha %2'''
8 3 S.etha %3)3'
( 7 Dravid %7'''
& 8 Sourav %2%''
%'

iI Enter the above data in a .or>sheet and save the .or>boo> as EMPL!5EE.4LS
/hoose New from the File menu.
Starting from +ell A%- build the above table.
/hoose Save from the File menu or +li+> on the Save button.
#n the dialog bo*- spe+ify file name as EMPL!5EE.4LS.
iiI /al+ulate ;A- DA- PF and ,et salary for ea+h employee.
;A " )'X of basi+ salary
DA " )(X of basi+ salary
PF " %'X of basi+ salary
a. $ype ;A- DA- PF- ,et salary in +ells D)- E)- F) N G).
b. Enter the formula HT/1Y)':%''I in +ell D1 to +al+ulate ;A.
+. Drag through the range you .ant and then press enter.
d. Similarly +al+ulate DA- PF- ,et salary for ea+h employee.
iiiI Save the .or>boo> again.
a. /li+> on the save button.
PROBLEM 2:
$he industan departmental store has organized an !ff Season sale. $he details of the items on
sale and the per+entage of dis+ount offered are entered in a .or>boo> as sho.n belo..
A 6 / D E
%
HINDUSTAN DEPARTMENTAL STORE
) Item Name Original Price Discount
()
Selling
Price
1 Ponds &( %'
2 Mi++o (( (
3 La>mi %') &
7 Fare* 1'' %)
8 Denim 3'' %3
( 6ioti= 2'' %'
&
iI Enter the given data in a .or>boo> and save the .or>boo> as #,D?S$A,.4LS
/hoose New from the File menu.
Starting from +ell A%- build the above table.
/hoose Save from the File menu or +li+> on the Save button.
#n the dialog bo*- spe+ify file name as industan.*ls.
iiI /al+ulate the Selling Pri+e of ea+h item and display in +olumn D of the sheet.
Formula to +al+ulate the selling pri+e of an itemC
Selling pri+e T original pri+e W HHdis+ount:%''IY original pri+eI
b. Enter the given formula in +ell D1 to +al+ulate selling pri+e.
+. Drag through the range you .ant and then press enter.
iiiI Save and +lose the .or>boo>.
d. /li+> on the save button to save your .or>boo>.
e. /hoose Exit option from the file menu to +lose the .or>boo>
PROBLEM 3:
/reate an E4/EL sheet .ith +onsumer number- name- type H : /I- previous reading- +urrent
reading- +hargeable unit- and +ost per unit and +al+ulate the total amount to be paid using the
follo.ing +ondition.

Starting from +ell A%- build the table .ith +onsumer number- name- type H : /I-
previous reading HP;I- and +urrent reading H/;I.
/al+ulate +hargeable units H/?I using the formula /?T /;"P;
/al+ulate the /ost:?nit using the above table by .riting the formula using #F and
A,D +onditions in the formula bar.
/al+ulate the amount as the produ+t of /? and /ost:?nit.
PROBLEM 5:
/reate $ransport reservation sheet .ith follo.ing des+ription.
Passenger ,ame Hnot to e*+eed )' +hara+tersI .ith intera+tive display and a re=uest to enter
the name !ptions for gender Male:Female Seat no- +lassC %st- )nd- 1rd sele+t as re=uired.
Amount %st +lass W ;s.3''- )nd +lass W ;s.2''- 1rd +lass W ;s.)''
Starting from +ell A%- build the table. $o give intera+tive display and a re=uest to enter error
message- sele+t Data "R Malidation and give the +orresponding settings.
Display the amount using the formula bar
PROBLEM 6:
/reate an ele+troni+ spreadsheet for in+ome ta* +al+ulation by entering name- gross salary and
savings
?pto %.3 la+s """""" ,#L
%.3 W 1 la+s """"""" %'X
1 W 3 la+s """"""" )'X
3 W)3 la+s """"""" 1'X /al+ulate the ta*able amount and ta* for individual person.
Starting from +ell A%- build the table .ith name- gross salary and savings. Find the ta*able
amount
/al+ulate the ta* using the above +onditions in the formula bar.
Ex no: '
SP;EAD SEE$"#,/L?S#!, !F !6KE/$S- P#/$?;ES A,D G;AP#/S-
P;!$E/$#,G $E D!/?ME,$ A,D SEE$- A?$!F#L$E;#,G
Steps for Inclusion of Objects
Sele+t the Object option from the Insert menu.
#n the dialogue bo* Create New and Create from file tabs are displayed.
Sele+t Create New and object type for in+luding a ne. ob9e+t in the sheet.
Sele+t Create from file and browse the file for in+luding an e*isting ob9e+t to the sheet.
Steps for inserting pictures and Graphics
Sele+t the Clip art option from Picture sub"menu of the Insert menu.
From the dialogue bo* displayed +li+> on the graphi+ sele+ted by you and +li+> on the
Insert Clip to add the image to the .or>sheet.
Preview Clip to vie. the image full"size before adding it to the .or>sheet Drag the
bottom- right +orner of the previe. .indo. to resize the image and +li+> the ZxZ +lose
button to end the previe.
Add Clip to Favorites .ill add the sele+ted image to your favorites dire+tory that +an be
+hosen from the Insert ClipArt dialog bo*.
Find Similar Clips .ill retrieve images similar to the one you have +hosen.
/ontinue sele+ting images to add to the .or>sheet and +li+> the Close button in the top-
right +orner of the Insert ClipArt .indo. to stop adding +lip art to the .or>sheet
Steps For Protecting A Document
/hoose the protect sheet +ommand from the protection sub"menu of tools menu.
$ype password and +li+> on the ok button
;e enter the pass.ord to +onfirm that you have not made any mista>e and +li+> on the
OK button again.
Save and +lose the .or>sheet
Reopen the .or>boo> using the file open +ommand. ,o. if you try to edit the .or>boo>
one message bo* .ill appear informing you that sin+e the +ells are prote+ted you +anBt
modify them.
/li+> on the OK button to +lose this message bo*..

$o unprote+t the do+ument +hoose unprotect sheet +ommand from the Protection submenu
of Tools menu.
Steps for entering data using Form command
/hoose the form +ommand from the Data menu.
$ype the re=uired data in the fields
Problem:
/reate an E4/EL sheet for the student details in a +lass for grade +al+ulationC
HiI Passed in all sub9e+ts HiiI Avg [ &' grade is !- Avg [ (' grade is A- Avg [ 8' grade is 6-
Avg [ 7' grade is /- Avg [ 3' grade is D. Apply filtering options.
Starting from +ell A%- build the table .ith student number- name- mar>s for 1
sub9e+ts.
/he+> the result of the student and display it. /al+ulate the average
/al+ulate the grade using result and average in the formula bar.
Steps For Filtering options
Sele+t all the data fields in+luding the titles.
/hoose the Autofilter +ommand from the Filter sub"menu of Data menu.
$he fields +an no. be vie.ed +ustomizely.
Ex no: (
SORTING AND IMPORT/EXPORT FEATURES
Steps for Sorting data
$o e*e+ute a basi+ des+ending or as+ending sort based on one +olumn- highlight the +ells
that .ill be sorted .
/li+> the Sort Ascending HA"LI button or Sort Descending HL"AI button on the standard
toolbar.
/li+> on !E to e*e+ute the data sort +ommand.
Steps for Import Features
Sele+t #mport data option from Import External Data sub"menu of the Data menu.
Sele+t the data source from the dialogue bo* displayed.
/li+> on !E to import.
Steps for Export Features
/hoose Save as +ommand from the file menu
#n the dialog bo* opened +li+> on the +ombo list for the save as type option and sele+t the
format in .hi+h you .ish to save the +urrent file.
/li+> on the save button
E*+el .ould display a message bo* .hi+h .ill alert you that if you save the file in the ne.
spe+ified format some of the data and features of the +urrent file .ould be lost and only the
result of these formulas .ould be saved. /li+> on the Yes button if you are sure that you
need to save the file in the ne.ly spe+ified format.
Ex no: )a
*ound o++ an integer
Aim
$o round off an integer to the ne*t largest multiple of another integer.
Algorithm Description
%. #nput the value of the integer to round off and store in integer variable i. #nput the other
integer to .hose multiple has to be rounded off to and store in integer variable 9.
). ;ound off the value of i to the ne*t largest multiple of 9 and store the value in integer
variable > using the formula
k= i+j i(mod)j
1. Print the value of variable > onto the s+reen.
2. Stop.
Sample Output
ENTER THE INTEGER TO BE RONDED OFF: 256
ENTER THE ANOTHER INTEGER: 7
THE RONDED OFF INTEGER IS 259
ENTER THE INTEGER TO BE RONDED OFF: 57
ENTER THE ANOTHER INTEGER: 8
THE RONDED OFF INTEGER IS 64
Ex no: )b
*oots o+ a ,uadratic e-uation
Aim
$o find the roots of a given <uadrati+ e=uation.
Algorithm Description
%. #nput the +o"effi+ients of the =uadrati+ e=uation ax+bx+c through the >eyboard
and store the values in floating point variables a-b-+ respe+tively.
). /ompute the value of b-4ac and store in floating point variable d.
1. /he+> if the value of d is greater than '. #f it is- goto step 1- other.ise goto step 7
2. /ompute %
st
root and store in variable *% using the formula
*% T H"b O HdI
\I
:H")aI and the other root in variable *) using the formula
*)T H"b " HdI
\I
:H")aI
3. Print the values of the real roots *% and *) as the roots of the e=uation. goto step %%
7. /he+> if the value of d is less than '. #f it is- goto step 8 other.ise goto step %%
8. /ompute the real part of the root and store in *% using the formula
*%T"b:)a and the +omple* part in *) using the formula
*) T H"dI
\
:)a
(. Print the value of the +omple* roots onto the s+reen as *% O i*) and *%"i*). Goto step %%.
&. /ompute the e=ual roots and store in variables *% and *) using the formula
*% T "b:)a and *) T "b:)a
%'. Print the values of the e=ual roots *% and *) onto the s+reen.
%%. Stop.
Sample Output
ENTER THE COEFFIECIENTS
ENTER THE VALUE OF a: 2
ENTER THE VALUE OF b: 7
ENTER THE VALUE OF c: 4
THE ROOTS ARE -072!-278
THE ROOTS ARE REAL AND DISTINCT
ENTER THE COEFFIECIENTS
ENTER THE VALUE OF a: "
ENTER THE VALUE OF b: 2
ENTER THE VALUE OF c: "
THE ROOTS ARE -"00!-"00
THE ROOTS ARE REAL AND E#UAL
ENTER THE COEFFIECIENTS
ENTER THE VALUE OF a: "
ENTER THE VALUE OF b: 2
ENTER THE VALUE OF c: 5
THE ROOTS ARE -"00$200% AND -"00-200%
THE ROOTS ARE CO&'LE(
Ex no: )c
.rmstrong /umber
Aim
$o .rite a program to +he+> .hether the given number is Armstrong or not.
Algorithm Description
%. Start.
). A++ept the number- ,
1. Find the sum of the +ube of the individual digits of the number , and store
in S?M%.
2. #f S?M% e=uals to , then , is Armstrong Else , is not Armstrong.
3. Stop
Sample Output
ENTER THE NU&BER: "5)
THE GIVEN NU&BER "5) IS AN AR&STRONG NU&BER
ENTER THE NU&BER: )45
THE GIVEN NU&BER )45 IS NOT AN AR&STRONG NU&BER
Ex no: )d
Palindrome /umber
Aim
$o .rite a program to +he+> .hether the given number is Armstrong or not.
Algorithm Description
%. Start.
). A++ept the number- ,
1. Find the reverse of the number , by e*tra+ting the last digit- multiplying by %' and
redu+ing the number
2. #f the reverse e=uals to , then , is a Palindrome Else , is not Palindrome.
3. Stop
Sample Output
ENTER THE NU&BER: "2"
THE GIVEN NU&BER "2" IS A 'ALINDRO&E NU&BER
ENTER THE NU&BER: )45
THE GIVEN NU&BER )45 IS NOT A 'ALINDRO&E NU&BER
Ex no: )e
Electricit0 bill Preparation
Aim
$o .rite a / program to +al+ulate ele+tri+ity bill. ;ead the starting and ending meter reading.
$he +harges are as follo.s.
,o of units +onsumed ;ates in H;sI
)''.3'' 1.3'
%''.)'' ).3'
Less than %'' %.3'
Algorithm Description
%. Get the initial and final meter reading from the +onsumer +ard.
). ,o of units +onsumedTfinal meter reading"initial meter reading
1. #f Hno of units +onsumed RT)'' NN no of units +onsumed ]T3''I then
total +harge T,o of units +onsumedY1.3'
2. #f Hno of units +onsumed RT%'' NN no of units +onsumed ]T%&&I then
total +harge T,o of units +onsumedY).3'
3. #fHno of units +onsumed ]%''I then total +harge T,o of units +onsumedY%.3'
7. Print the total +harge for the +al+ulated no of units +onsumed.
Sample Output
Enter the initial and final meter readingC
1'''
1'3'
,o of units +onsumedT3'
$otal +hargeH;sIT83
Ex no: )+
1enu driven calculator
Aim
$o .rite a simple menu driven +al+ulator program using s.it+h statement
Algorithm Description
%. Get t.o operands and the operator +hara+ter from the user.
). #f the operator is @OB then add the operands.
1. #f the operator is @"B then subtra+t one operand from the other operand.
2. #f the operator is @YB then multiply the operands
3. #f the operator is @:B then divide one operand by the other.
7. #f the entered +hara+ter is not mat+hing any of these above four operators then print the
default statement FEnter the +orre+t operatorA
Sample Output
Enter the operands
1
3
Enter the operator
O
(
Ex no: )g
!o +ind the largest digit in a number
Aim
$o find the sum of odd"positioned and even"positioned digits of a number
Algorithm Description
%. Start
). ;ead the value of n.
1. Assign ma* to '.
2. E*tra+t digit by digit and +ompare it .ith ma*.
3. Display the largest digit.
7. Stop
Sample Output:
Enter the number C %123
Largest digit C 3
Ex no: )h
Sine and #osine series
Aim
$o .rite a / program to generate the sine and +osine series
Summation of Sine seriesC ST* " *
1
:1D O *
3
:3D " *
8
:8D O UUU4
n
:nD
Summation of /osine seriesC ST% O *
)
:)D O *
2
:2D O *
7
:7D O UUU
Algorithm Description for Sine function
%.Get the values of * and n .here n de+ides ho. long the series should +ontinue.
).Set the initial +onditions ST*- termT*-iT%
1.$o get the terms .ith alternate sign repeatedly e*e+ute signT"sign
2.$ill the desired no of terms are generated repeat the follo.ing steps
a. #dentify the +urrent i
th
term
b.generate +urrent term from its prede+essor.
+urrent i
th
term T (previous term)`x
2
: iYHi"%I
+.add +urrent term .ith the appropriate sign to the a++umulated sum for
the sine fun+tion
iTiO)
termT"termY *
)
: iYHi"%I
STSOterm
Algorithm Description for Cosine function
%.Get the values of * and n.
).Set the initial +onditions ST'- termT%- iT%
1.$o get the sum e*e+ute s T s O term
2.$ill the desired no of terms are generated repeat the follo.ing steps
a. #dentify the +urrent i
th
term
b.generate +urrent term.
+urrent i
th
term T (term`*
)
)

: (iO%)Y(iO))
3. #n+rement i by )
iTiO)
7. ;epeat Steps from 1 to 3 till (i]Tn).
8. Stop
Sine Series
Sample input:
Enter the values of * and n
%
)

Sample output
'.(111111
Cosine Series
Sample input:
Enter the values of * and n
)
)
Sample output
2
Ex no: )i
Prime /umber 2eneration
Aim
$o generate a prime number series upto the given limit.
Algorithm Description
%. Start
). ;ead the value of n.
1. $o print the value ) on s+reen.
2. Ma>e a for loop
De+lare iT1
#n+rement i by % upto n
3. ?sing another for loop
De+lare 9T)
From 9T) to 9]iG divide i by 9
#f i X 9 T T ' then print the number else print HF FI
7. Stop
Sample Output:
Enter the Limit value C %'
)
1
3
8

Ex no: 13a
"inear Search
Aim
$o sear+h for a given element in an array and find its position if it is present.
Algorithm Description
%. Start
). A++ept the number of elements- n
1. ;ead all the n elements in the array a^n_
2. A++ept the element- s- to sear+h.
3. #nitialize variables big and small to a^'_ and posn to W%.
7. For i T ' to n"% do step 8
8. if HsTTaHiII then posn T i
(. if HposnR"%I then print F$he given element is found at position CA - posn
&. if HposnTT"%I then print F$he given element is not found in the arrayA
%'. Stop
Sample Output
Enter ,o of elementsC 1
Enter Array elementsC )-7-&
Enter Sear+hing elementC 7
$he given element is found at position C).
Ex no: 13b
Bubble Sort
Aim
$o sort the elements of an array using bubble sort.
Algorithm Description
%. Start
). A++ept the number of elements- n- in the array.
1. For i T ' to n"% do step 2
2. ;ead aHiI
3. For i T ' to n"% do steps 7 to %'
7. For 9 T ' to n"i"% steps 8 to %'
8. if HaH9IRaH9O%II do steps ( to %'
(. temp T aH9I
&. aH9I T aH9O%I
%'. aH9O%I T temp
%%. For i T ' to n"% do step %)
%). 0rite aHiI
%1. Stop
Sample Output
Enter ,o of Array ElementsC 2
Enter Array ElementsC 2-)-%'-7
After SortingC
)
2
7
%'
Ex no: 13c
1atrix .ddition
Aim
$o .rite a program in / to perform matri* addition.
Algorithm Description
%. Start.
). A++ept the number of ro.s and +olumns Hm-n - p-=I for the ) matri+es a N b.
1. #f m]Rp NN n]R= then .rite FMatri* addition is not possible.A goto Step %1.
2. A++ept the elements of the ) matri+es.
3. ;epeat Steps 3 to ( for i T % to m.
7. ;epeat Steps 7 to 8 for 9 T % to =.
8. +^i_^9_Ta^i_^9_Ob^i_^9_
(. /ontinue looping for 9.
&. /ontinue looping for i.
%'. Display F $he resultant matri* isA
%%. Display the matri* +.
%). Stop.
Sample Output
Enter number of ro.sN +olumns in %
st
matri*C 1 1
Enter number of ro.sN +olumns in )
nd
matri*C 1 1
Enter the elements of the %
st
matri*C
% ) 1
2 3 7
8 ( &
Enter the elements in the )
nd
matri*C
% ' '
' % '
' ' %
$he matri* after addition is
) ) 1
2 7 7
8 ( %'
Ex no: 13d
1atrix 1ultiplication
Aim
$o .rite a program in / to perform matri* multipli+ation.
Algorithm Description
%. Start.
). A++ept the number of ro.s and +olumns Hm-n - p-=I for the ) matri+es a N b.
1. #f n]Rp then .rite FMatri* multipli+ation is not possible.A And goto Step %2.
2. A++ept the elements of the ) matri+es.
3. ;epeat Steps 7 to %% for i T % to m.
7. ;epeat Steps 8 to %' for 9 T % to =.
8. ;epeat Steps ( N & for > T % to n.
(. +^i_^9_T+^i_^9_Oa^i_^>_Y b^>_^9_.
&. /ontinue looping for >.
%'. /ontinue looping for 9.
%%. /ontinue looping for i.
%). Display F $he resultant matri* isA
%1. Display the matri* +.
%2. Stop.
Sample Output
Enter number of ro.sN +olumns in %
st
matri*C 1 1
Enter number of ro.sN +olumns in )
nd
matri*C 1 1
Enter the elements of the %
st
matri*C
% ) 1
2 3 7
8 ( &
Enter the elements in the )
nd
matri*C
% ' '
' % '
' ' %
$he matri* after multipli+ation is
% ) 1
2 3 7
8 ( &
Ex no: 13e
4ispla0 the matrix 5ith the sum o+ 3 ro5s and columns
Aim
$o .rite a program in / to input a 1*1 Matri* and display a Matri* .ith the sum of the ro.s and
+olumns.
Algorithm Description
%. Start.
). #nput the elements of the matri*
1. Find the ro. .ise and +olumn .ise total and store it in separate one"dimensional
matri+es
2. Display the given matri* along .ith the t.o one dimensional matri+es in the re=uired
format.
3. Stop.
Sample Output
Enter the elements of the matri*C
% ) 1
2 3 7
8 ( &
$he resultant matri* is
% ) 1 7
2 3 7 %3
8 ( & )2
%) %3 %(
Ex no: 13+
String 1anipulation
Aim
$o .rite a program in / to perform string manipulation fun+tion li>e string +on+atenations-
+omparison- find the length and string +opy .ithout using library fun+tions.
Algorithm Description
%. Start.
). Enter the t.o strings -s% and s)
1. Display the menu
%. String /on+atenation
). String /omparison
1. String length
2. String /opy
2. A++ept the +hoi+e- +h from the user
3. if +hTT% goto step 7 else goto step %1
7. for iT' to s%^i_]RB`'B do step 8
8. +on+at^i_Ts%^i_
(. +on+at^i_TB @
&. for 9T' to s)^9_]RB`'B do step %'
%'. +on+at^iO9O%_Ts)^9_
%%. +on+at^iO9O%_TB`'@
%). print the +on+atenated string as +on+at
%1. if +hTT) goto %2 else goto step )'
%2. initialize iT'
%3. .hileHs%^i_TTs)^i_ NN s%^i_]RB`'BNN s)^i_]RB`'BI do step %7
%7. in+rement i by %
%8. if s%^i_TTB`'B NN s)^i_TTB`'BI do step %(
%(. print the strings are e=ual
%&. else print not e=ual
)'. if +hTT1 goto )% else goto step )3
)%. initialize +ountT'-iT'
)). .hile s%^i_]RB`'Bdo step )1
)1. in+rement +ount by % and i by %
)2. display the length of the string as +ount W%
)3. for iT' to s%^i_]RB`'B do step )7
)7. +opy^i_Ts%^i_
)8. +opy^i_TB`'B
)(. display the +opied string as +opy
Sample Output
Enter the t.o strings
,e.
5or>
%. String /on+atenation
). String /omparison
1. String length
2. String /opy
Enter the +hoi+e C %
/on+atentated String C ,e. 5or>
%. String /on+atenation
). String /omparison
1. String length
2. String /opy
Enter the +hoi+e C )
String /omparison C Strings are not e=ual
%. String /on+atenation
). String /omparison
1. String length
2. String /opy
Enter the +hoi+e C 1
Length of the %
st
string C 1
%. String /on+atenation
). String /omparison
1. String length
2. String /opy
Enter the +hoi+e C 2
/opied String C ,e.
Ex no: 13g
Sorting 6+ /ames
Aim
$o .rite a program in / to arrange names in alphabeti+al order
Algorithm Description
%. Start.
). A++ept the number of names- n- in the array.
1. For i T ' to n"% do step 2
2. ;ead aHiI
3. For i T ' to n"% do steps 7 to %'
7. For 9 T ' to n"i"% steps 8 to %'
8. if Hstr+mpHaH9I-aH9O%II R'I do steps ( to %'
(. str+pyHtemp- aH9II
&. str+pyHaH9I - aH9O%II
%'. str+pyHaH9O%I - tempI
%%. For i T ' to n"% do step %)
%). 0rite aHiI
%1. Stop
Sample Output
Enter the number of names C 2
London
Delhi
Paris
Mos+o.
Alphabeti+al List
Delhi
London
Mos+o.
Paris
Ex no: 11a
Student7s 1ark list using Structures
Aim
$o .rite a program in / to maintain the studentBs mar> list.
Algorithm Description
%. Start
). Define a stru+ture stu +ontaining members li>e name- roll number- mar>%-
mar>)- mar>1- total- average N grade .ith stru+ture variable name
s^%''_Harray of stru+turesI.
1. A++ept the number of students n.
2. A++ept the details of the students by a++essing the members of the stru+ture by
giving s^i_.]member nameR .here # is the loop +ounter from % to n.
3. ;epeat steps 7 to ( for iT% to n.
7. /ompute s^i_.total by summing the 1 mar>s and the average for the i
th
student.
8. Depending on the value of average- +ompute the grade for the i
th
student.
(. /ontinue looping for i.
&. Display the details of the students in tabular format.
%'. Stop.
Sample Output
Enter the number of studentsC )
Enter detailsU.
%.
;!LL ,!.C ))
,AMEC san
MA$S MA;ESC %''
P5 MA;ESC &&
/EM MA;ESC ((
).
;!LL ,!.C %)
,AMEC .er
MA$S MA;ESC ((
P5 MA;ESC ))
/EM MA;ESC 11
Student Details
;!LL ,! ,AME $!$AL AMG. G;ADE
)) san )(8 &3 A
%) .er %21 28 /
Ex no: 11b
4i++erence bet5een t5o dates using structures8
Aim
$o .rite a program in / for finding the differen+e bet.een t.o dates using stru+tures.
.
Algorithm Description
%. Start
). Define a stru+ture date +ontaining members li>e day- month- year.
1. Define 1 stru+ture variables for date- say- d%- d) and d1.
2. A++ept the details of the dates for d% and d) by a++essing the members of the stru+ture
using d.]member nameR
3. Find the differen+e and store it in d1.
7. Stop.
Sample Output
Enter date%C %(
'2
)'%'
Enter date)C %)
')
)'%'
Differen+e in daysC 7
Differen+e in MonthsC )
Differen+e in yearC '
Ex no: 11c
Emplo0ee Pa0roll using 9nions
Aim
$o .rite a program in / to prepare Employee Payroll.
Algorithm Description
%. Start
). Define a union emp +ontaining members li>e name-
emp id-bpay-DA-;A-//A-PF-grosspay N netpay .ith union variable name
e^%''_Harray of unionsI.
1. A++ept the number of employees n.
2. A++ept the details of the employees by a++essing the members of the union by
giving e^i_.]member nameR .here # is the loop +ounter from % to n.
3. ;epeat steps 7 to ( for iT% to n.
7. /ompute e^i_.DA -e^i_ .;A- e^i_ .//A -e^i_ .PF for the i
th
employee.
8. /ompute e^i_.gross by summing the above four +al+ulations for the i
th

employee.
(. /ompute e^i_.netpay by subtra+ting the PF from gross for the i
th
employee.
&. /ontinue looping for i.
%'. Display the details of the employees in tabular format.
%%. Stop.
Sample Output
Enter the number of employeesC )
Enter detailsU.
%.
EMP #DC %11
,AMEC ;ASA,
6AS#/ PA5C ('''
).
EMP #DC %13
,AMEC ;AM#
6AS#/ PA5C 7'''
Employee Details
EMP #D ,AME 6AS#/ PA5 DA ;A //A PF G;!SS ,E$
)) ;ASA, (''' 37(' ('' 2'' ('' %37(' %2(('
%) ;AM# 7''' 2)7' 7'' 1'' 7'' %%87' %%%7'
Ex no: 12a
#alculation o+ mean: variance and standard deviation using
+unctions
Aim
$o .rite a / program to +al+ulate the mean- varian+e and standard deviation using fun+tions.
Algorithm Description
%. Start.
). Enter the number of elements- n
1. Store the elements in an array- a^i_
2. +all the fun+tion-meanHa-nI to +al+ulate the mean
3. +all the fun+tion- varian+eHa-nI to +al+ulate the varian+e
7. s=uare root of varian+e is the Standard deviation- sdTs=rtHvarian+eI
8. Display mean- varian+e and standard deviation
(. Stop
Fun+tion meanHa-nI
%. Start
). initialize sumT'
1. for iT% to n do step 2
2. sumTsumOa^i_
3. mTsum:n
7. return m
8. stop
Fun+tion varian+eHa-nI
%. Start
). *TmeanHa-nI
1. for iT' to n do step
2. sumTsumOHa^i_"*IYHa^i_"*I
3. varTsum:n
7. return var
8. Stop
Sample Output
Enter the limitC3
Enter the elementsC 1 2 3 7 8
MeanC 3
Marian+e C)
Standard DeviationC%.2%2
Ex no: 12b
Se-uential and Binar0 search using ;unctions
Aim
$o .rite a program in / to perform se=uential and binary sear+h using fun+tions
Algorithm Description
%. Start.
). A++ept the limit -n
1. ;ead all the n elements in the array a^n_
2. A++ept the element- s- to sear+h.
3. +all the fun+tion- se=Ha-s-nI for se=uential sear+h
7. +all the fun+tion- binHa-s-nI for binary sear+h
8. Stop
Fun+tion se=Ha-s-nI
%. Start
). #nitialize variables big and small to a^'_ and posn to W% respe+tively.
1. For i T ' to n"% do step 2
2. if HsTTaHiII then posn T i
3. if HposnR"%I then print F$he given element is found at position CA - posn
7. if HposnTT"%I then print F$he given element is not found in the arrayA
8. Stop
Fun+tion binHa-s-nI
%. Start
). #nitialize leftT' right Tn
1. .hile left]Tright do step 2
2. midTfloorHHright"leftI:)IOleft
3. if value R a^mid_ -leftTmid O%
7. else if value ] a^mid_- rightTmid"%
8. else return mid
(. else return not found
&. Stop
Sample Output
Enter ,o of elementsC 1
Enter Array elementsC )-7-&
Enter Sear+hing elementC 7
$he given element is found at position C).
Ex no: 12c
;ibonacci series using recursion
Aim
$o .rite a program in / to print the fibona++i series using re+ursion
Algorithm Description
%. Start.
). A++ept the limit -n
1. +all the fun+tion- fibHnI
2. Print the series
3. Stop
Fun+tion fibHnI
%. Start
). if nTT% return '
1. else if nTT) return %
2. else fHnITfibHn"%IOfibHn")I
3. return fHnI
7. Stop
Sample Output
Enter the limitC2
Fibona++i seriesC
'
%
%
)
Ex no: 12d
;actorial o+ the given number using recursion
Aim
$o .rite a program in / to +al+ulate fa+torial of the given number using fun+tions
Algorithm Description
%. Start
). Enter the number-n for .hi+h the fa+torial has to be +al+ulated
1. +all the fun+tion- fa+tHnI
2. Print the fa+torial of the number
3. Stop
Fun+tion fa+tHnI
%. Start
). if nTT% return %
1. else fTnYfa+tHn"%I
2. return f
3. Stop
Sample Output
Enter the numberC 2
Fa+torial C )2

S-ar putea să vă placă și