Scoring Key Set1 - Prehalf Yearly

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Vani Vidyalaya Senior Secondary & Junior College

Pre Halfyearly Examination 2013-14 Computer science Scoring key Set 1


1.a) Return_type function_name(int &a, int &b); b) i)iomanip.h ii)ctype.h c) In function call we pass float type values. Whereas in the definition of this function it accept integer type values , so the float values will automatically be converted into integer type by the compiler , that is why we get integer output. d) @a@E@ENVIrOn@E@T@iN @0@2 e)A = 30 f) Void findsum(int A[],int n) { int s=0,i; for(i=0;i<n;i++) s=s+A[i]; cout<<s; } 2.a.) Multiple Inheritances: In this type of inheritance a class can derive more than one class. Single Inheritance: In this type of Inheritance a derived class can serve as a base class for another class in the hierarchy. Draw block dia & give example : Refer Vol I Page no 238 b) i)Intermission ob(10); ii)Intermission (Intermission &t) { m= t.m; } c) class Sports { long S_Code; char S_name[20]; int Fees, Duration public: sports() { S_Code= 1001; strcpy(S_Name,Cricket); Fees= 500; Duration=70; } void NewSports(); void DisplaySports(); } }; void Sports::NewSports()

{ cout<<\n Enter Sports Code; cin>> S_Code; cout<<\n Sports Name; gets(S_Name); cout<<\n Duration; cin>>Duration; if(strcmp(S_name, Table Tennis)==0) Fees= 2000; else if(strcmp(S_name, Swimming)==0) Fees= 4000; else Fees= 3000; } void Sports::DisplaySports() { cout<<\n Sports Code: <<S_Code<<endl<<Sports Name :<<S_Name<<endl<<Fees : <<Fess<<\n Duration :<<Duration; } d) class Manager : public Director { public: int totalsum; int s; Manager(int a,int b) { num1=a; num2=b; } void sumofnum() { s= num1+num2; } void showsum() { cout<<the sum is<<s; }
3a) void transfer(int a[],int b[],int size)

{ int k=0; for(int i=0;i<size;i++) if(a[i]<0) { b[k]=a[i]; k++; } for(int i=0;i<size;i++) if(a[i]>0) { b[k]=a[i]; k++; } for(int i=0;i<size;i++)

if(a[i]==0) { b[k]=a[i]; k++; } } b)Base address 2660 and Address of A[18][22] is 8640 c) void delqueue() { NODE *temp; If(front==NULL) // If queue is empty { cout<<Queue is empty return; } temp=front; front=front->link; if(front==NULL) //if the queue has only a sing node rear=front=NULL; delete temp; } d) int BsearchAsc(int A[], int n, int data) { int Mid,Lbound=0,Ubound=n-1,Found=0; while((Lbound<=Ubound) && !(Found)) { Mid=(Lbound+Ubound)/2; if(data>A[Mid]) Lbound=Mid+1; else if(data<A[Mid]) Ubound=Mid-1; else Found++; } if(Found) return(Mid+1); //returning 1ocation, if present else return(-1); //returning -1,if not present } e) 1625 4a) Statement 1= File.seekp(-1*sizeof(p), ios::cur); Statement 2= File.write(((char *)&p,sizeof(p)); b)void count_vowels( ) { ifstream fin (first.txt,ios::in); char ch; int count = 0; while(!fin.eof( )) { fin.getch( ); switch(ch) { case a: count++; break; case e: count++; break; case i: count++; break; case o: count++; break; case u: count++; break; } cout<< No:of Vowels = <<count;} fin.close( );} c) void detail()

{ Train tr; fstream fin; fin.open(TRAIN.DAT,ios::in||ios::binary) while(!fin.eof()) { fin.read((char *)&tr,sizeof(tr); if(tr.retdist( )>1000) tr.display( ); } } 5.a) i) S_ID ii) Domain of the column LASTNAME is any string which contain only alphabets (upper or Small case). b.i) select * from employee order by FIRSTNAME asc; ii) select FIRSTNAME ,CITY ,SALARY+BENEFITS Total Salary From employee ,Desig where DESIGNATION =Clerk; iii) select DESIGNATION,min(salary) from desig group by DESIGNATION having DESIGNATION =Clerk OR DESIGNATION =Managers; iv) update DESIG set BENEFITS = BENEFITS +(BENEFITS*.10) d) FIRSTNAME SALARY Sam 75000 Manila 70000 George 75000 e) Degree of EMPLOYEE : 5 Cardinality of DESIG :9 6.a) Refer vol II page no : 653 b) (X+Y+Z). (X+Y+Z). (X+Y+Z). (X+Y+Z). (X+Y+Z) c) c' + yw 7.a.(i) I will use TCP/IP because TCP/IP is a secure and reliable protocol (ii) WAN (iii) Winproxy /Squid proxy server b.Hub/Switch c. Firewall protects our computer system from viruses and other malicious program. It can also used to protect out system from unauthorized access d. Client side scripting language : JAVASCRIPT/VBSCRIPT e. Open Source Software: The Software whose Source code are freely available for modification and re-distribution are called Open Source Softwar. Proprietary software: The Software whose Source code are not available for modification and re-distribution are called Open Proprietary software. f. Internet Message Access Protocol. Protocol for accessing e-mail from local server. g.(i) Mysql, ,Oracle, IBM DB2, MS Sql Server, Postgre SQL, SQLite (ii) OS/w, AS/400, BSD,SPARC Solaris

You might also like