Roll No. ......................
Total No. of Questions : 09]
J-1154[6289 A]
[Total No. of Pages : 03
[2957]
MCA (Semester-2nd)
OBJECT ORIENTED PROGRAMMING USING C++ (MCA-202)
Time : 03 Hours
Maximum Marks : 60
Instruction to Candidates:
1) Attempt any one question from each Section - A,B,C & D.
2) Section - E is compulsory
3) Use of Non-programmable Scientific Calculator is allowed.
Section – A
(1 * 9 = 9)
Q1)
(a) Explain briefly characteristics of OOPS language and mention advantages of OOPS approach over functional programming.
(b) Explain the following terms with suitable C++ examples.
(1) Type conversion; High level compiler rule for conversion.
(2) Conditional operator
(3) Make table group of operators in increasing order of precedence.
!, ++, --, -, *, /, %, +, -, <, >, <=, >=, ==, !=, ss, +=, -=, *=, /=, %=
Q2) Create equivalent four function calculator. The program requests the user to enter two integers. It carries out arithmetic addition of two numbers, multiples the result with the second number, divided the new result with the first original number and display the final result. The final result is acted upon by trigonometrical sine function. The calculations so stated above is
carried for subsequent sets of fresh integers.
Section - B
(1 * 9 = 9)
Q3)
(a) Give the tabular difference between structures, unions and classes.
(b) Give the tabular summary of lifetime, visibilty, intialized value, stoarage and purpose of automatic, external, automatic static variables.
Q4) Write a program to swap the two arrays of members by pointers, by reference and by value. Compare the three ways.
Section - C
(1 * 9 = 9)
Q5)
(a) Discuss the memory management function: MALLOC, CALLOC with suitable examples.
(b) Explain Inline member fuction and its benefits over simple function and C's macro
Q6) A survey was made to count number of 4 wheelers and 2 wheelers passing a kilometer distance in a busy road Delhi. the survey team needs to maintain the total count of both types of vehicles in an hour. Model this survey with class called 'SURVEY'. The data items are a type 'unsigned int' to hold the count of both kinds of vehicles. A constructor initializes both these to zero. A member function called 4 wheel ( ) increments the count and similarity a member function called 2 wheel ( ) increments the count respectively. A member function called display ( ) the two final total. Include prog. to test this class. The prog. should allow user to push one key to count 4 wheelers and another for 2 wheelers. Pressing ESC to display the counts and exit.
Section - D
(1 * 9 = 9)
Q7)
(a) Explain single operator overloading with most suitable program.
(b) Explain the concept of Abstract Classes, virtual base classes and friend functions.
Q8) Write a program to read data from xyz.dat file and write it into abc.dat file.
Section - E
(12 * 2 = 24)
Q9)
(a) A 'go to statement causes control to go to _________
(b) A function argument is a way that function resist accepting the calling programme's value (T/F).
(c) A data item that is a part of a class is called an __________ variable.
(d) Using pointer notation write some code that will transfer 80 characters from string s1 to string s2.
(e) Write a declaration for an overload assignment operator in class 'zeta'.
(f) A copy constructor is invoked when a function returns by reference (T/F).
(g) The statement f1.write (char*) & obj 1, size of (obj 1)); does ________
(h) Process.h is used for:
(i) N pointer to 'void' can hold pointers to _________
(j) A constructor is executed automatically when an object is __________
(k) Write a statement that will read the contents of one 'ifstream' object called 'if file' into an array called 'buff'.
(l) A child is said to be __________ from a base class.
Total No. of Questions : 09]
J-1154[6289 A]
[Total No. of Pages : 03
[2957]
MCA (Semester-2nd)
OBJECT ORIENTED PROGRAMMING USING C++ (MCA-202)
Time : 03 Hours
Maximum Marks : 60
Instruction to Candidates:
1) Attempt any one question from each Section - A,B,C & D.
2) Section - E is compulsory
3) Use of Non-programmable Scientific Calculator is allowed.
Section – A
(1 * 9 = 9)
Q1)
(a) Explain briefly characteristics of OOPS language and mention advantages of OOPS approach over functional programming.
(b) Explain the following terms with suitable C++ examples.
(1) Type conversion; High level compiler rule for conversion.
(2) Conditional operator
(3) Make table group of operators in increasing order of precedence.
!, ++, --, -, *, /, %, +, -, <, >, <=, >=, ==, !=, ss, +=, -=, *=, /=, %=
Q2) Create equivalent four function calculator. The program requests the user to enter two integers. It carries out arithmetic addition of two numbers, multiples the result with the second number, divided the new result with the first original number and display the final result. The final result is acted upon by trigonometrical sine function. The calculations so stated above is
carried for subsequent sets of fresh integers.
Section - B
(1 * 9 = 9)
Q3)
(a) Give the tabular difference between structures, unions and classes.
(b) Give the tabular summary of lifetime, visibilty, intialized value, stoarage and purpose of automatic, external, automatic static variables.
Q4) Write a program to swap the two arrays of members by pointers, by reference and by value. Compare the three ways.
Section - C
(1 * 9 = 9)
Q5)
(a) Discuss the memory management function: MALLOC, CALLOC with suitable examples.
(b) Explain Inline member fuction and its benefits over simple function and C's macro
Q6) A survey was made to count number of 4 wheelers and 2 wheelers passing a kilometer distance in a busy road Delhi. the survey team needs to maintain the total count of both types of vehicles in an hour. Model this survey with class called 'SURVEY'. The data items are a type 'unsigned int' to hold the count of both kinds of vehicles. A constructor initializes both these to zero. A member function called 4 wheel ( ) increments the count and similarity a member function called 2 wheel ( ) increments the count respectively. A member function called display ( ) the two final total. Include prog. to test this class. The prog. should allow user to push one key to count 4 wheelers and another for 2 wheelers. Pressing ESC to display the counts and exit.
Section - D
(1 * 9 = 9)
Q7)
(a) Explain single operator overloading with most suitable program.
(b) Explain the concept of Abstract Classes, virtual base classes and friend functions.
Q8) Write a program to read data from xyz.dat file and write it into abc.dat file.
Section - E
(12 * 2 = 24)
Q9)
(a) A 'go to statement causes control to go to _________
(b) A function argument is a way that function resist accepting the calling programme's value (T/F).
(c) A data item that is a part of a class is called an __________ variable.
(d) Using pointer notation write some code that will transfer 80 characters from string s1 to string s2.
(e) Write a declaration for an overload assignment operator in class 'zeta'.
(f) A copy constructor is invoked when a function returns by reference (T/F).
(g) The statement f1.write (char*) & obj 1, size of (obj 1)); does ________
(h) Process.h is used for:
(i) N pointer to 'void' can hold pointers to _________
(j) A constructor is executed automatically when an object is __________
(k) Write a statement that will read the contents of one 'ifstream' object called 'if file' into an array called 'buff'.
(l) A child is said to be __________ from a base class.