SlideShare a Scribd company logo
1 of 7
Download to read offline
-.
[This question paper contains 6 printed pages.]
Sr. No. ofQuestion Paper 6065 D Your Roll No................
Unique Paper Code 2341011251305
Narne of the Course B.Sc. (Hons.) Computer Science I B.Sc. (Hons.) Electronics
Name of the Paper Fundamental of Programming
Semester I I III
Duration : 3 Hours Maximum Marks: 75
Instructions for Candidates
1. Write your Roll No. on the top immediately on receipt of this question paper.
2. There are two parts in the Question Paper.
3. Parts of a Question should be attempted together.
4. Part I : All its questions are compulsory.
5. Part II : Attempt any four questions.
PART I
Question No. 1 is compulsory.
Parts of the question should be attempted together.
1. (a) How.is (-5)10
represented in 2's complement form using 6 bits? (4)
(b) Differentiate between the following :
(i) Runtime polymorphism and compile time polymorphism
(ii) Call by value and call by reference
(iii) Public and private access type.
(c) Give output of the following code segments :
(6)
(i) If x=O, y=O, and z=1, what are the values of x, y, and z after executing
the following code ? (3)
PT.O.
TutorialsD
uniya.com
Visit https://www.tutorialsduniya.com forNotes, books, programs, question papers with solutions etc.
Visit https://www.tutorialsduniya.com forNotes, books, programs, question papers with solutions etc.
For any query, contact us at help@tutorialsduniya.com
6065 2
if(z < x II y >= z && z == 1)
if(z && y)
y= 1;
else
x= 1;
(ii) string strl ("DU University");
string str2 ("DU Union");
int result;
result= strl.compare(str2);
cout <<result;
result = strl.compare(O, 6, str2);
cout << result;
(iii) int a=15·int b=9·int c·
' ' '
int* p = &b; int* q;
int* r;
q=p;
r=&c;
p=&a;
*q=8;
*r=*p;
*r=a+*q+*&c;
cout <<*p<<" " << *q << " " << *r <<endl;
(iv) int i;
int list[10] = {2, 1, 2, 4, 1, 2, 0, 2, 1, 2};
int res [10];
for(i=O;i<1O;i++)
res[i]=list[9-i];
for(i=O;i< 1O;i++)
cout <<res[i]<<" ";
(4)
"'.-
(3)
(5)
TutorialsD
uniya.com
Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.
Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.
For any query, contact us at help@tutorialsduniya.com
J
6065 3
(d) If four objects of a class are defined, how many copies of class data items
are stored in the memory and how many copies of its functions ? (2)
(e) What are friend functions? What are their advantages?
(f) Find errors in the following code segment :
(i) int main()
{ int i=5;
while(i)
{ switch(i)
{
}
i--·
'
}
}
(ii) #include<iostream>
using namespace std;
intmain()
{
int i = 0;
i=i+1;
cout << i << " ";
default:
case 4:
case 5:
case 1:
break;
continue;
case 2:
case 3:
break;
/* comment*//i = i + 1;
cout << i;
}
(4)
(2)
(2)
P.TO.
TutorialsD
uniya.com
Visit https://www.tutorialsduniya.com forNotes, books, programs, question papers with solutions etc.
Visit https://www.tutorialsduniya.com forNotes, books, programs, question papers with solutions etc.
For any query, contact us at help@tutorialsduniya.com
- - - - - - - - - - - - - - - - - -
6065 4
PART II
Attempt any four questions.
2. (a) We have two arrays A and B, each of 10 integers. Write a function that tests
if every element of array A is equal to its corresponding element in arrays
B. In other words, the function must check ifA[O] is equal to B[O], A[1] is
equal to B[ 1], and so forth. (5)
(b) What are the static members of a class ? What are the restrictions on static
function members ? (5)
3. (a) If originally x = 3 andy= 5, what are the values of x andy after evaluation
of each of the following expressions ?
(i) x++ + y
(ii) ++x + 2 (4)
(b) What do you understand by function overloading ? How is it different from
function overriding? Give an example of function overloading. (6)
4. (a) Write a C++ program to count occurrences of character 'a' and ' A' in a
given string. (5)
(b) Write a function which returns the number of times an element occurs in an
array. The array and the element to be searched are passed as arguments to
the functions. (5)
5. (a) Differentiate between binary files and text files in C++. (4)
(b) What is copy constructor? Explain with example. (4)
(c) Rewrite the following code fragment using a switch statement: (2)
if(ch == 'E' II ch == 'e')
countE++;
TutorialsD
uniya.com
Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.
Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.
For any query, contact us at help@tutorialsduniya.com
6065 5
elseif(ch =='A' II ch =='a')
countA++;
elseif(ch =='I' II ch == 'i')
count!++;
else
cout << "Error- Not A, E, or I n";
6. (a) Create a class TwoDim which contains x andy coordinates as int. Define the
default constructor, parameterized constructor and void print() to print the
co-ordinates. Now reuse this class in ThreeDim adding a new dimension as
z of type int. Define the constructors for the derived class artd override the
method void print() in the subclass. Write main() to show runtime
polymorphism.
(b) Write a C++ statement for the following expression :
c = ~a2
+ b
2
- 2ab
(8)
(2)
7. (a) Consider the following class definition. What data members and functions
are directly accessible by the functions readit(), inform(), and B(). (3)
void inform(void);
class X
{
} ;
int a;
float b;
void init(void);
public:
char ch;
char gett(void);
protected:
double amt;
void getamt(void);
friend void A(void);
PT.O.
-__r
TutorialsD
uniya.com
Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.
Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.
For any query, contact us at help@tutorialsduniya.com
I
~.
6065
class Y: public X
{
};
int x;
public:
intj;
void read(void);
protected:
void info(void);
friend void B(void);
6
(b) Find the error(s) in the following code segment:
class x {............. };
classy {............. };
class z {.............};
void alpha() throw(x,y)
{
throw z();
}
(2)
(c) What is the sequence of constructors and destructors being called in a
multilevel inheritance where class A is parent class of class B, class C is
derived class of ~lass B, class D is derived class of class C ? (5)
(1300)
TutorialsD
uniya.com
Visit https://www.tutorialsduniya.com forNotes, books, programs, question papers with solutions etc.
Visit https://www.tutorialsduniya.com forNotes, books, programs, question papers with solutions etc.
For any query, contact us at help@tutorialsduniya.com
TUTORIALSDUNIYA.COM
Get FREE Compiled Books, Notes, Programs, Question Papers with Solution
etc of the following subjects at https://www.tutorialsduniya.com
 C and C++  Computer System Architecture
 Java  Discrete Structures
 Data Structures  Operating Systems
 Computer Networks  Algorithms
 Android Programming  DataBase Management Systems
 PHP Programming  Software Engineering
 JavaScript  Theory of Computation
 Java Server Pages  Operational Research
 Python  System Programming
 Microprocessor  Data Mining
 Artificial Intelligence  Computer Graphics
 Machine Learning  Data Science
DU Programs: https://www.tutorialsduniya.com/programs
TutorialsDuniya App: http://bit.ly/TutorialsDuniyaApp
C++ Tutorial: https://www.tutorialsduniya.com/cplusplus
Java Tutorial: https://www.tutorialsduniya.com/java
JavaScript Tutorial: https://www.tutorialsduniya.com/javascript
Python Tutorial: https://www.tutorialsduniya.com/python
Kotlin Tutorial: https://www.tutorialsduniya.com/kotlin
JSP Tutorial: https://www.tutorialsduniya.com/jsp

More Related Content

What's hot

What's hot (20)

header, circular and two way linked lists
header, circular and two way linked listsheader, circular and two way linked lists
header, circular and two way linked lists
 
C programming project by navin thapa
C programming project by navin thapaC programming project by navin thapa
C programming project by navin thapa
 
Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILE
 
FORESTS
FORESTSFORESTS
FORESTS
 
Input and output in C++
Input and output in C++Input and output in C++
Input and output in C++
 
File and directories in python
File and directories in pythonFile and directories in python
File and directories in python
 
System Programming Unit II
System Programming Unit IISystem Programming Unit II
System Programming Unit II
 
Phases of compiler
Phases of compilerPhases of compiler
Phases of compiler
 
Programing fundamentals with C++
Programing fundamentals with C++Programing fundamentals with C++
Programing fundamentals with C++
 
loaders and linkers
 loaders and linkers loaders and linkers
loaders and linkers
 
Structure in c
Structure in cStructure in c
Structure in c
 
Token, Pattern and Lexeme
Token, Pattern and LexemeToken, Pattern and Lexeme
Token, Pattern and Lexeme
 
Unit 3 graph chapter6
Unit 3  graph chapter6Unit 3  graph chapter6
Unit 3 graph chapter6
 
Project report
Project reportProject report
Project report
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
 
Dead Code Elimination
Dead Code EliminationDead Code Elimination
Dead Code Elimination
 
compiler vs interpreter
compiler vs interpretercompiler vs interpreter
compiler vs interpreter
 
Access specifiers (Public Private Protected) C++
Access specifiers (Public Private  Protected) C++Access specifiers (Public Private  Protected) C++
Access specifiers (Public Private Protected) C++
 
Intermediate code generation in Compiler Design
Intermediate code generation in Compiler DesignIntermediate code generation in Compiler Design
Intermediate code generation in Compiler Design
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 

Similar to Programming fundamentals using c++ question paper 2014 tutorialsduniya

Devry CIS 355A Full Course Latest
Devry CIS 355A Full Course LatestDevry CIS 355A Full Course Latest
Devry CIS 355A Full Course LatestAtifkhilji
 
Computer Science Sample Paper 2
Computer Science Sample Paper 2Computer Science Sample Paper 2
Computer Science Sample Paper 2kvs
 
Page 1 Multiple Choice QuestionsQuestion 1.1. (TCO 1) What.docx
Page 1 Multiple Choice QuestionsQuestion 1.1. (TCO 1) What.docxPage 1 Multiple Choice QuestionsQuestion 1.1. (TCO 1) What.docx
Page 1 Multiple Choice QuestionsQuestion 1.1. (TCO 1) What.docxalfred4lewis58146
 
Sem 1 bscit summer 2014 solved assignments
Sem 1 bscit summer 2014 solved assignmentsSem 1 bscit summer 2014 solved assignments
Sem 1 bscit summer 2014 solved assignmentssmumbahelp
 
Problem solving technique &amp; programming in c code 303204 bca 2nd...
Problem solving technique &amp; programming in c   code  303204   bca     2nd...Problem solving technique &amp; programming in c   code  303204   bca     2nd...
Problem solving technique &amp; programming in c code 303204 bca 2nd...umesh singh
 
CS Sample Paper 1
CS Sample Paper 1CS Sample Paper 1
CS Sample Paper 1kvs
 
Model questions-b.sc .csit-6th-sem
Model questions-b.sc .csit-6th-semModel questions-b.sc .csit-6th-sem
Model questions-b.sc .csit-6th-semNayanBakhadyo
 
Devry CIS 247 Full Course Latest
Devry CIS 247 Full Course LatestDevry CIS 247 Full Course Latest
Devry CIS 247 Full Course LatestAtifkhilji
 
Cs141 mid termexam v1
Cs141 mid termexam v1Cs141 mid termexam v1
Cs141 mid termexam v1Fahadaio
 
Gsp 125 Education Organization -- snaptutorial.com
Gsp 125   Education Organization -- snaptutorial.comGsp 125   Education Organization -- snaptutorial.com
Gsp 125 Education Organization -- snaptutorial.comDavisMurphyB85
 
GSP 125 Enhance teaching/tutorialrank.com
 GSP 125 Enhance teaching/tutorialrank.com GSP 125 Enhance teaching/tutorialrank.com
GSP 125 Enhance teaching/tutorialrank.comjonhson300
 
GSP 125 Effective Communication/tutorialrank.com
 GSP 125 Effective Communication/tutorialrank.com GSP 125 Effective Communication/tutorialrank.com
GSP 125 Effective Communication/tutorialrank.comjonhson282
 
GSP 125 Enhance teaching - snaptutorial.com
GSP 125   Enhance teaching - snaptutorial.comGSP 125   Enhance teaching - snaptutorial.com
GSP 125 Enhance teaching - snaptutorial.comDavisMurphyA81
 
GSP 125 Exceptional Education - snaptutorial.com
GSP 125 Exceptional Education - snaptutorial.comGSP 125 Exceptional Education - snaptutorial.com
GSP 125 Exceptional Education - snaptutorial.comdonaldzs162
 
GSP 125 Education Specialist / snaptutorial.com
  GSP 125 Education Specialist / snaptutorial.com  GSP 125 Education Specialist / snaptutorial.com
GSP 125 Education Specialist / snaptutorial.comstevesonz146
 

Similar to Programming fundamentals using c++ question paper 2014 tutorialsduniya (20)

Devry CIS 355A Full Course Latest
Devry CIS 355A Full Course LatestDevry CIS 355A Full Course Latest
Devry CIS 355A Full Course Latest
 
Fic (sendup dec17) cs lb
Fic (sendup dec17) cs lbFic (sendup dec17) cs lb
Fic (sendup dec17) cs lb
 
Fic (sendup dec17) cs lb
Fic (sendup dec17) cs lbFic (sendup dec17) cs lb
Fic (sendup dec17) cs lb
 
Computer Science Sample Paper 2
Computer Science Sample Paper 2Computer Science Sample Paper 2
Computer Science Sample Paper 2
 
Page 1 Multiple Choice QuestionsQuestion 1.1. (TCO 1) What.docx
Page 1 Multiple Choice QuestionsQuestion 1.1. (TCO 1) What.docxPage 1 Multiple Choice QuestionsQuestion 1.1. (TCO 1) What.docx
Page 1 Multiple Choice QuestionsQuestion 1.1. (TCO 1) What.docx
 
Sem 1 bscit summer 2014 solved assignments
Sem 1 bscit summer 2014 solved assignmentsSem 1 bscit summer 2014 solved assignments
Sem 1 bscit summer 2014 solved assignments
 
Problem solving technique &amp; programming in c code 303204 bca 2nd...
Problem solving technique &amp; programming in c   code  303204   bca     2nd...Problem solving technique &amp; programming in c   code  303204   bca     2nd...
Problem solving technique &amp; programming in c code 303204 bca 2nd...
 
CS Sample Paper 1
CS Sample Paper 1CS Sample Paper 1
CS Sample Paper 1
 
Model questions-b.sc .csit-6th-sem
Model questions-b.sc .csit-6th-semModel questions-b.sc .csit-6th-sem
Model questions-b.sc .csit-6th-sem
 
Devry CIS 247 Full Course Latest
Devry CIS 247 Full Course LatestDevry CIS 247 Full Course Latest
Devry CIS 247 Full Course Latest
 
Cs141 mid termexam v1
Cs141 mid termexam v1Cs141 mid termexam v1
Cs141 mid termexam v1
 
Oop december 2018
Oop december 2018Oop december 2018
Oop december 2018
 
Gsp 125 Education Organization -- snaptutorial.com
Gsp 125   Education Organization -- snaptutorial.comGsp 125   Education Organization -- snaptutorial.com
Gsp 125 Education Organization -- snaptutorial.com
 
Bba 406 2015
Bba 406 2015Bba 406 2015
Bba 406 2015
 
GSP 125 Enhance teaching/tutorialrank.com
 GSP 125 Enhance teaching/tutorialrank.com GSP 125 Enhance teaching/tutorialrank.com
GSP 125 Enhance teaching/tutorialrank.com
 
GSP 125 Effective Communication/tutorialrank.com
 GSP 125 Effective Communication/tutorialrank.com GSP 125 Effective Communication/tutorialrank.com
GSP 125 Effective Communication/tutorialrank.com
 
GSP 125 Enhance teaching - snaptutorial.com
GSP 125   Enhance teaching - snaptutorial.comGSP 125   Enhance teaching - snaptutorial.com
GSP 125 Enhance teaching - snaptutorial.com
 
T1
T1T1
T1
 
GSP 125 Exceptional Education - snaptutorial.com
GSP 125 Exceptional Education - snaptutorial.comGSP 125 Exceptional Education - snaptutorial.com
GSP 125 Exceptional Education - snaptutorial.com
 
GSP 125 Education Specialist / snaptutorial.com
  GSP 125 Education Specialist / snaptutorial.com  GSP 125 Education Specialist / snaptutorial.com
GSP 125 Education Specialist / snaptutorial.com
 

More from TutorialsDuniya.com

Ba programme globalization notes Sartaz Sir Notes
Ba programme globalization notes Sartaz Sir NotesBa programme globalization notes Sartaz Sir Notes
Ba programme globalization notes Sartaz Sir NotesTutorialsDuniya.com
 
Ba programme english notes Sartaz Sir Notes
Ba programme english notes Sartaz Sir NotesBa programme english notes Sartaz Sir Notes
Ba programme english notes Sartaz Sir NotesTutorialsDuniya.com
 
DU BA programme education notes Sartaz Sir Notes
DU BA programme education notes Sartaz Sir NotesDU BA programme education notes Sartaz Sir Notes
DU BA programme education notes Sartaz Sir NotesTutorialsDuniya.com
 
Ba programme political science notes Sartaz Sir Notes
Ba programme political science notes Sartaz Sir NotesBa programme political science notes Sartaz Sir Notes
Ba programme political science notes Sartaz Sir NotesTutorialsDuniya.com
 
Ba programme history notes Sartaz Sir Notes
Ba programme history notes Sartaz Sir NotesBa programme history notes Sartaz Sir Notes
Ba programme history notes Sartaz Sir NotesTutorialsDuniya.com
 
Ba programme hindi notes Sartaz Sir Notes
Ba programme hindi notes Sartaz Sir NotesBa programme hindi notes Sartaz Sir Notes
Ba programme hindi notes Sartaz Sir NotesTutorialsDuniya.com
 
Ba programme economics notes Sartaz Sir Notes
Ba programme economics notes Sartaz Sir NotesBa programme economics notes Sartaz Sir Notes
Ba programme economics notes Sartaz Sir NotesTutorialsDuniya.com
 
Ba programme political science notes Sartaz Sir Notes
Ba programme political science notes Sartaz Sir NotesBa programme political science notes Sartaz Sir Notes
Ba programme political science notes Sartaz Sir NotesTutorialsDuniya.com
 
Ba programme human rights notes Sartaz Sir Notes
Ba programme human rights notes Sartaz Sir NotesBa programme human rights notes Sartaz Sir Notes
Ba programme human rights notes Sartaz Sir NotesTutorialsDuniya.com
 
Ba programme history notes Sartaz Sir Notes
Ba programme history notes Sartaz Sir NotesBa programme history notes Sartaz Sir Notes
Ba programme history notes Sartaz Sir NotesTutorialsDuniya.com
 
Ba programme hindi notes Sartaz Sir Notes
Ba programme hindi notes Sartaz Sir NotesBa programme hindi notes Sartaz Sir Notes
Ba programme hindi notes Sartaz Sir NotesTutorialsDuniya.com
 
BA programme education notes Sartaz Sir Notes
BA programme education notes Sartaz Sir NotesBA programme education notes Sartaz Sir Notes
BA programme education notes Sartaz Sir NotesTutorialsDuniya.com
 
Ba programme english notes Sartaz Sir Notes
Ba programme english notes Sartaz Sir NotesBa programme english notes Sartaz Sir Notes
Ba programme english notes Sartaz Sir NotesTutorialsDuniya.com
 
DU Ba programme education notes Sartaz Sir Notes
DU Ba programme education notes Sartaz Sir NotesDU Ba programme education notes Sartaz Sir Notes
DU Ba programme education notes Sartaz Sir NotesTutorialsDuniya.com
 
DU Ba programme political science notes Sartaz Sir Notes
DU Ba programme political science notes Sartaz Sir NotesDU Ba programme political science notes Sartaz Sir Notes
DU Ba programme political science notes Sartaz Sir NotesTutorialsDuniya.com
 
DU Ba programme hindi notes Sartaz Sir Notes
DU Ba programme hindi notes Sartaz Sir NotesDU Ba programme hindi notes Sartaz Sir Notes
DU Ba programme hindi notes Sartaz Sir NotesTutorialsDuniya.com
 
DU Ba programme english notes Sartaz Sir Notes
DU Ba programme english notes Sartaz Sir NotesDU Ba programme english notes Sartaz Sir Notes
DU Ba programme english notes Sartaz Sir NotesTutorialsDuniya.com
 
DU Ba programme history notes Sartaz Sir Notes
DU Ba programme history notes Sartaz Sir NotesDU Ba programme history notes Sartaz Sir Notes
DU Ba programme history notes Sartaz Sir NotesTutorialsDuniya.com
 
Computer graphics notes 4 tutorials duniya
Computer graphics notes 4   tutorials duniyaComputer graphics notes 4   tutorials duniya
Computer graphics notes 4 tutorials duniyaTutorialsDuniya.com
 

More from TutorialsDuniya.com (20)

Ba programme globalization notes Sartaz Sir Notes
Ba programme globalization notes Sartaz Sir NotesBa programme globalization notes Sartaz Sir Notes
Ba programme globalization notes Sartaz Sir Notes
 
Ba programme english notes Sartaz Sir Notes
Ba programme english notes Sartaz Sir NotesBa programme english notes Sartaz Sir Notes
Ba programme english notes Sartaz Sir Notes
 
DU BA programme education notes Sartaz Sir Notes
DU BA programme education notes Sartaz Sir NotesDU BA programme education notes Sartaz Sir Notes
DU BA programme education notes Sartaz Sir Notes
 
Ba programme political science notes Sartaz Sir Notes
Ba programme political science notes Sartaz Sir NotesBa programme political science notes Sartaz Sir Notes
Ba programme political science notes Sartaz Sir Notes
 
Ba programme history notes Sartaz Sir Notes
Ba programme history notes Sartaz Sir NotesBa programme history notes Sartaz Sir Notes
Ba programme history notes Sartaz Sir Notes
 
Ba programme hindi notes Sartaz Sir Notes
Ba programme hindi notes Sartaz Sir NotesBa programme hindi notes Sartaz Sir Notes
Ba programme hindi notes Sartaz Sir Notes
 
Ba programme economics notes Sartaz Sir Notes
Ba programme economics notes Sartaz Sir NotesBa programme economics notes Sartaz Sir Notes
Ba programme economics notes Sartaz Sir Notes
 
Ba programme political science notes Sartaz Sir Notes
Ba programme political science notes Sartaz Sir NotesBa programme political science notes Sartaz Sir Notes
Ba programme political science notes Sartaz Sir Notes
 
Ba programme human rights notes Sartaz Sir Notes
Ba programme human rights notes Sartaz Sir NotesBa programme human rights notes Sartaz Sir Notes
Ba programme human rights notes Sartaz Sir Notes
 
Ba programme history notes Sartaz Sir Notes
Ba programme history notes Sartaz Sir NotesBa programme history notes Sartaz Sir Notes
Ba programme history notes Sartaz Sir Notes
 
Ba programme hindi notes Sartaz Sir Notes
Ba programme hindi notes Sartaz Sir NotesBa programme hindi notes Sartaz Sir Notes
Ba programme hindi notes Sartaz Sir Notes
 
BA programme education notes Sartaz Sir Notes
BA programme education notes Sartaz Sir NotesBA programme education notes Sartaz Sir Notes
BA programme education notes Sartaz Sir Notes
 
Ba programme english notes Sartaz Sir Notes
Ba programme english notes Sartaz Sir NotesBa programme english notes Sartaz Sir Notes
Ba programme english notes Sartaz Sir Notes
 
DU Ba programme education notes Sartaz Sir Notes
DU Ba programme education notes Sartaz Sir NotesDU Ba programme education notes Sartaz Sir Notes
DU Ba programme education notes Sartaz Sir Notes
 
DU Ba programme political science notes Sartaz Sir Notes
DU Ba programme political science notes Sartaz Sir NotesDU Ba programme political science notes Sartaz Sir Notes
DU Ba programme political science notes Sartaz Sir Notes
 
DU Ba programme hindi notes Sartaz Sir Notes
DU Ba programme hindi notes Sartaz Sir NotesDU Ba programme hindi notes Sartaz Sir Notes
DU Ba programme hindi notes Sartaz Sir Notes
 
DU Ba programme english notes Sartaz Sir Notes
DU Ba programme english notes Sartaz Sir NotesDU Ba programme english notes Sartaz Sir Notes
DU Ba programme english notes Sartaz Sir Notes
 
DU Ba programme history notes Sartaz Sir Notes
DU Ba programme history notes Sartaz Sir NotesDU Ba programme history notes Sartaz Sir Notes
DU Ba programme history notes Sartaz Sir Notes
 
Computer graphics notes 4 tutorials duniya
Computer graphics notes 4   tutorials duniyaComputer graphics notes 4   tutorials duniya
Computer graphics notes 4 tutorials duniya
 
C++ notes 2 tutorials duniya
C++ notes 2   tutorials duniyaC++ notes 2   tutorials duniya
C++ notes 2 tutorials duniya
 

Recently uploaded

Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 

Recently uploaded (20)

Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 

Programming fundamentals using c++ question paper 2014 tutorialsduniya

  • 1. -. [This question paper contains 6 printed pages.] Sr. No. ofQuestion Paper 6065 D Your Roll No................ Unique Paper Code 2341011251305 Narne of the Course B.Sc. (Hons.) Computer Science I B.Sc. (Hons.) Electronics Name of the Paper Fundamental of Programming Semester I I III Duration : 3 Hours Maximum Marks: 75 Instructions for Candidates 1. Write your Roll No. on the top immediately on receipt of this question paper. 2. There are two parts in the Question Paper. 3. Parts of a Question should be attempted together. 4. Part I : All its questions are compulsory. 5. Part II : Attempt any four questions. PART I Question No. 1 is compulsory. Parts of the question should be attempted together. 1. (a) How.is (-5)10 represented in 2's complement form using 6 bits? (4) (b) Differentiate between the following : (i) Runtime polymorphism and compile time polymorphism (ii) Call by value and call by reference (iii) Public and private access type. (c) Give output of the following code segments : (6) (i) If x=O, y=O, and z=1, what are the values of x, y, and z after executing the following code ? (3) PT.O. TutorialsD uniya.com Visit https://www.tutorialsduniya.com forNotes, books, programs, question papers with solutions etc. Visit https://www.tutorialsduniya.com forNotes, books, programs, question papers with solutions etc. For any query, contact us at help@tutorialsduniya.com
  • 2. 6065 2 if(z < x II y >= z && z == 1) if(z && y) y= 1; else x= 1; (ii) string strl ("DU University"); string str2 ("DU Union"); int result; result= strl.compare(str2); cout <<result; result = strl.compare(O, 6, str2); cout << result; (iii) int a=15·int b=9·int c· ' ' ' int* p = &b; int* q; int* r; q=p; r=&c; p=&a; *q=8; *r=*p; *r=a+*q+*&c; cout <<*p<<" " << *q << " " << *r <<endl; (iv) int i; int list[10] = {2, 1, 2, 4, 1, 2, 0, 2, 1, 2}; int res [10]; for(i=O;i<1O;i++) res[i]=list[9-i]; for(i=O;i< 1O;i++) cout <<res[i]<<" "; (4) "'.- (3) (5) TutorialsD uniya.com Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc. Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc. For any query, contact us at help@tutorialsduniya.com
  • 3. J 6065 3 (d) If four objects of a class are defined, how many copies of class data items are stored in the memory and how many copies of its functions ? (2) (e) What are friend functions? What are their advantages? (f) Find errors in the following code segment : (i) int main() { int i=5; while(i) { switch(i) { } i--· ' } } (ii) #include<iostream> using namespace std; intmain() { int i = 0; i=i+1; cout << i << " "; default: case 4: case 5: case 1: break; continue; case 2: case 3: break; /* comment*//i = i + 1; cout << i; } (4) (2) (2) P.TO. TutorialsD uniya.com Visit https://www.tutorialsduniya.com forNotes, books, programs, question papers with solutions etc. Visit https://www.tutorialsduniya.com forNotes, books, programs, question papers with solutions etc. For any query, contact us at help@tutorialsduniya.com
  • 4. - - - - - - - - - - - - - - - - - - 6065 4 PART II Attempt any four questions. 2. (a) We have two arrays A and B, each of 10 integers. Write a function that tests if every element of array A is equal to its corresponding element in arrays B. In other words, the function must check ifA[O] is equal to B[O], A[1] is equal to B[ 1], and so forth. (5) (b) What are the static members of a class ? What are the restrictions on static function members ? (5) 3. (a) If originally x = 3 andy= 5, what are the values of x andy after evaluation of each of the following expressions ? (i) x++ + y (ii) ++x + 2 (4) (b) What do you understand by function overloading ? How is it different from function overriding? Give an example of function overloading. (6) 4. (a) Write a C++ program to count occurrences of character 'a' and ' A' in a given string. (5) (b) Write a function which returns the number of times an element occurs in an array. The array and the element to be searched are passed as arguments to the functions. (5) 5. (a) Differentiate between binary files and text files in C++. (4) (b) What is copy constructor? Explain with example. (4) (c) Rewrite the following code fragment using a switch statement: (2) if(ch == 'E' II ch == 'e') countE++; TutorialsD uniya.com Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc. Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc. For any query, contact us at help@tutorialsduniya.com
  • 5. 6065 5 elseif(ch =='A' II ch =='a') countA++; elseif(ch =='I' II ch == 'i') count!++; else cout << "Error- Not A, E, or I n"; 6. (a) Create a class TwoDim which contains x andy coordinates as int. Define the default constructor, parameterized constructor and void print() to print the co-ordinates. Now reuse this class in ThreeDim adding a new dimension as z of type int. Define the constructors for the derived class artd override the method void print() in the subclass. Write main() to show runtime polymorphism. (b) Write a C++ statement for the following expression : c = ~a2 + b 2 - 2ab (8) (2) 7. (a) Consider the following class definition. What data members and functions are directly accessible by the functions readit(), inform(), and B(). (3) void inform(void); class X { } ; int a; float b; void init(void); public: char ch; char gett(void); protected: double amt; void getamt(void); friend void A(void); PT.O. -__r TutorialsD uniya.com Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc. Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc. For any query, contact us at help@tutorialsduniya.com
  • 6. I ~. 6065 class Y: public X { }; int x; public: intj; void read(void); protected: void info(void); friend void B(void); 6 (b) Find the error(s) in the following code segment: class x {............. }; classy {............. }; class z {.............}; void alpha() throw(x,y) { throw z(); } (2) (c) What is the sequence of constructors and destructors being called in a multilevel inheritance where class A is parent class of class B, class C is derived class of ~lass B, class D is derived class of class C ? (5) (1300) TutorialsD uniya.com Visit https://www.tutorialsduniya.com forNotes, books, programs, question papers with solutions etc. Visit https://www.tutorialsduniya.com forNotes, books, programs, question papers with solutions etc. For any query, contact us at help@tutorialsduniya.com
  • 7. TUTORIALSDUNIYA.COM Get FREE Compiled Books, Notes, Programs, Question Papers with Solution etc of the following subjects at https://www.tutorialsduniya.com  C and C++  Computer System Architecture  Java  Discrete Structures  Data Structures  Operating Systems  Computer Networks  Algorithms  Android Programming  DataBase Management Systems  PHP Programming  Software Engineering  JavaScript  Theory of Computation  Java Server Pages  Operational Research  Python  System Programming  Microprocessor  Data Mining  Artificial Intelligence  Computer Graphics  Machine Learning  Data Science DU Programs: https://www.tutorialsduniya.com/programs TutorialsDuniya App: http://bit.ly/TutorialsDuniyaApp C++ Tutorial: https://www.tutorialsduniya.com/cplusplus Java Tutorial: https://www.tutorialsduniya.com/java JavaScript Tutorial: https://www.tutorialsduniya.com/javascript Python Tutorial: https://www.tutorialsduniya.com/python Kotlin Tutorial: https://www.tutorialsduniya.com/kotlin JSP Tutorial: https://www.tutorialsduniya.com/jsp