I Bcom CA - Programming c++
I Bcom CA - Programming c++
Semester : II Credit :3
Category : Generic(EC1)- III Hour/Week :4
Class &Major : I B.com(CA) Total Hour : 52
COURSE OBJECTIVES:
CO No. To enable the students
CO1 Understand about object-oriented languages and their applications
CO2 Introduce basic concepts of C++language
CO3 Knowledge about various conversions
CO4 Enlighten the various inheritance system
CO5 Impart knowledge on files and exception handling
1- K2 1-K2
II / CO2 3 3 2- K1 1 5 K2 1 10 K2 5 18
1- K2
III / CO3 3 3 2- K1 1 5 K3 1 10 K3 5 18
1- K2
IV / CO4 3 3 2- K1 1 5 K4 1 10 1-K4 5 28
1- K2
V / CO5 3 3 2- K1 2 10 1-K5 2 20 1-K5 7 23
1- K2 1-K6 1-K6
Total 15 15 7 35 6 60 28 110
15 1 V K2
Section-B (5 x 5 =25)
Answer ANY FIVE questions each in 200 words/2 pages per question
21 5 I K1/K2
22 5 II K1/K2
23 5 III K3/K4
24 5 IV K3/K4
25 5 V K5
26 5 I K3
27 Compulsory Question 5 V K6
(Compulsory)
Section-C (3 x 10 =30)
Answer ALL the questions each in 500 words/4 pages per question
28 a) Or 10 I K1
b) 10 II K2
29 a) Or 10 III K3 K4
b) 10 IV
30 a) Or 10 V K5 K6
b) 10 V
Registration No:
Q.NO Questions Marks UNIT NO Bloom’s
Level
Section-A (15X1=15) Answer ALL the questions
1 Which of the following is a valid C++ identifier? 1 I K1
a) 2value b) value_2
c) value-2 d) value#2
2 What is the output of int x = 5; cout << x * 2;? 1 I K1
a) 5 b) 10
c) Error d) None of the above
3 Which operator is used for input in C++? 1 I K3
a) >> b) <<
c) ** d) =
4 What is the return type of the main function in C++? 1 II K1
a) void b) int
c) float d) None
5 Which keyword is used to declare a function that does not return a value? 1 II K2
a) return b) void
c) null d) no-return
6 Which of the following is true about inline functions? 1 II K3
a) They increase execution time.
b) They replace the function call with the function code.
c) They cannot have return types.
d) They must be recursive.
Answer: b) They replace the function call with the function code.
7 Which keyword is used to define a class in C++? 1 III K1
a) struct b) class
c) object d) define
8 What is a constructor in C++? 1 III K2
a) A function used to initialize objects.
b) A function used to destroy objects.
c) A function used for input/output.
d) None of the above.
9 Which of the following allows the same function name to be used for different 1 III K3
purposes?
a) Function overriding b) Function overloading
c) Inline function d) Friend function
10 What is single inheritance? 1 IV K1
a) A class inheriting from one base class.
b) A class inheriting from multiple base classes.
c) A class with no inheritance.
d) None of the above.
11 Which type of inheritance is used when a derived class inherits from two or 1 IV K2
more base classes?
a) Single b) Multilevel
c) Multiple d) Hybrid
12 Which keyword is used to declare a base class pointer that can access derived 1 IV K3
class objects?
a) this b) virtual
c) protected d) public
13 Which header file is used for file operations in C++? 1 V K1
a) <iostream> b) <fstream>
c) <string> d) <cstdio>
14 What does ios::in mode do in file handling? 1 V K1
a) Opens a file for writing.
b) Opens a file for reading.
c) Opens a file for both reading and writing.
d) Opens a file in binary mode.
15 Which function is used to write data to a file in C++? 1 V K3
a) getline() b) put()
c) write() d) insert()
Section-B (5 x 5 =25)
Answer ANY FIVE questions each in 200 words/2 pages per question
16 Explain the various data types in C++ with examples. 5 I K2
17 Differentiate between inline functions and normal functions with examples. 5 II K3
18 Illustrate the concept of constructors and destructors with an example program. 5 III K4
19 Explain the concept of multiple inheritance with a suitable example program. 5 IV K3
20 Explain the process of opening and closing files in C++ using file stream classes 5 V K5
21 Write a simple C++ program to check if a number is prime. Explain the logic 5 I K4
used. V
22 Write a program to read and write data from/to a file and handle file errors.. 5 K5
Compulsory Question-No Choice (Compuls
o ry)
Section-C (3 x 10 =30)
Answer ALL the questions each in 500 words/4 pages per question
23 a) Write a C++ program to demonstrate the use of various control structures 10 I K3
(if-else, switch, loops) and explain its working.
(or)
b) Create a program using inline functions to calculate the area of a circle and 10 II K6
a rectangle. Explain its advantages.
24 a) Analyze the use of function overloading and function overriding in a C++ 10 III K4
program with examples.
(or)
b) Evaluate the concept of polymorphism with an example program that uses 10 IV K3
virtual functions
25 a) Write a program to create and update a file containing employee records 10 V K6
(name, ID, salary). Use file pointers to navigate within the file.
(or)
b) Analyze the role of command-line arguments in a file-handling program. 10 V K4
Provide an example to demonstrate its use.
Note: K1-Remembering, K2-Understanding, K3-Applying, K4-Analyzing, K5-Evaluating, K6-Creating