ntw;wp ngw;wpl kdkhw tho;j;jfpd;nwd;...
|
|
- Virgil Holt
- 5 years ago
- Views:
Transcription
1 1
2 md;ghhe;j MrphpaHfs;> khzthfsf;f vdj gzpthd tzf;fq;fs;. NkYk;,e;j (Material)-y; 12k; tfg;g fzpg;nghwp,ay; khzthfsf;f vd cuthf;fg;gl;lj.,jpy; rp++ y; Nfl;fg;gLk; epuy;fspd; ntspaplfs;(output) kw;wk; gpiofis jpuj;jp (Error Correction) vojk; tpdf;fsf;fhd gjpy;fis nfhz;ls;sj.,jpy; khhr;-2007 Kjy; khhr;-2016 tiu nghjj; NjHtpy; Nfl;fg;gl;l Nfs;tpfSf;F tpilfis jahhpj;js;nsd;.,jid vlj;j Nfl;Lf;nfhs;fpNwd;. gapw;wtpj;j (m) gbj;j gad;ngwkhw gbj;j NjHtpy; ntw;wp ngw;wpl kdkhw tho;j;jfpd;nwd;...,j;njhfg;gpid gw;wpa fuj;jf;fis (gpiofs;> jtwfs;) vd;dld; gfph;e;jf;nfhs;s vd;w miyngrp vz;zpf;f njhlh;g nfhz;nlh> kpd;-mq;ry; Kfthpf;Nfh fuj;jfis mdg;gtk;...,q;qdk; cq;fs; eyd; fujk; jp.jpukiy>m.sc(cs).,b.ed., fzpdp MrphpaH, 2 vdk;
3 +2 fzpg;nghwp,ay; epuy;fspd; ntspaplfs; kw;wk; gpiofs; jpuj;jk; 7. gy;yuthf;fk; 1. rp++- epuypd; ntspapl vojf. (kh-11> [d;-07> mf;-08) Write the Output for given C++ Program: #include <iostream.h> #include <conio.h> class distance int feet,inches; void distance_assign(int f, int i) feet=f; inches=i; void display() cout<< \n Feet: <<feet<< \t Inches: <<inches; distance operator+(distance d2) distance d3; d3.feet=feet+d2.feet; d3.inches=(inches+d2.inches)%12; d3.feet+=(inches+d2.inches)/12; return d3; ; clrscr(); distance dist1,dist2; dist1.distance_assign(13,10); dist2.distance_assign(16,4); distance dist3=dist1+dist2; dist1.display(); clrscr(); distance dist1,dist2; dist1.distance_assign(12,11); dist2.distance_assign(24,2); distance dist3=dist1+dist2; dist1.display(); 3 clrscr(); distance d1,d2,d3; d1.distance_assign(24,11); d2.distance_assign(12,1); d=d1+d2; d1.display();
4 dist2.display(); dist3.display(); getch(); dist2.display(); dist3.display(); getch(); d2.display(); d3.display(); getch(); Output: Output: Output: Feet : 13 Inches : 10 Feet : 16 Inches : 4 Feet : 30 Inches : 2 Feet : 12 Inches : 11 Feet : 24 Inches : 2 Feet : 37 Inches : 13 Feet : 24 Inches : 11 Feet : 12 Inches : 1 Feet : 36 Inches : 0 (1) (2) (3) (4) gzpkpff;fg;gl;l gzpkpff;fg;gl;l gzpkpff;fg;gl;l gzpkpff;fg;gl;l nraw;fwpfis milahsk; fhz;f. cwg;gr; nraw;$wpd; Kd;tbit vojpf; fhl;lf. nraw;fwpapy; gad;glj;jg;gl;ls;s nranyw;gpfspd;,dk; ahj? cwg;gr; nraw;$wpid,aq;fk; $w;wpid vojpf; fhl;lf. tpil : (1) (2) (3) (4) + distance operator+(distance d2) object of distance class distance dist3=dist1+dist2 2. rp++- epuypd; ntspapl vojf.([d;-11> mf;-13) #include <iostream.h> #include <conio.h> float area(float r) cout<< \n Circle... ; return(22/7*r*r); float area(float k, float b, float h) cout<< \n Triangle... ; return(k*b*h); float area(float l, float b) cout<< \n Rectangle... ; return(l*b); cout<<area(3.0, 4.5) Write the Output for given C++ Program: Output: Rectangle Circle Triangle
5 cout<<area(5.0); cout<<area(0.5, 4.0, 6.0); getch(); 3. rp++- epuypd; ntspapl vojf. (mf;-12) #include <iostream.h) #include <conio.h> void fun(char a, int times) for(int i=1; i<=times; i++) cout<<<a<< \n ; void fun(int times=5, char a='*') for(int i=1; i<=times; i++) cout<<a<< \n ; Write the Output for given C++ Program: fun(3,'+'); fun(); Output : +++ ***** 4. gpd;tuk; rp++ epuypy; cs;s gpiofis jpuj;jp vojf. ([d;-12) Debug the Error for given C++ Program: #include <stdio.h> class number int i; void set() i=9; void display() cout>>i; void -operator() i=-1; ; number obj; obj.set(); -obj; obj.display(); 5
6 getch(); t.vz; 1 gpioahd epuy; rhpahd epuy; #include<stdio.h> #include <iostream.h> 4-5 Missing member function 11 cout>>i; cout<<i; 13 void-operator() void operator-() Closing set bracket missing nfhlf;fg;gl;l ntspapl;l ngwtjw;f gpd;tuk; rp++ epuypy; cs;s gpiofis jpuj;jp vojf. ([d;-15) Debug the Error for given C++ Program: output Feet : 12 Inches : 11 Feet : 24 Inches : 10 Feet : 36 Inches : 21 Program: #include <iostream.h> #include <conio.h> class distance int feet,inches; PUBLIC: void distance_assign(int f, int i) feet=f; inches=i; void display() cout<< \n Feet: >>feet; cout<< \n Inches: >>inches; distance operator+[distance d2] distance d3 6
7 d3.feet=feet+d2.feet; d3.feet=inches+d2.inches; return d3; ] ; clrscr(); distance dist1,dist2; dist1.distance_assign(12,11); dist2.distance_assign(24,10); distance dist3=dist1+dist2; dist1.display(); dist2.display(); dist3.display() getch(); t.vz; gpioahd epuy; rhpahd epuy; 6 PUBLIC: 9 feet=f; feet=f; 14 cout<< \n Feet >>feet; cout<< \n Feet <<feet; 15 cout<< \n Inches >>inches; cout<< \n Inches <<inches; 17 distance operator+[distance d2] distance operator+(distance d2) 19 distance d3 distance d3; 23 ] 34 dist3.display() dist3.display(); 8.Mf;fpfSk;> mopg;gpfsk; 6. rp++- epuypd; ntspapl vojf. (kh-07) Write the Output for given C++ Program: #include <iostream.h> #include <conio.h> class simple private: int a,b; simple(int x, int y) a=x; 7
8 b=y; ~simple() cout<< Destructor ; void putdata() cout<< A= <<a<< \n ; cout<< B= <<b; ; clrscr(); simple s(5,6); s.putdata(); getch(); Output : A=5 B=6 Destructor 7. nfhlf;fg;gl;l ntspapl;l ngwtjw;f gpd;tuk; rp++ epuypy; cs;s gpiofis jpuj;jp vojf. ([d;-07> mf;-14) Debug the Error for given C++ Program: #include <iostream.h> #include <conio.h> class simple private: int a,b public simple() a=0; b=0; cout>> \nconstructor of class-simple ; simple() cout<< \ndestructor of class-simple ; void getdata() Cout<< \nenter values for a and b ; cin<<a<<b; 8
9 void putdata() Cout<< \ntwo integers... <<a<<'\t'b; Cout<< \n The Sum of the variables... <<a+b; ; simple s; s.getdata(); s.putdata(); Output: Constructor of class-simple Enter values for a and b 6 7 Two integers The sum of the variables Destructor of class-simple t.vz; gpioahd epuy; rhpahd epuy; 6 int a,b int a,b; 7 public 12 cout>> \n Constructor of class-simple; cout<< \n Constructor of class-simple; 14 simple() ~simple() 20 Cout<< \n Enter values for a and b ; cout<< \n Enter values for a and b ; 21 cin<<a<<b; cin>>a>>b; 25 Cout<< \n Two integers...<<a<<'\t'b; cout<< \n Two integers...<<a<<'\t'<<b; 26 Cout<< \n The Sum of the variables... <<a+b; cout<< \n The Sum of the variables... <<a+b; 33 s.putdata() s.putdata(); 35 (is extra to be delete/remove ) 8. rp++- epuypd; ntspapl vojf. (mf;-07) Write the Output for given C++ Program: #include <iostream.h> #include<conio.h> class product 9
10 private: int x,y; product() x=0; y=0; cout<<\n Constructor of class product... ; ~product() cout<< \n Destructor of class product... ; Output : void getdata() Constructor of class product... The two integers are x=5; The product of the integers are y-10; Destructor of class product... void display() cout<< \n The two integers are... <<x<< \t <<y; cout<< \n The product of the integers are... <<x*y; ; product p; p.getdata(); p.display(); 9. rp++- epuypd; ntspapl vojf. (kh-08) Write the Output for given C++ Program: # include<iostream.h> #include<conio.h> class add int num1, num2, sum; add ( int s1, int s2 ) num1= s1; 10
11 num2=s2; add (add &a ) num1= a.num1; num2=a.num2; void putdata() cout<<sum; void addition() sum=num1+num2; ; add b (10, 20),c(b); b.addition(); c.addition(); b.putdata(); c.putdata(); getch(); Output : rp++- epuypd; ntspapl vojf. ([d;-08) Write the Output for given C++ Program: #include <iostream.h> #include <conio.h> class simple private: int a,b; simple() a=0; b=0; cout<< \n Welcome ; ~simple() cout<< \n Good Bye ; 11
12 void getdata() cout<< \n Value of a and b are 5 and 6 ; a=5; b=6; void putdata() cout<< The two integers are <<a<<'\t'<<b; cout<< \n The sum is <<a+b; ; simple s; s.getdata(); s.putdata(); Output : Welcome Value of a and b are 5 and 6 The two integers are 5 6 The sum is 11 Good Bye 11. nfhlf;fg;gl;l ntspapl;l ngwtjw;f gpd;tuk; rp++ epuypy; cs;s gpiofis jpuj;jp vojf. (vitnadk; gj;j gpiofs;) (kh-08) Debug the Error for given C++ Program: #include <stdio.h> class a int i; A() i=0; A(X) x=i; A(AX) i=x.i: ; void output() Output : cout>> i= >>i>> i=6 i=6 ; void main A a1(6), a2(a1) 12
13 a1.output(); a2.output. t.vz; gpioahd epuy; rhpahd epuy; 1 #include<stdio.h> #include<iostream.h> 2 class a class A 9 A(X) A(int x) 11 A(AX) A(A x) 13 i=x.i: i=x.i; 14 ; 17 cout>> i= >>i>> cout<< i= <<i; 20 void main 22 A a1(6),a2(a1) A a1(6),a2(a1); 24 a2.output. a2.output(); 25 is missing 12. nfhlf;fg;gl;l ntspapl;l ngwtjw;f gpd;tuk; rp++ epuypy; cs;s gpiofis jpuj;jp vojf. (mf;-08) Debug the Error for given C++ Program: #include <iostream.h> #include <conio.h> class simple private: int a,b; simple[ ] a=0; b=0; cout<< /n Constructor of class-simple ; ~~simple() cout<< \n Destructor of class-simple ; void generate(); coutput<< \n Enter value for a and b ; 13
14 cin a>>b; void putdata() cout<< \n Two integers... <<a<<'\t' b; cout<< \n The sum of the variables... <<a+b; ; simple S; S.getdata(); S.putdata(); Output : Constructor of class-simple Enter values for a and b 5 6 Two integers The sum of the variables Destructor of class-simple t.vz; gpioahd epuy; rhpahd epuy; 8 simple[ ] simple() 12 cout<< /n constructor of class-simple ; cout<< \n constructor of class-simple ; 14 ~~simple() ~simple() 18 void generate(); void getdata() 20 coutput<< \n Enter values for a and b ; cout< \n Enter values for a and b ; 21 cin a>>b; cin>>a>>b; 25 cout<< \n Two integer... <<a<<'\t' b; cout<< \n Two integer... <<a<<'\t'<<b; 35 is extra to be remove 13. nfhlf;fg;gl;l ntspapl;l ngwtjw;f gpd;tuk; rp++ epuypy; cs;s gpiofis jpuj;jp vojf. (vitnadk; gj;j gpiofs;) (kh-09> [d;-09) Debug the Error for given C++ Program: #includeiostream.h] class simple private; int a,b; 14
15 simple() a=0; b=0; cout<< /n Constructor of class-simple ;!simple() Cout<< \n Destructor of class-simple ; void get(); coutput<< \n Enter value for a and b... ; cin<<a<<b; void data() cout<< \n The two integers... <<a<<'\t' b; cout<< \n The sum of the variables... <<a+b; ; void () simp s; s.getdata(); s.putdata(); Output : Constructor of class-simple Enter values for a and b 2 4 Two integers The sum of the variables... 6 Destructor of class-simple t.vz; gpioahd epuy; rhpahd epuy; 1 #includeiostream.h] #include <iostream.h> 2 class simple() class simple 4 private; private: 11 cout<< /n constructor of class-simple ; cout<< \n constructor of class-simple ; 13!simple() ~simple() 15 Cout<< \n Destructor of class-simple ; cout<< \n Destructor of class-simple ; 17 void get() void getdata() 15
16 19 cin<<a<<b; cin>>a>>b; 20 void data() void putdata() 25 void () 26 simp s; simple s; 29 (one of must be delete. It's Extra) 14. rp++- epuypd; ntspapl vojf. ([d;-09) Write the Output for given C++ Program: #include <iostream.h> class add int sum; protected: int n1,n2; add() n1=n2=sum=0; cout<< \n Add Constructor ; void accept() n1=2; n2=2; void plus() sum=n1+n2; cout<< \n The sum of two nos is <<sum; ; class subtract:public add int sub; subtract() sub=0; cout<< \n Subtract constructor.. ; void minus() add::accept(); Output: 16 Add constructor Subtract constructor.. The sum of two nos is 4 The difference of two numbers is 0
17 sub=n1-n2; cout<< \n The difference of two numbers is <<sub; ; subtract s; s.accept(); s.plus(); s.minus(); 15. nfhlf;fg;gl;l ntspapl;l ngwtjw;f gpd;tuk; rp++ epuypy; cs;s gpiofis jpuj;jp vojf. (mf;;-09) Debug the Error for given C++ Program: # include<oistream.h> #include<conio.h> class add int num1, num2, sum; public add() cout<< \n Constructor without parameters.. ; num1= 0; num2= 0; sum = 0; ad ( int s1, int s2 ) cout<< \n parameterized constructor.. ; num1=s1; num2=s2; sum=null; add ( add a ) cout<< \n Copy constructor... ; num1= a.num1; num2=a.num2; sum=null; void getdata() num1=10; num2=20; 17
18 void putdata() cout<< \n The numbers are... ; cout<<num1< \t <num2; sum=num1+num; cout<< \n The sum of the numbers << sum; void main add ab (10, 20), c(b); a.getdata(); cout>> \n Object a : ; a.putdata(); cout>> \n Object b : ; b.putdata(); cout>> \n Object c : ; c.putdata(); Output : Constructor without parameters.. parameterized constructor... Copy constructor... Object a : The numbers are The sum of the numbers 30 Object b : The numbers are The sum of the numbers 30 Object c : The numbers are The sum of the numbers 30 t.vz; gpioahd epuy; rhpahd epuy; 1 #include <oistream.h> #include <iostream.h> 4 public 11 ad(int s1,int s2) add(int S1,int S2) 23 void getdata() Void getdata() 30 cout<<num1<'\t'<num2; cout<<num1<<'\t'<<num2; 32 sum=num1+num; sum=sum1+sum2; 33 Missing statement ; ; 34 void main 18
19 36 add ab(10,20),c(b); add a,b(10,20),c(b); 38 cout>> \n Object a : ; cout<< \n Object a : ; 40 cout>> \n Object b : ; cout<< \n Object b : ; 42 cout>> \n Object c : ; cout<< \n Object c : ; 16. rp++- epuypd; ntspapl vojf. (kh-10) Write the Output for given C++ Program: # include<iostream.h> #include<conio.h> class add int num1, num2, sum; add() cout<< \n Constructor without parameters.. ; num1= 0; num2= 0; sum = 0; add ( int s1, int s2 ) cout<< \n Parameterized constructor... ; num1= s1; num2=s2; sum=null; void getdata() Output : cout<< Enter data... ; Constructor without parameters.. cin>>num1>>num2; Parameterized constructor... Enter data void addition(add b) Object a : sum=num1+num2+b.num1+b.num2; The numbers are..2 3 The sum of the numbers are t35 void putdata() cout<< \n The numbers are.. ; cout<<num1<< \t <<num2; cout<< \n The sum of the numbers are <<'t'<< sum; ; add a, b (10, 20); a.getdata(); a.addition(b); 19
20 cout<< \n Object a : ; a.putdata(); getch(); 17. rp++- epuypd; ntspapl vojf. (a=20,b=70 vd;w nfhs;f) ([d;-08) Write the Output for given C++ Program: #include <iostream.h> #include <conio.h> class simple private: int a,b; simple() a=0; b=0; cout<< \n constructor of class simple \n ; ~simple() cout<< \n destructor of class simple \n ; void getdata() cout<< \n enter the value of a & b : ; cin>>a>>b; void putdata() cout<< two integers... <<a<< \n <<b; cout<< \n the sum of the variables...\n <<a+b; ; simple s; s.getdata(); s.putdata(); Output : constructor of class simple enter the value of a & b: two integers the sum of the variables destructor of class simple 18. sum=30 ntspapl;bid ngwtjw;f gpd;tuk; rp++ epuypy; cs;s gpiofis jpuj;jp vojf. ([d;;-10> mf;-10) Debug the Error for given C++ Program: 20
21 # include<oistream.h> #include<conio.h> class sum() private: int a=0,b=0; sum(); a=b=5; cout>> \n Constructor ; sum(); cout>> \n Destructor ; void inputdata ( int n1, int n2 ) cout<< \n parameterized constructor.. ; a=n1; b=n2; display() cout<< \n The numbers are... <<a<<b; cout<< \n The sum = a+b; ; sum s; s.inputdata(10); s.display(20); ; t.vz; gpioahd epuy; rhpahd epuy; 3 class sum() class sum 6 int a=b=0; int a,b; 8 sum(); sum() 11 cout>> \nconstructor ; cout<< \n Constructor ; 13 sum(); ~sum() 21
22 15 cout>> \ndestructor ; cout<< \n Destructor ; 25 cout<< \n The sum = a+b; cout<< \n The sum = <<a+b; 32 s.inputdata(10); s.inputdata(10,20); 33 s.display(20); s.display(); 34 ; ( semi-colon ; is not allowed) 19. gpd;tuk; rp++ epuypy; cs;s gpiofis jpuj;jp vojf. given C++ <iostream.h> class add int sum; protected: int num1;num2; void add(); num1=num2=sum=0; cout<< \n Add Constructor; void accept(); num1=12; num2=14; void plus(); sum=num1+num2; cout<<sum; class subtrac() int sub; void subtract(); sub=0; cout<< \n Subtract constructor void minus(); 22 (mf;;-11) Debug the Error for
23 add:accept(); sub=num1-num2; cout<<sub; ; subtract s; s.accept; s.plus; s.minus; t.vz; gpioahd epuy; rhpahd epuy; <iostream.h> #include <iostream.h> 8 void add(); void add() 11 cout<< \n Add Constructor; Cout<< \n Add Constructor ; 13 void accept(); void accept() 18 void plus(); void plus() 23 class subtrac() class subtract:public add 27 void subtract(); void subtract() 30 cout<< \n Subtract constructor cout<< \n Subtract constructor ; (is missing) 31 void minus(); void minus() 33 add:accept(); add::accept(); (is missing) 40 s.accept; s.accept(); 41 s.plus; s.plus(); 42 s.minus; s.minus(); 20. rp++- epuypd; ntspapl vojf. (kh-12) Write the Output for given C++ Program: #include <iostream.h> #include <conio.h> #include <string.h> class student private: char n[30]; int rno,m1,m2,total; 23
24 protected: void assign() rno=5; strcpy(n, Sri ); m1=78; m2=83; void compute() total=m1+m2; void display() cout<< \nrollno <<rno; cout<< \nname <<n; cout<< \nmark1 <<m1; cout<< \nmark2 <<m2; cout<<\ntotal <<total; void execute() assign(); compute(); display(); ; student stud; stud.execute(); Output: Rollno Name Mark1 Mark2 Total 5 Sri rp++- epuypd; ntspapl vojf. ([d;-12) Write the Output for given C++ Program: # include <iostream.h> #include <conio.h> class add int n1, n2, s; add() cout<< \n Constructor without parameters.. ; n1=n2=s=0; 24
25 add ( int s1, int s2 ) cout<< \n Parameterized constructor... ; n1= s1; n2=s2; add (add &a) cout<< \n Copy Constructor... ; n1= a.n1; n2=a.n2; void assign() n1=3; n2=2; void addition(add b) s=b.n1 + b.n2; add addition() add a(5,6); sum = num1 + num2 +a.num1 +a.num2; void put() cout<< \n The numbers are.. <<n1<< \t <<n2; cout<< \n Sum... << s; ; clrscr(); add a, b (15, 20); a.assign(); a.addition(a); a.addition(b); cout<< \n Object a : ; a.put(); cout<< \n Object b : ; b.put(); getch(); Output: Constructor without parameters.. Parameterized constructor... Copy Constructor... Copy Constructor... Object a : The numbers are..3 2 Sum... 5 Object b : The numbers are Sum
26 22. rp++- epuypd; ntspapl vojf. ([d;-08) Write the Output for given C++ Program: #include <iostream.h> #include <conio.h> class simple private: int a,b; simple() a=0; b=0; cout<< \n Constructor of class-simple ; ~simple() cout<< \n Destructor of class-simple ; void getdata(int x,int y) a=x; b=y; void putdata() cout<< The two integers are <<a<<'\t'<<b; cout<< \n The sum of variables <<a+b; ; simple s; s.getdata(5,6); s.putdata(); getch(); 23. rp++- epuypd; ntspapl vojf. ([d;-08) Output : Constructor of class-simple The two integers are 5 6 The sum of the variables 11 Destructor of class-simple Write the Output for given C++ Program: #include<iostream.h> #include<conio.h> class simple int a,b,sum; static int count; 26
27 void assign(int i,int j) a=i; b=j; sum = a+b; count++; void display() cout<< \n The sum of two numbers <<sum; cout<< \n Count <<count; ; int simple::count = 0; simple p1,p2,p3; p1.assign(10,20); p1.display(); p2.assign(20,30); p2.display(); p3.assign(30,40); p3.display(); Output: The sum of two numbers 30 Count 1 The sum of two numbers 50 Cout 2 The sum of two numbers 70 Cout nfhlf;fg;gl;l ntspapl;l ngwtjw;f gpd;tuk; rp++ epuypy; cs;s gpiofis jpuj;jp vojf. (vitnadk; gj;j gpiofs;) (mf;-13) Debug the Error for given C++ Program: #include [iostream.h] #include conio.h class simple() [ PRIVATE: int ab; simple[] a=0; b=0; cout>> \N Constructor of class-simple ;!simple() 27
28 Cout<< \n Destructor of class-simple ; void getdata[] cout<< \n Enter values for a and b... ; cout<<a<<b; void putdata() cout<< \N The two integers... <<a,<<'\t'<< b; cout<< \n The sum of the variables... <<a+b; void MAIN () Simp s; s.getdata(); s.putdata(); Output : Constructor of class-simple Enter values for a and b 2 4 Two integers The sum of the variables... 6 Destructor of class-simple t. vz; gpioahd epuy; rhpahd epuy; 1 #include [iostream.h] #include <iostream.h> 2 #include conio.h #include <conio.h> 3 class simple() class simple 4 [ 5 PRIVATE: private: 6 int ab; int a,b; 8 simple[] simple() 12 cout>> \N Constructor of class-simple ; cout<< \n Constructor of class-simple ; 14!simple() ~simple() 18 void getdata[] void getdata() 28
29 21 cout<<a<<b; cin>>a>>b; 25 cout<< \N The two integers... <<a,<<'\t'<< b; cout<< \n The two integers... <<a<<'\t'<< b; 28 ; 29 void MAIN() 31 Simp s; simple s; 25. rp++- epuypd; ntspapl vojf. (kh-14) Write the Output for given C++ Program: #include <iostream.h> #include <conio.h> class simple private: int a,b; simple() a=0; b=0; cout<< \n Hello ; ~simple() cout<< \n Bye ; void getdata() cout<< \n Value of a and b: ; a=5; b=6; void putdata() cout<< The two integers are <<a<<'\t'<<b; cout<< \n The sum is <<a+b; ; clrscr(); simple s; Output : Hello Value of a and b : The two integers are 5 6 The sum is 11 Bye 29
30 s.getdata(); s.putdata(); getch(); 26. rp++- epuypd; ntspapl vojf. ([d;-15) Write the Output for given C++ Program: # include <iostream.h> #include <conio.h> class sum int a,b, s; sum() cout<< \n Non-parameterized Constructor ; a=10; b=-20; s=0; sum( int c, int d) cout<< \n Parameterized constructor ; a=c; b=d; s=0; void addition() s=a+b; void putdata() cout<< \n The numbers are ; cout<<a<< \t <<b; cout<< \n The sum\t << s; ; clrscr(); add obj_1,obj_2(50,100); obj_1.addition(); obj_2.addition(); cout<< \n Object 1 : ; obj_1.putdata(); cout<< \n Object 2 : ; obj_2.putdata(); Output: Non-parameterized constructor Parameterized constructor Object 1 : The numbers are The sum -10 Object 2 : The numbers are The sum
31 getch(); 9. kughpkk; 27. nfhlf;fg;gl;l ntspapl;l ngwtjw;f gpd;tuk; rp++ epuypy; cs;s gpiofis jpuj;jp vojf. (kh-07>15> [d;-11>13) Debug the Error for given C++ Program: output: #include <iostream.h> class A private int a; public; int a2; void getdata a1=3; a2=5 a3=5; protected int a3; class B::public A() void func() int b1;b2;b3; getdata ; b1=a1; b2=a2; a3=b3; cout>>b1>>b2>>b3; void main B der; 31
32 d.func(); der.b3=0; t.vz; gpioahd epuy; rhpahd epuy; 4 private private: 5 int a; int a1; 6 public; 8 void getdata void getdata() 11 a2=5 a3=5; a2=5; a3=5; 13 protected protected: 15 ; 16 class B:: public A() class B:: public A 21 int b1;b2;b3; int b1,b2,b3; 22 getdata ; getdata(); 26 cout>>b1>>b2>>b3; cout<<b1<<b2<<b3; 28 ; 29 void main 32 d.func(); Der.func(); 33 der.b3=0; der.a3=0; vd;w miof;f KbahJ. fhuzk; mj protected vd tiuawf;fg;gl;ls;sj. 28. rp++ epuypy; cs;s gpiofis jpuj;jp vojf.([d;-08) output: Constructor Derived Constructor Derived Destructor Destructor #include <iostream.h> #include <conio.h> class base public 32 Debug the Error for given C++ Program:
33 base cout>> \n Constructor ; base() cout<< \n Destructor ; ; class derived? public base derived() cout<< \n Derived Constructor ; ~derived() cout<< \n Derived Destructor : ; derived x t.vz; gpioahd epuy; rhpahd epuy; 5 public 6 base base() 8 cout>> \n Constructor ; cout<< \n Constructor ; 10 base() ~base() 15 class derived? public base class derived:public base 20 cout<< \n Derived Destructor : cout<< \n Derived Destructor ; 27 void main 29 derived x derived x; 29. rp++- epuypd; ntspapl vojf. (kh-09> mf;-09>14) #include<iostream.h> #include<conio.h> 33 Write the Output for given C++ Program:
34 class base base() cout<< \nconstructor of base class... ; ~base() cout<< \ndestructor of base class... ; ; class derived1:public base public : derived1() cout << \nconstructor of derived1... ; ~derived1() cout << \ndestructor of derived1... ; ; class derived2:public base public : derived2() cout << \nconstructor of derived2... ; ~derived2() cout << \ndestructor of derived2... ; ; derived2 x; Output: Constructor of base class... Constructor of derived2... Destructor of derived2... Destructor of base class rp++ epuypy; cs;s gpiofis jpuj;jp vojf. (kh-13>14> [d;-14) Debug the Error for given C++ Program: 34
35 $include <iostream.h> #include conio.h class base PUBLIC: base[] cout>> \NConstructor of base class ; ^base() Cout<< \ndestructor of base class; ; class derived::public baseclass public : Derived() cout << \nconstructor of derived... ; ^derived() cout << \ndestructor of derived... ; ; void MAIN() derived x(5); Output: Constructor of base class... Constructor of derived... Destructor of derived... Destructor of base class... t.vz; gpioahd epuy; rhpahd epuy; 1 $include<iostream.h> #include<iostream.h> 2 #include conio.h include <conio.h> 35
36 5 PUBLIC: 6 base[ ] base( ) 8 cout>> \N constructor of base class ; cout<< \n constructor of base class ; 10 ^base( ) ~base( ) 12 Cout<< \ndestructor of base class; cout<< \ndestructor of base class ; 15 class::public baseclass class:public base 18 Derived( ) derived( ) 22 ^derived( ) ~derived() 27 void MAIN( ) void main( ) 29 derived x(5); derived x; 31. rp++- epuypd; ntspapl vojf. (mf;-10) Write the Output for given C++ Program: #include<iostream.h> #include<conio.h> class base base() clrscr(); cout<< \nconstructor of base class... ; ~base() cout<< \ndestructor of base class... ; ; class derived:public base public : derived() cout << \nconstructor of derived... ; ~derived() cout << \ndestructor of derived... ; ; 36
37 class derived2:public base public : derived2() cout << \nconstructor of derived2... ; ~derived2() cout << \ndestructor of derived2... ; ; derived b; derived c; base a; 32. rp++- epuypd; ntspapl vojf. (mf;-11) Output: Constructor of base class... Constructor of derived... Constructor of base class... Constructor of derived... Destructor of base class... Destructor of derived... Destructor of base class... Destructor of derived... Destructor of base class... Write the Output for given C++ Program: #include<iostream.h> #include<conio.h> class base base() cout<< \nconstructor of base class... ; ~base() cout<< \ndestructor of base class... ; ; class derived:public base public : derived() cout << \nconstructor of derived... ; ~derived1() 37
38 cout << \ndestructor of derived... ; ; class derived2:public base public : derived2() cout << \nconstructor of derived2... ; ~derived2() cout << \ndestructor of derived2... ; ; derived x1; derived2 x; Output: Constructor of base class... Constructor of derived... Constructor of base class... Constructor of derived2... Destructor of derived2... Destructor of base class... Destructor of derived... Destructor of base class rp++ epuypy; cs;s gpiofis jpuj;jp vojf. (kh-10) #include <iostream.h> class A private: int a1; public; int a2; protected: int a3; ; class B:public A() void func() int b1b2b3; b1=a1; b2=a2; b3=a3; 38 Debug the Error for given C++ Program:
39 ; void Main() B der; der.a3=0; der.func(); t.vz; gpioahd epuy; rhpahd epuy; 16 int b1 b2 b3; int b1,b2,b3; 17 b1=a1; a1 should be declared under protected or public 22 void Main() 25 der.a3=0; a3 should be declared under public to access it. 28 should be deleted 34. rp++ epuypy; cs;s gpiofis jpuj;jp vojf. (kh-11) #include <iostream.h> class base base() cout<< \nconstructor of base class ; ;base() cout<< \ndestructor of base class; class derived::public-base public derived() cout << \nconstructor of derived... ; 39 Debug the Error for given C++ Program:
40 !derived() cout << \ndestructor of derived... ; ; ; class derived:publicly derived2 derived2() cout<< \nconstructor of derved2 ;!derived2() cout<< \n Destructor of derived2 ; ; void base() x.derived2; x1.derived; ; t.vz; gpioahd epuy; rhpahd epuy; 8 ;base() ~base() 12 ; 13 class derived::public-base Class derived:public base 15 public 20!derived() ~derived() 23 ; 25 class derived:publicly derived2 class derived2:public derived 32! derived2() ~derived2() 37 void base() 39 x.derived2; derived2 x; 40 x1.derive; derived x1; 41 ; 35. rp++ epuypy; cs;s gpiofis jpuj;jp vojf. (kh-11) #include <isostream.h> 40 Debug the Error for given C++ Program:
41 class base public base() cout>> \nconstructor ; +base() cout>> \ndestructor ; ; class derived::public-base public der1() cin << \nconstructor ; ; der.obj; obj.der1(); t.vz; gpioahd epuy; rhpahd epuy; 1 #include<isostream.h> #include<iostream.h> 4 public 7 cout>> \nconstructor ; cout<< \nconstructor ; 9 +base() ~base() 11 cout>> \ndestructor ; cout<< \ndestructor ; is missing 13 class der::public base class der:public base 15 public 16 der1() der() 18 cin << \nconstructor ; cout << \nconstructor ; 23 der.obj; der obj; 24 obj.der1(); der obj1;
42 36. gpd;tuk; rp++ epuypy; cs;s gpiofis jpuj;jp vojf.(mf;;-12) Debug the Error for given C++ Program: class add ( int s=0; protected; int n1 n2; add[]; n1=n2=0; accept() cin>>n1>>n2; plus() s=n1+n2; ; class add:privetly subtract sub; subtract() sub=0; minus() add::acc(); sub=n1-n2; cout<<sub; ; void main[] obj subtract; obj.minus(); t.vz; gpioahd epuy; rhpahd epuy; 42
43 2 ( 4 protected; protected: 5 int n1 n2; Int n1,n2; 7 add[] add() 20 class add:privetly subtract class subtract:private add 22 sub; int sub; 25 sub=0 sub=0; is missing 28 add::acc(); add::accept(); 31 ; 32 ; 33 void main[] 35 obj subtract; subtract obj; 36 obj:minus(); obj.minus(); 37. nfhlf;fg;gl;l ntspapl;l ngwtjw;f gpd;tuk; rp++ epuypy; cs;s gpiofis jpuj;jp vojf. (kh-16) Debug the Error for given C++ Program: output Concatenated Strings...testrun Program: #include <iostream.h> #include<conio.h> #include<string.s> class strings Char s[10]; Public; Strings() S[0]= \0 ; string (char *c) strcopy(s,c); 43
44 Char * operator (strings x1) char *temp; strcopy(temp,s); strcat(temp,x1,s); return temp; ; void main[] clearscr(); strings s1( test ),$2( run\0 ); char *concatstr; concatstr=s1+s2; cout>> \nconcatenated strings... >>concatstr; t.vz; gpioahd epuy; rhpahd epuy; 3 #include<string.s> #include<string.h> 6 Char s[10]; char s[10]; 7 Public: 8 Strings() strings() 10 S[10]= \0 ; s[10]= \0 ; 12 string(char*c) strings(char*c) 14 strcopy(s,c); strcpy(s,c); 16 Char * operator-(strings x1) char operator-(strings x1) 19 strcopy(temp,s); strcpy(temp,s); 20 strcpy(temp,x1,s); strcpy(temp,x1.s); b/w is missing 23 void main[] 25 clearscr(); clrscr(); 26 strings s1( test ), $2( run\0 ); strings s1( test ), s2( run\0 ); 29 cout>> \n concatenate strings... >>concatstr; cout<< \n Concatenate Strings... <<concatstr; 38. rp++- epuypd; ntspapl vojf. (kh-16) Write the Output for given C++ Program: #include<iostream.h> 44
45 #include<conio.h> class sum int a,b,s; sum() cout<< \nconstructor without Parameters ; a=7; b=12; s=0; sum(int x, int y) cout<< \nparameterized Constructor ; a=x; b=y; s=0; void addition() s=a+b; void display() cout<< \nthe Numbers are ; cout<<a<<'\t'<<b; cout<< \nthe Sum = <<s; ; Output : Constructor without Parameters Parameterized Constructor... Object P The numbers are 7 12 The Sum = 19 Object Q The Numbers are The Sum = 33 45
46 y cq;fs; Nkyhd fuj;jf;fis cldf;fld; miyngrp> kpd;mq;ry; %yk; njhptpf;fkhw Nfl;Lf;nfhs;fpd;Nwd;... All the Best 46
1 md;ghhe;j MrphpaHfs;> khzthfsf;f vdj gzpthd tzf;fq;fs;. NkYk;,e;j (Material)-y; 12k; tfg;g fzpg;nghwp,ay; khzthfsf;f vd cuthf;fg;gl;lj.,jpy; rp++ y; Nfl;fg;gLk; epuy;fspd; ntspaplfs;(output) kw;wk; gpiofis
More informationcout<< \n Enter values for a and b... ; cin>>a>>b;
CHAPTER 8 CONSTRUCTORS AND DESTRUCTORS 8.1 Introduction When an instance of a class comes into scope, a special function called the constructor gets executed. The constructor function initializes the class
More informationCHAPTER 9 INHERITANCE. 9.1 Introduction
CHAPTER 9 INHERITANCE 9.1 Introduction Inheritance is the most powerful feature of an object oriented programming language. It is a process of creating new classes called derived classes, from the existing
More informationChapter-6 Classes and Objects. stud.execute(); getch();} Output:
Chapter-6 Classes and Objects Examples: 1.Specifying a class: class student char name[30]; int rollno,mark1,mark2,total_marks; void accept() cout>name>>rollno>>mark1>>mark2;
More informationData type of a pointer must be same as the data type of the variable to which the pointer variable is pointing. Here are a few examples:
Unit IV Pointers and Polymorphism in C++ Concepts of Pointer: A pointer is a variable that holds a memory address of another variable where a value lives. A pointer is declared using the * operator before
More informationPadasalai.Net Half Yearly Exam Model Question Paper
et et Padasalai.Net Half Yearly Exam 2018 - Model Question Paper COMPUTER SCIENCE XII STANDARD Time: 2.30 Hrs] [Max Marks: 70 Part I Choose the correct answer: 15 1 = 15 et et 1. is used to create Text
More informationSRE VIDYASAAGAR HIGHER SECONDARY SCHOOL
SRE VIDYASAAGAR HIGHER SECONDARY SCHOOL Sub : Computer Science Full Portion Exam Max. Mark : 150 Class : XII - EM Time : 3.00 Hrs PART - I I. Choose the correct answer. 75 x 1 = 75 1. Cut, copy, paste,
More informationDarshan Institute of Engineering & Technology for Diploma Studies
1. Explain Call by Value vs. Call by Reference Or Write a program to interchange (swap) value of two variables. Call By Value In call by value pass value, when we call the function. And copy this value
More informationCSE202-Lec#4. CSE202 C++ Programming
CSE202-Lec#4 Functions and input/output streams @LPU CSE202 C++ Programming Outline Creating User Defined Functions Functions With Default Arguments Inline Functions @LPU CSE202 C++ Programming What is
More informationOOP THROUGH C++(R16) int *x; float *f; char *c;
What is pointer and how to declare it? Write the features of pointers? A pointer is a memory variable that stores the address of another variable. Pointer can have any name that is legal for other variables,
More informationSample Paper Class XI Subject Computer Sience UNIT TEST II
Sample Paper Class XI Subject Computer Sience UNIT TEST II (General OOP concept, Getting Started With C++, Data Handling and Programming Paradigm) TIME: 1.30 Hrs Max Marks: 40 ALL QUESTIONS ARE COMPULSURY.
More informationKapil Sehgal PGT Computer. Science Ankleshwar Gujarat Chapter 6 Inheritance Extending a Class
Chapter 6 Inheritance Extending a Class Introduction; Need for Inheritance; Different form of Inheritance; Derived and Base Classes; Inheritance and Access control; Multiple Inheritance Revisited; Multilevel
More informationSURA's Guides for 3rd to 12th Std for all Subjects in TM & EM Available MARCH [1]
12 th STD. MARCH - 2017 [Time Allowed : 3 hours] COMPUTER SCIENCE with Answers [Maximum Marks : 150] PART-I Choose the most suitable answer from the given four alternatives and write the option code and
More informationDownloaded from
Unit I Chapter -1 PROGRAMMING IN C++ Review: C++ covered in C++ Q1. What are the limitations of Procedural Programming? Ans. Limitation of Procedural Programming Paradigm 1. Emphasis on algorithm rather
More informationC++ 8. Constructors and Destructors
8. Constructors and Destructors C++ 1. When an instance of a class comes into scope, the function that executed is. a) Destructors b) Constructors c) Inline d) Friend 2. When a class object goes out of
More informationOBJECT ORIENTED PROGRAMMING AND DATA STRUCTURES
Polymorphism: It allows a single name/operator to be associated with different operations depending on the type of data passed to it. An operation may exhibit different behaviors in different instances.
More informationSome important concept in oops are 1) Classes 2) Objects 3) Data abstraction & Encapsulation. 4) Inheritance 5) Dynamic binding. 6) Message passing
Classes and Objects Some important concept in oops are 1) Classes 2) Objects 3) Data abstraction & Encapsulation. 4) Inheritance 5) Dynamic binding. 6) Message passing Classes i)theentiresetofdataandcodeofanobjectcanbemadeauserdefineddatatypewiththehelpofaclass.
More informationDELHI PUBLIC SCHOOL TAPI
Loops Chapter-1 There may be a situation, when you need to execute a block of code several number of times. In general, statements are executed sequentially: The first statement in a function is executed
More informationPESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of MCA
INTERNAL ASSESSMENT Scheme and Solution -T2 Date : 30/3/2015 Max Marks : 50 Subject & Code : Object Oriented Programming with C++(13MCA22 ) Name of faculty : R.Jayanthi Time : 11.30 am -1.00 Pm Answer
More informationOBJECT ORIENTED PROGRAMMING. Ms. Ajeta Nandal C.R.Polytechnic,Rohtak
OBJECT ORIENTED PROGRAMMING Ms. Ajeta Nandal C.R.Polytechnic,Rohtak OBJECT ORIENTED PARADIGM Object 2 Object 1 Data Data Function Function Object 3 Data Function 2 WHAT IS A MODEL? A model is an abstraction
More informationCLASS-XI COMPUTER SCIENCE
Roll No. Code : 112014-083-A Please check that this question paper contains 7 questions and 8 printed pages. CLASS-XI COMPUTER SCIENCE Time Allowed : 3 Hrs. Maximum Marks : 70 General Instructions : All
More informationI SEMESTER EXAM : : XI :COMPUTER SCIENCE : MAX MARK a) What is the difference between Hardware and Software? Give one example for each.
I SEMESTER EXAM : : XI :COMPUTER SCIENCE : MAX MARK 70. a) What is the difference between Hardware and Software? Give one example for each. b) Give two differences between primary and secondary memory.
More informationADARSH VIDYA KENDRA NAGERCOIL COMPUTER SCIENCE. Grade: IX C++ PROGRAMMING. Department of Computer Science 1
NAGERCOIL COMPUTER SCIENCE Grade: IX C++ PROGRAMMING 1 C++ 1. Object Oriented Programming OOP is Object Oriented Programming. It was developed to overcome the flaws of the procedural approach to programming.
More informationHIGHER SECONDARY SECOND YEAR
HIGHER SECONDARY SECOND YEAR STD: 12 COMPUTER SCIENCE TIME : 2.30 HRS MODEL QUESTION PAPER - 1 MAX MARKS : 70 Part I Choose the correct answer: 15 * 1 = 15 1. A flashing vertical bar is called: (A) Mouse
More informationMAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) Subject Name: Object Oriented Programming
Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given in themodel answer scheme. 2) The model answer and the answer written by candidate may
More informationBRAIN INTERNATIONAL SCHOOL. Term-I Class XI Sub: Computer Science Revision Worksheet
BRAIN INTERNATIONAL SCHOOL Term-I Class XI 2018-19 Sub: Computer Science Revision Worksheet Chapter-1. Computer Overview 1. Which electronic device invention brought revolution in earlier computers? 2.
More information1. FIBONACCI SERIES. Write a C++ program to generate the Fibonacci for n terms. To write a C++ program to generate the Fibonacci for n terms.
PROBLEM: 1. FIBONACCI SERIES Write a C++ program to generate the Fibonacci for n terms. AIM: To write a C++ program to generate the Fibonacci for n terms. PROGRAM CODING: #include #include
More informationMAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) MODEL ANSWER
Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given in the model answer scheme. 2) The model answer and the answer written by candidate
More informationTHE NAME OF THE CONSTRUCTOR AND DESTRUCTOR(HAVING (~) BEFORE ITS NAME) FUNCTION MUST BE SAME AS THE NAME OF THE CLASS IN WHICH THEY ARE DECLARED.
Constructor and Destructor Member Functions Constructor: - Constructor function gets invoked automatically when an object of a class is constructed (declared). Destructor:- A destructor is a automatically
More informationKapil Sehgal PGT Computer. Science Ankleshwar Gujarat
Classes Chapter 4 Classes and Objects Data Hiding and Encapsulation Function in a Class Using Objects Static Class members Classes Class represents a group of Similar objects A class is a way to bind the
More informationVOLUME II CHAPTER 9 INTRODUCTION TO C++ HANDS ON PRACTICE PROGRAMS
VOLUME II CHAPTER 9 INTRODUCTION TO C++ HANDS ON PRACTICE PROGRAMS 1. Write C++ programs to interchange the values of two variables. a. Using with third variable int n1, n2, temp; cout
More informationASSIGNMENT CLASS-11 COMPUTER SCIENCE [C++]
ASSIGNMENT-1 2016-17 CLASS-11 COMPUTER SCIENCE [C++] 1 Consider the following C++ snippet: int x = 25000; int y = 2*x; cout
More informationCHAPTER 4 FUNCTIONS. 4.1 Introduction
CHAPTER 4 FUNCTIONS 4.1 Introduction Functions are the building blocks of C++ programs. Functions are also the executable segments in a program. The starting point for the execution of a program is main
More informationSt. Teresa School A Temple of Learning Shakti Khand II, Indirapuram, Ghaziabad Holiday Assignment ( ) Class: XI
St. Teresa School A Temple of Learning Shakti Khand II, Indirapuram, Ghaziabad Holiday Assignment (2018-19) Class: XI English Paste one prototype of advertisements (one each) in a separate folder. 2.Make
More information2. Distinguish between a unary, a binary and a ternary operator. Give examples of C++ operators for each one of them.
1. Why do you think C++ was not named ++C? C++ is a super set of language C. All the basic features of C are used in C++ in their original form C++ can be described as C+ some additional features. Therefore,
More informationFunctions. Introduction :
Functions Introduction : To develop a large program effectively, it is divided into smaller pieces or modules called as functions. A function is defined by one or more statements to perform a task. In
More informationAim : To Write a C++ Program that prints a Fibonacci series
Ex:B1 Fibonacci Series Aim : To Write a C++ Program that prints a Fibonacci series #include int f1 = -1, f2=1, f3, n, i; cout < < "\n\nenter the value of N : "; cin >> n ; cout < < "\n\nfibonacci
More informationDownloaded from
Function: A function is a named unit of a group of statements that can be invoked from other parts of the program. The advantages of using functions are: Functions enable us to break a program down into
More informationEXP 1.1 Operator Precedence. #include <iostream.h> Int main() { int a = 20, b = 10, c = 15,d = 5, e; e = (a + b) * c / d;
EXP 1.1 Operator Precedence #include Int main() int a = 20, b = 10, c = 15,d = 5, e; e = (a + b) * c / d; cout
More informationSubject: Fundamental of Computer Programming 2068
Subject: Fundamental of Computer Programming 2068 1 Write an algorithm and flowchart to determine whether a given integer is odd or even and explain it. Algorithm Step 1: Start Step 2: Read a Step 3: Find
More informationCAMBRIDGE SCHOOL, NOIDA ASSIGNMENT 1, TOPIC: C++ PROGRAMMING CLASS VIII, COMPUTER SCIENCE
CAMBRIDGE SCHOOL, NOIDA ASSIGNMENT 1, TOPIC: C++ PROGRAMMING CLASS VIII, COMPUTER SCIENCE a) Mention any 4 characteristic of the object car. Ans name, colour, model number, engine state, power b) What
More informationPESIT Bangalore South Campus
USN 1 P E PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of ECE INTERNAL ASSESSMENT TEST 2 Date : 03/10/2017 Marks: 40 Subject & Code : Object Oriented Programming
More informationBRAIN INTERNATIONAL SCHOOL Term-II Class-XI Sub:- Computer Science Revision Sheet
BRAIN INTERNATIONAL SCHOOL Term-II Class-XI 2018-19 Computer Organisation Sub:- Computer Science Revision Sheet 1. Which electronic device invention brought revolution in earlier computers? 2. Which memory
More information1. Answer the following : a) What do you mean by Open Source Software. Give an example. (2)
THE AIR FORCE SCHOOL Class XI First Terminal Examination 2017-18 Computer Science (083) Time: 3 hrs. M. Marks : 70 General Instructions : (i) All the questions are compulsory. (ii) Programming Language
More information1. a) Attempt any SIX of the following: Marks 12 i) What is Data abstraction?
Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given in the model answer scheme. 2) The model answer and the answer written by candidate
More informationMAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) MODEL ANSWER
Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given in the model answer scheme. 2) The model answer and the answer written by candidate
More informationKapi ap l S e S hgal P T C p t u er. r S. c S ienc n e A n A k n leshw h ar ar Guj u arat C C h - 8
Chapter 8 Introduction C++ Memory Map Free Stores Declaration and Initialization of pointers Dynamic allocation operators Pointers and Arrays Pointers and Const Pointers and Function Pointer and Structures
More informationExercise1. // classes first example. #include <iostream> using namespace std; class Rectangle. int width, height; public: void set_values (int,int);
Exercise1 // classes first example class Rectangle int width, height; void set_values (int,int); int area() return width*height; ; void Rectangle::set_values (int x, int y) width = x; height = y; int main
More informationIf the numbers are 5 and 2,
Chapter : 4 Functions Examples 1. An example for functions.[pg-94] int fact(int num) int factorial = 1; for(inta=1;a
More informationSURA BOOKS OCTOBER Choose the most appropriate answer : [75 1 = 75] (1) PART-I
OCTOBER - 2016 [Time : 3 hours] XII STD COMPUTER SCIENCE (With Answers) [Marks : 150] PART-I Choose the most appropriate answer : [75 1 = 75] 1. What value is stored in the variable c, if a = 5; c = a++;
More informationObject Oriented Pragramming (22316)
Chapter 1 Principles of Object Oriented Programming (14 Marks) Q1. Give Characteristics of object oriented programming? Or Give features of object oriented programming? Ans: 1. Emphasis (focus) is on data
More informationRAJA COLLEGE OF ENGINEERING & TECHNOLOGY
RAJA COLLEGE OF ENGINEERING & TECHNOLOGY (Affiliated to Anna University) Veerapanjan, Madurai-625 020 www.rajacet.ac.in DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING BACHELOR OF ENGINEERING THIRD SEMESTER
More informationChapter-13 USER DEFINED FUNCTIONS
Chapter-13 USER DEFINED FUNCTIONS Definition: User-defined function is a function defined by the user to solve his/her problem. Such a function can be called (or invoked) from anywhere and any number of
More informationDeveloped By Strawberry
Experiment No. 9 PART A (PART A: TO BE REFFERED BY STUDENTS) A.1 Aim: To study virtual functions and Polymorphism P1: Create a base class called 'SHAPE' having - two data members of type double - member
More informationProgramming Fundamentals II (C++ II) Final Exam June 17 th, Sun, 2007
Programming Fundamentals II (C++ II) Final Exam June 17 th, Sun, 2007 NAME:...Number:... Question 1 Define class section that has the following attributes: coursename, coursenumber as integer, credithours
More informationModule Operator Overloading and Type Conversion. Table of Contents
1 Module - 33 Operator Overloading and Type Conversion Table of Contents 1. Introduction 2. Operator Overloading 3. this pointer 4. Overloading Unary Operators 5. Overloading Binary Operators 6. Overloading
More informationFRIEND FUNCTIONS The syntax for friend function is class ABC { ======= public: ======= friend void function1(void); }
FRIEND FUNCTIONS Anonmemberfunctioncannothaveanaccesstotheprivate dataofaclass. In some situation,two classes like to share a particular function. C++ allows the common function to be made friendly with
More informationPROGRAMMING IN C LAB MANUAL FOR DIPLOMA IN ECE/EEE
PROGRAMMING IN C LAB MANUAL FOR DIPLOMA IN ECE/EEE 1. Write a C program to perform addition, subtraction, multiplication and division of two numbers. # include # include int a, b,sum,
More information---
Bharathi Hr. Sec. School, Reddipatty..1.. A. Prabhakar, M.C.A.,B.Ed., Enter the given text: Heaven from all creatures hides the book of fate. All but the page prescribe the present state. A hero perishes
More informationKENDRIYA VIDYALAYA ALIGANJ SHIFT-II HOLIDAY HOME WORK XII COMPUTER SCIENCE ARRAY AND STRUCTURES
KENDRIYA VIDYALAYA ALIGANJ SHIFT-II HOLIDAY HOME WORK- 2018-19 XII COMPUTER SCIENCE ARRAY AND STRUCTURES 1. Write a function which will take a string and returns the word count. Each word is separated
More informationPOINTERS INTRODUCTION: A pointer is a variable that holds (or whose value is) the memory address of another variable and provides an indirect way of accessing data in memory. The main memory (RAM) of computer
More informationCONSTRUCTORS AND DESTRUCTORS
UNIT-II CONSTRUCTORS AND DESTRUCTORS Contents: Constructors Default constructors Parameterized constructors Constructor with dynamic allocation Copy constructor Destructors Operator overloading Overloading
More informationThe syntax of structure declaration is. struct structure_name { type element 1; type element 2; type element n;
Structure A structure is a user defined data type. We know that arrays can be used to represent a group of data items that belong to the same type, such as int or float. However we cannot use an array
More informationLAB MANUAL OBJECT ORIENTED PROGRAMMING LAB (IT- 202 F) (DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING)
LAB MANUAL OBJECT ORIENTED PROGRAMMING LAB (IT- 202 F) (DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING) (Reason behind the object oriented lab) Mission To develop Akido college of Engineering & Technology
More information«ï è : Fibonacci ªî ì ó Ü C C++ Gó ô â î. Pº ø : àœk : Enter the value of N : 5. ªõOf : Fibonacci Series. «ï è : ªî ì ªð ¼ è ô è ìp» C++ Gó ô â î
Ex:B1 Fibonacci Series «ï è : Fibonacci ªî ì ó Ü C C++ Gó ô â î int f1=0, f2=1, f3, n, i; cout < < "\nenter the value of N : "; cin >> n ; cout < < "\n\nfibonacci Series\n"; cout < < f1 < < "\t" < < f2
More informationSolution: A pointer is a variable that holds the address of another object (data item) rather than a value.
1. What is a pointer? A pointer is a variable that holds the address of another object (data item) rather than a value. 2. What is base address? The address of the nth element can be represented as (a+n-1)
More informationEAS 230 Fall 2002 Section B
EAS 230 Fall 2002 Section B Exam #2 Name: Person Number: Instructions: ƒ Total points are 100, distributed as shown by [ ]. ƒ Duration of the Exam is 50 minutes. I ) State whether True or False [25] Indicate
More informationINHERITANCE. PART I Choose the correct answers
m m Unit - IV CHAPTER 16 m m INHERITANCE m m PART I Choose the correct answers m m 1. Which of the followingis the process of creating new classes from an existing class (a) Polymorphism (b) Inheritance
More informationC Programming Lecture V
C Programming Lecture V Instructor Özgür ZEYDAN http://cevre.beun.edu.tr/ Modular Programming A function in C is a small sub-program that performs a particular task, and supports the concept of modular
More informationHOLIDAY HOMEWORK ASSIGNMENT-5 Q1. What will be the output of the following program segment Class Num { int x; float y; public: void init( ) { x = y =
HOLIDAY HOMEWORK ASSIGNMENT-5 Q1. What will be the output of the following program segment Class Num { int x; float y; void init( ) { x = y = 0; void read(int i, float j) { x = i; y = j; void Display (
More informationBE III Semester ISE Page 1 of 1
Scheme of Valuation Date : 29-09-2015 Max Marks : 50 Marks Subject & Code: Object Oriented Programming with C++ (10CS36) Semester & Section: III A & B Name of Faculty: Prof.Sandesh & Mrs.Saritha Time :
More informationProgramming in C++ (Educational Support)
Programming in C++ (Educational Support) http:// 1. WRITE A PROGRAM TO TRAVERSING OF AN ARRAY. #include # include void main () int a [10], lb = 1, ub, k, I; cout
More informationKENDRIYA VIDYALAYA SANGATHAN, GUWAHATI REGION HALF-YEARLY EXAMINATION-2015 CLASS XI : COMPUTER SCIENCE Time Allotted : 3 hrs. Max.
KENDRIYA VIDYALAYA SANGATHAN, GUWAHATI REGION HALF-YEARLY EXAMINATION-2015 CLASS XI : COMPUTER SCIENCE Time Allotted : 3 hrs. Max. Marks : 70 Q.1..... operator in C++, requires three operands. [1] Q.2
More informationObject Oriented Programming Using C++ Mathematics & Computing IET, Katunayake
Assigning Values // Example 2.3(Mathematical operations in C++) float a; cout > a; cout
More informationAbstraction in C++ Abstraction is the concept of exposing only the required essential characteristics and behavior
Abstraction in C++ Abstraction is the concept of exposing only the required essential characteristics and behavior with respect to a context. Hiding of data is known as data abstraction. In object oriented
More informationC++ is case sensitive language, meaning that the variable first_value, First_Value or FIRST_VALUE will be treated as different.
C++ Character Set a-z, A-Z, 0-9, and underscore ( _ ) C++ is case sensitive language, meaning that the variable first_value, First_Value or FIRST_VALUE will be treated as different. Identifier and Keywords:
More informationIV Unit Second Part STRUCTURES
STRUCTURES IV Unit Second Part Structure is a very useful derived data type supported in c that allows grouping one or more variables of different data types with a single name. The general syntax of structure
More informationOBJECTS. An object is an entity around us, perceivable through our senses. Types of Object: Objects that operate independently.
OBJECTS An object is an entity around us, perceivable through our senses. Types of Object: Objects that operate independently. Objects that work in associations with each others. Objects that frequently
More informationBangalore South Campus
INTERNAL ASSESSMENT TEST 1(Solutions) Date :01/03/2017 Max Marks: 40 Subject& Code: Object Oriented Concepts (15CS45) Sem:VII ISE Name of the faculty: Miss Pragyaa Time: 90 minutes Note: Answer to all
More informationSample Paper - II Subject Computer Science
Sample Paper - II Subject Computer Science Max Marks 70 Duration 3 hrs Note:- All questions are compulsory Q1) a) What is significance of My Computer? 2 b) Explain different types of operating systems.
More informationPadasalai.Net s Model Question Paper
Padasalai.Net s Model Question Paper STD: XII VOLUME - 2 MARKS: 150 SUB: COMPUTER SCIENCE TIME: 3 HRS PART I Choose the correct answer: 75 X 1 = 75 1. Which of the following is an object oriented programming
More informationARRAYS. Part II Answers to all the questions (2 Marks):
Unit - III Arrays and Structures CHAPTER - 12 ARRAYS PART I Choose the correct answer. 1. Which of the following is the collection of variables of the same type that an referenced by a common name? a)
More informationDE122/DC106 Object Oriented Programming with C++ DEC 2014
Q.2 a. Distinguish between Procedure-oriented programming and Object- Oriented Programming. Procedure-oriented Programming basically consists of writing a list of instructions for the computer to follow
More informationDE70/DC56/DE122/DC106 OBJECT ORIENTED PROGRAMMING WITH C++ DEC 2015
Q.2 a. Define Object-oriented programming. List and explain various features of Object-oriented programming paradigm. (8) 1. Inheritance: Inheritance as the name suggests is the concept of inheriting or
More informationObject Oriented Programming
F.Y. B.Sc.(IT) : Sem. II Object Oriented Programming Time : 2½ Hrs.] Prelim Question Paper Solution [Marks : 75 Q.1 Attempt the following (any THREE) [15] Q.1(a) Explain encapsulation? [5] (A) The wrapping
More informationUNIT POLYMORPHISM
UNIT 3 ---- POLYMORPHISM CONTENTS 3.1. ADT Conversions 3.2. Overloading 3.3. Overloading Operators 3.4. Unary Operator Overloading 3.5. Binary Operator Overloading 3.6. Function Selection 3.7. Pointer
More informationREPETITION CONTROL STRUCTURE LOGO
CSC 128: FUNDAMENTALS OF COMPUTER PROBLEM SOLVING REPETITION CONTROL STRUCTURE 1 Contents 1 Introduction 2 for loop 3 while loop 4 do while loop 2 Introduction It is used when a statement or a block of
More information22316 Course Title : Object Oriented Programming using C++ Max. Marks : 70 Time: 3 Hrs.
Scheme I Sample Question Paper Program Name : Computer Engineering Program Group Program Code : CO/CM/IF/CW Semester : Third 22316 Course Title : Object Oriented Programming using C++ Max. Marks : 70 Time:
More informationGovernment Polytechnic, Muzaffarpur. Name of the Lab: OBJECT ORIENTED PROGRAMMING
Government Polytechnic, Muzaffarpur. Name of the Lab: OBJECT ORIENTED PROGRAMMING THROUGH C++ Practical: OOPS THROUGH C++ Subject Code: 1618407 PROGRAM NO.1 Programming exercise on executing a Basic C++
More informationOBJ. ORI.& MULT. PROG., M.C.Q. BANK, FOR UNIT -2, SECOND YEAR COMP. ENGG. SEM-4, 2012 PATTERN, U.O.P. UNIT-2
UNIT-2 Syllabus for Unit-2 Introduction, Need of operator overloading, overloading the assignment, binary and unary operators, overloading using friends, rules for operator overloading, type conversions
More informationWT I (SET-I) Date: Class XI Sec. Time: 1 Hr. 10 min. Computer Science M.M.: 30
WT I (SET-I) Date: Class XI Sec. Time: 1 Hr. 10 min. Computer Science M.M.: 30 Name Roll No. Instructions: a) All questions are compulsory. b) There are 15 questions in this paper and each question carries
More informationUnit III Virtual Functions. Developed By Ms. K.M.Sanghavi
Unit III Virtual Functions Developed By Ms. K.M.Sanghavi Topics Pointers- indirection Operators Memory Management: new and delete : Slide 23-24 / (Covered In Unit I Too) Accessing Arrays using pointers
More informationPOINTERS - Pointer is a variable that holds a memory address of another variable of same type. - It supports dynamic allocation routines. - It can improve the efficiency of certain routines. C++ Memory
More information- HALF YEARLY EXAM ANSWER KEY DEC-2016 COMPUTER SCIENCE ENGLISH MEDIUM
www.padasalai.net - HALF YEARLY EXAM ANSWER KEY DEC-2016 COMPUTER SCIENCE ENGLISH MEDIUM 1 A 26 D 51 C 2 C 27 D 52 D 3 C 28 C 53 B 4 A 29 B 54 D 5 B 30 B 55 B 6 A 31 C 56 A 7 B 32 C 57 D 8 C 33 B 58 C
More informationAC55/AT55 OBJECT ORIENTED PROGRAMMING WITH C++ DEC 2013
Q.2 a. Discuss the fundamental features of the object oriented programming. The fundamentals features of the OOPs are the following: (i) Encapsulation: It is a mechanism that associates the code and data
More informationIt is necessary to have a single function main in every C program, along with other functions used/defined by the programmer.
Functions A number of statements grouped into a single logical unit are called a function. The use of function makes programming easier since repeated statements can be grouped into functions. Splitting
More informationLaboratory 0 Week 0 Advanced Structured Programming An Introduction to Visual Studio and C++
Laboratory 0 Week 0 Advanced Structured Programming An Introduction to Visual Studio and C++ 0.1 Introduction This is a session to familiarize working with the Visual Studio development environment. It
More information2016 COMPUTER SCIENCE
Total number of printed pages: 5 Total marks : 70 2016 COMPUTER SCIENCE Time : 3 hours General instructions: i) Approximately 15 minutes is allotted to read the question paper and revise the answers. ii)
More informationSolved Exercises from exams: Midterm(1)
Solved Exercises from exams: Midterm(1) 1431-1432 1. What is the output of the following program: #include void fun(int *b) *b = *b+10; main() int a=50; fun(&a); cout
More informationChapter : 5 Structure data types Arrays. <<reverse[i]<< \n ; getch(); } Output:
Chapter : 5 Structure data types Arrays Examples: 1.Arrays and basic manipulation on arrays: [Pg-128] int a[5], ctr = 0, sum; for(;ctra[ctr]; for(ctr=0, sum=0;ctr
More information