Sunteți pe pagina 1din 6

SeLh u Plndu[a Slndhl Model Senlor Secondary School kellys Chennal 600 010

Class xll CompuLer Sclence Lab Lxerclses 8ecord rograms (2010 2011)
1 uone
2 uone
3 uone
4 uone
3 uone
6 uone
7 SCL 23 commands
8 Matr|x 1ypes A square maLrlx LhaL ls one havlng Lhe same number of rows and columns ls called a dlagonal
maLrlx lf lLs only nonzero elemenLs are on Lhe dlagonal from upper lefL Lo lower rlghL lL ls called upper Lrlangular lf
all elemenLs below Lhe dlagonal are zeroes and lower Lrlangular lf all elemenLs above Lhe dlagonal are zeroes
WrlLe a program LhaL reads a maLrlx and deLermlnes lf lL ls one of Lhese Lhree speclal maLrlces WrlLe a program
LhaL reads a maLrlx and deLermlnes lf lL ls one of Lhese Lhree speclal maLrlces ueflne Lhe funcLlons
vold read_daLa(lnL arr lnL rows lnL col)
vold dlsplay_daLa(lnL arr lnL rows lnL col char maL_Lype20) // daLa should be prlnLed ln Lhe form of a maLrlx
along wlLh lLs Lype
lnL maLrlx_chk(lnL arrlnL rows lnL col) // reLurn 123 respecLlvely for all Lhe 3 speclal Lypes of maLrlces
9 WrlLe a menu drlven program Lo perform Lhe followlng MaLrlx CperaLlons
a CreaLe MaLrlx of slze mn
b ulsplay sum of rlnclpal ulagonal ulagonal elemenLs lylng from rlghL Lo lefL of Lhe maLrlx elemenLs of Lhe
dlagonals
c Sum of Lwo maLrlces
d ulfference of Lwo maLrlces
e roducL of Lwo maLrlces Amk 8kp
ueflne approprlaLe funcLlons Lo perform Lhe above operaLlons

roblem Analysls for roducL of Lwo maLrlces
If the user option is MULTIPLY then
for i <- 0 to M - 1 step 1
for j <- 0 to P-1 step 1
ci,j, <- 0
for k <- 0 to N-1 step 1
ci,j, <- ci,j, + ai,k, bk,j,


10 SLrucLures Merglng of 1wo unsorLed Arrays of Cb[ecLs
ueflne a sLrucLure wlLh Lhe followlng speclflcaLlons
SLrucL sLudenL

lnL rollno marks3
char name13
proLecLed
lnL LoLal
floaL average
publlc
sLudenL()
sLudenL()
AccepL_uaLa()
ulsplay_uaLa()



vold merge_LoLal_desc(sLudenL ob[_array_one sLudenL ob[_array_Lwo sLudenL ob[_merge lnL slze1 lnL slze2)
// merges array of ob[ecLs so LhaL Lhe resulLanL array ls ln Lhe descendlng order of LoLals
vold lnserL_sorL(sLudenL ob[_array lnL slze1) //
vold menu() // Lo accepL Lhe cholce and lnvoke approprlaLe (member) funcLlons

11 Classes number converslons
WrlLe a menu drlven program Lo converL Lhe numbers from one base Lo anoLher base namely blnary ocLaldeclmal
ueflne funcLlons
;oid con_dec_bin();
;oid con_bin_dec();
;oid con_dec_oct();
;oid con_oct_dec();
class num_con;ersion
,
long double decimal, binary,octal;
char d40,;
public:
num_con;();
~num_con;()
;oid accept(int ch) // to in;oke appropriate con;ersion functions
,
vold menu()// Lo accepL Lype of number converslon
vold maln() // Lo lnvoke menu()

12 lnherlLance Slngle Level MulLllevel MulLlple Pybrld
ueflne classes wlLh Lhe followlng speclflcaLlons
class circle
,
public:
float radius;
circle()
circle(float r)
;oid input()
;oid display()

,cir;
class sphere : ;irtual public circle
,
float tsa1,;olume1;
public :
sphere()
sphere(float r) : circle(r)
;oid input()
;oid calculate()
;oid display()
,sph;

class cylinder : ;irtual public circle
,
public:
float height,tsa,csa,;olume;
cylinder()
cylinder(float r,float h) : circle(r)
;oid input()
;oid compute()
;oid display()
,cyl;
class cone : public sphere, public cylinder
,
public:
float length;
cone()
cone(float r,float h):cylinder(r,h)
;oid input()
;oid display()
;oid compute()
,con;
WrlLe a menu drlven program Lo accepL compuLe and dlsplay Lhe deLalls of Lhe selecLed shape
13 1exL llle operaLlons WrlLe a menu drlven program Lo perform Lhe followlng operaLlons on a LexL flle LhaL sLores Lhe
deLalls of Lralnees (Lralnee code name speclallzaLlon (uoLneL/!ava/P/C++) Lralnlng perlod no of monLhs
(should be beLween 611 monLhs)
a CreaLe Lhe flle where deLalls of an employee are separaLed by '*' and deLalls of dlfferenL employees ls
sLored on dlfferenL llnes
b 1o dlsplay Lhe deLalls
c 1o search and dlsplay Lhe parLlculars of a speclflc employee
14 1exL flle operaLlons WrlLe a menu drlven program Lo perform Lhe followlng operaLlons on a LexL flle LhaL sLores Lhe
deLalls of Lralnees (Lralnee code name speclallzaLlon (uoLneL/!ava/P/C++) Lralnlng perlod no of monLhs
(should be beLween 611 monLhs) (use Lhe daLa flle creaLed ln problem 13)
a 1o deleLe Lhe deLalls of all Lralnees whose codes are avallable ln a flle called as 1ralnee_uelLxL
b 1o append Lhe deLalls of Lhe Lralnees avallable ln a flle called 1ralnee_add1xL"
c 1o dlsplay Lhe deLalls of Lhe flle conLenLs aL end of each operaLlon
13 1exL llle CperaLlons WrlLe a menu drlven program Lo merge Lwo LexL flles LhaL sLores Lhe deLalls of Lralnees
(Lralnee code name speclallzaLlon (uoLneL/!ava/P/C++) Lralnlng perlod no of monLhs (should be beLween 6
11 monLhs)
a 1o creaLe Lwo LexL flles and also ensure LhaL Lhe 1ralnee codes are ln ascendlng order ln each of Lhe flles
b 1o merge Lhe conLenLs ensurlng LhaL Lhe resulLanL daLa flle also comprlses of daLa ln Lhe ascendlng order of
Lralnee codes
16 Cb[ecL llle CperaLlons 8epeaL program 13 uslng flle of ob[ecLs use Lhe followlng deflnlLlon
class Lralnee

lnL code Lralnlng_perlodchar name13specllalsaLlon10
publlc
Lralnee()
Lralnee()
AccepL_daLa()
ulsplay_uaLa()
lnL 8Ln_code()


17 Cb[ecL llle CperaLlons 8epeaL program 14 uslng flle of ob[ecLs erform deleLe operaLlons as follows ulsplay Lhe
deLalls of employees one by one prompL Lhe user lf deleLlon ls requlred for Lhe currenL record ln dlsplay lf 'yes'
deleLe Lhe record (1hls ls meLhod of deleLlon ls known as onllne deleLlon
18 Cb[ecL llle CperaLlons 8epeaL program 13 uslng flle of ob[ecLs
19 Cb[ecL llle CperaLlons WrlLe a menu drlven program Lo perform Lhe followlng operaLlons on Lhe Lralnee daLa flle
a 1o Lransfer Lhe conLenLs Lo an dynamlc array of ob[ecLs
b 1o sorL Lhe conLenLs of Lhe array of ob[ecLs uslng 8ubble SorL and also Lo Lransfer Lhe sorLed conLenL Lo Lhe
flle
c 1o dlsplay Lhe deLalls of Lhe flle
20 Cb[ecL llle CperaLlons WrlLe a menu drlven program Lo perform Lhe followlng operaLlons on Lhe Lralnee daLa flle
a 1o search for Lhe conLenLs of a Lralnee by code and reLurn Lhe record number lf found oLherwlse 1
b 1o perform dlrecL access (uslng seekg) of Lhe reLrleved record updaLe Lhe flle wlLh modlfled conLenLs
c 1o dlsplay Lhe deLalls of Lhe flle
21 1exL llle CperaLlons WrlLe a C++ program Lo perform Lhe followlng operaLlons on a LexL flle called as SLory1xL"
a 1o converL every senLence Lo 1lLle Case and wrlLe lL on a new flle
b 1o counL Lhe number of words LhaL do noL have a vowel
c 1o ellmlnaLe excess blank spaces ln beLween words and wrlLe lL on Lo a new flle
d 1o glve a classlfled counL of
l no of upper case alphabeLs
ll no of lower case alphabeLs
lll no of dlglLs
lv no oLher characLers
v ulsplay Lhe slze of Lhe flle uslng Lhe above counL
e ulsplay Lhe flle conLenLs


Pls. find enclosed sample Algorithm. All algorithms can be written in this style
that throws light on the logic alone. (this will sa;e time and PAPER)
Algorithm :
Step 1 : Start
Step 2 : Jpen the text file Story.Txt in the write mode
Step 3 : Get the text from the user and write it into the file
Step 4 : Close the file
Step 5 : Jpen the file in Story.Txt in read mode and UPD_Story.Txt" in write
mode
Step 6 : While not eof() of file Story.Txt
6.1 Read word from Text.DJC"
6.2 word0, = toupper(word0,)
6.3 Write into file UPD_Story.Txt <- word

End of while
Close the file


22 MalnLaln a Cueue Lo faclllLaLe onllne booklng for a resLauranL 1asLe buds" Assume LhaL Lhe booklng ls open for
Lhe currenL day wlLh one sloL only 1he lnformaLlon gaLhered wlll be name of Lhe cusLomer no of people WrlLe
a menu drlven program Lo faclllLaLe boLh booklng and cancelllng lmplemenL Cueue uslng llnked llsL wlLh Lhe
followlng sLrucLure
Class node

Char cusLomer_name13
lnL no_of_people
lnL 8ooklng_no
node * nexL
ubllc
node()
AccepL_ueLalls()
ulsplay_ueLalls()

23 8epeaL rogram 22 uslng Arrays ln place of llnked llsL
24 8epeaL rogram 23 MalnLaln Lhe queue as Clrcular Cueue
23 WrlLe a program Lo malnLaln a llsL called as urop LlsL" 1hls llsL wlll malnLaln Lhe llsL of employees ln Lhe order of
Lhelr [olnlng Lhe organlzaLlon ln wake of recenL poor economlcal growLh organlzaLlon ls forced Lo downslze lLs
workforce lL has declded Lo lay off employees ln Lhe order of LasL [olned ls llrsL LermlnaLed WrlLe a program LhaL
would malnLaln Lhe requlred urop LlsL ln Lerms of addlng a node Lo Lhe llsL when an employee [olns Lhe
organlzaLlon and remove a node from Lhe llsL when an employee ls LermlnaLed WrlLe a menu drlven program Lo
malnLaln Lhe same use Lhe sLrucLure
sLrucL sLack

lnL code
Char name10daLe_of_[olnlng10
SLack * node
SLack()
AccepL()
ulsplay()


SLack *addnode()
SLack *deleLenode()

26 8epeaL program 23 uslng arrays
Schedule for compleLlon and submlsslon of programs
rg
no
uaLe of
Submlsslon
1o be done by
8 17102011 arasaran
9 17102011 arasaran
10 17102011 arasaran
11 17102011 SlddarLh
12 17102011 uoradlLya
rg
no
uaLe of
Submlsslon
1o be done by
13 24102011 uoradlLya
14 24102011 Lakshml
13 24102011 Lakshml
16 31102011 Lakshml
17 31102011 klshore
18 31102011 klshore
19 7112011 !lLesh
20 7112011 !lLesh
21 7112011 !lLesh
22 14112011 veera
23 14112011 veera
24 14112011 Monlsh
23 14112011 Monlsh
26 14112011 Arun rakash

1 SLudenL lncharge wlll also wrlLe Lhe algorlLhms and geL approval before belng clrculaLed
2 laculLy from Lhe CompuLer Sclence ueparLmenL wlll Lake up Lhe responslblllLy Lo Lake prlnLouLs

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