HowtouseStudyMaterial: Howeveritisnot100%substituteforTextbook. Nowyouarewelcometothe...content... Weightagetodifferenttopics/contentunits S. No UNIT VSA 1 Mark SAI 2Marks SA II 3Marks LA 4Marks Total 1 Review ofC++ coveredinClassXI 1(1) 8(4) 3(1) 12(6) 2 ObjectOrientedProgramminginC++ 2(1) 4(1) 6(2) a)IntroductiontoOOP using C++ b)Constructor&Destructor 2(1) 2(1) c)Inheritance 4(1) 4(1) 3 Data Structure &Pointers 2(1) 3(1) 4(1) 3(1) a)Address Calculation b)StaticAllocation ofObjects 3(1) 5(2) c)DynamicAllocationofObjects 4(1) d)Infix&Postfix Expressions 2(1) 2(1) 4 DataFileHandlinginC++ FundamentalsofFileHandling TextFile BinaryFiles 1(1) 2(1) 3(1) 1(1) 2(1) 3(1) 5 DatabasesandSQL 2(1) 4(1) 2(1) a)Database Concepts b)StructuredQueryLanguage 2(1) 6(2) 6 BooleanAlgebra 1(1) 2(1) 3(1) 2(1) a)IntroductiontoBooleanAlgebra &Laws b)SOP&POS 1(1) c)KarnaughMap 3(1) d)BasicLogicGates 2(1) 2(1) 7 Communication&OpenSource Concepts 2(2) 4(1) 2(2) a)IntroductiontoNetworking 4(1) c)Security 2(2) 2(2) d)Webservers 1(1) 1(1) e)OpenSourceTerminologies 1(1) 1(1) 9(9) 26(13) 15(5) 20(5) 70(32)
Q6.Whatisthedifference betweenObjectOrientedProgramming andProceduralProgramming?Ans: ObjectOrientedProgramming ProceduralProgramming EmphasisonData Data hidingfeature preventsaccidentalchangeindata Featureslike data arepresent Emphasisondoingthings (functions) Presence Suchfeaturesare notavailable Q7. DifferentiatebetweenaCallbyValueandCallbyReference,givingsuitableexamplesofeach? Ans: CallbyValue CallbyReference original valuessent toit. originalvaluesarenotreflected. Thecalledfunctionaccessesandworkswiththe originalvalues usingtheirreferences. Anychangesthatoccur inthefunction run,changesinthe originalvaluesarereflected. void change(intb) { b=10; } voidmain() { inta=5; } Outputwillbe: voidchange(int&b) { b=10; } voidmain() { inta=5; } Outputwillbe: Q8.Whatisaparameter?Differentiatebetweenanactualandaformalparameterwithanexample? Example: void change(intb) //bistheformalparameter { b=10; } voidmain() { inta=5; change(a); } Q9. Enlistanyfourjump statementswith theiruses. Ans:(i)goto: A gotostatementcantransferthe programcontrolanywhereintheprogram. anycode inbetween. continue:Abreakstatementenablesaprogramtoforcethenextiterationtotakeplace,skipping anycode inbetween.
#include<ctype.h> voidfunnystr(char*s,int n=2) { inti=n; while(i< strlen(s)) { } i=0; s[i]='-'; i=i+n; while(s[i]!='\0') { if(s[i]> elseif(s[i]>'a'&&s[i]<'p') { if(i%3 == 0) s[i]=tolower(s[i-1]); } i++; } } else s[i]=tolower(s[i]); voidmain() { }
DataStructure&Pointers AddressCalculation ShortAnswerQuestions(3marks) FormulaeofRowMajor&ColumnMajorareusedinthe givenquestions.Kindlygothroughit. W=4, N =30, M =10, Base(x)RowMajorFormula: =4500 Loc(x[12][8])=Base(x)+W*(M*I+J) Loc(x[2][4]) =Base(x)+W*(M*I+J) =4500+4*(10 *12+8) =4500+4*128 =4500+512 =5012 =4500+4*(10*2+4) =4500+4*24 =4500+96 =4596 memorylocation5000. Ans:Given,W=4,N=20,M=30, Loc(P[2][20])=5000 ColumnMajorFormula: Loc(P[I][J])=Base(P)+W*(N*J+I) 4*(400+2) =5000–1608 =3392 :(i)Row wise (ii) Columnwise. W=4, N=5,M =25,Base(ARR)=1000 RowMajorFormula: Loc(ARR[5][7])=Base(ARR)+W*(M*I+J) =1000+4*(25*5+7) =1000+4*132 =1000+528 =1528 Columnwise Given, W=4, N=5,M =25,Base(ARR)=1000 ColumnMajorFormula: Loc(ARR[5][7])=Base(ARR)+W*(N*J+I) =1000+4*(5*7+5) =1000+4*40 =1000+160 =1160 :
intcheck(charac[]) { returnstrcmp(area,ac) } }; Q3. Write afunctionTRANSFER()inC++,thatwould copyallrecordswhicharehavingarea as”DEL”fromPHONE.DATto PHONBACK.DAT. Ans: void transfer() { |ios::binary);while(Fin.read((char*)&ph,sizeof(ph))) { if(ph.check(“DEL”)== 0) } Fin.close(); } thename,assumingthebinaryfileiscontainingtheobjectsofthefollowing class. class STUD { intRno; }; Ans: void { intmrno; cout<<”\nEntertheroll numbertomodify:“; cin>>mrno; while(File.read((char*)&s,sizeof(s))) { if(s.srno()==mrno) { File.seekp(–1* }File.close() ; }
Centretocentredistancesbetweenvariousblocks NumberofComputers Suggestacablelayout ofconnectionsbetweentheblocks. Suggestthemostsuitableplace(i.e.block)tohousetheserverofthisorganisationwithasuitablereason. Suggesttheplacementofthefollowing devices with justification Repeater (ii) Hub/Switch Ans :(a) OR C Layout2 Sincethe distancebetween BlockAand BlockBisquiteshort themaximumnumberof computers, thus decreasing network. thecourseofdataflow intheseroutes. path havetobecarefullyalignedphysically