0% found this document useful (0 votes)
91 views

BCA-302-C++ Tutorial

This document contains 10 tutorials related to computer programming concepts like object oriented programming, C++, classes, inheritance, and input/output operations. The tutorials cover topics such as procedure-oriented vs object-oriented programming, class definitions, constructors and destructors, inheritance, polymorphism, and input/output stream classes. Each tutorial includes multiple questions related to the programming concepts and techniques covered in that unit.

Uploaded by

PRAJJWAL TIWARI
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views

BCA-302-C++ Tutorial

This document contains 10 tutorials related to computer programming concepts like object oriented programming, C++, classes, inheritance, and input/output operations. The tutorials cover topics such as procedure-oriented vs object-oriented programming, class definitions, constructors and destructors, inheritance, polymorphism, and input/output stream classes. Each tutorial includes multiple questions related to the programming concepts and techniques covered in that unit.

Uploaded by

PRAJJWAL TIWARI
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

LNCT UNIVERSITY-BCA/MCA, BHOPAL(MP)

Department of Computer application


Tutorial-1 Unit-1

1. What do you think are the major issues facing the software industry today?
2. Discuss an approach to the development of procedure-oriented programs.
3. Describe inheritance as applied to OOP.
4. Write a program to display the following output using a single cout statement.
Maths = 90
Physics = 77
Chemistry = 69
5. What are the applications of void data type in C++?
6. Write a program to print the following output using for loops.
1
22
333
4444
55555
……….

Tutorial - 2 Unit-1

1. The size of a char array that is declared to store a string should be one larger than the
number of characters in the string. Why?
2. What do you mean by dynamic initialization of a variable? Give an example.
3. What is the application of the scope resolution operator :: in C++?
4. Write a program to evaluate the following investment equation
V = P(1 + r)n
And print the tables which would give the value of V for various combinations of the
following values of P, r and n;
P: 1000, 2000, 3000,..... ,10,000
r: 0.10, 0.11, 0.12,.....,0.20
n: 1,2,3,......, 10
Hint: P is the principal amount and V is the value of money at the end of n years. This
equations can be recursively written as

Prof.- RIPUSOODAN SHARMA (MCA) 1


LNCT UNIVERSITY-BCA/MCA, BHOPAL(MP)
Department of Computer application
V = P(1 + r)
P=V
In other words, the value of money at the end of the year becomes the principal amount
for the next year, and so on.

5. How do the following statements differ?


a. char * const p;
b. char const *p;

Prof.- RIPUSOODAN SHARMA (MCA) 2


LNCT UNIVERSITY-BCA/MCA, BHOPAL(MP)
Department of Computer application
Tutorial-3 Unit-2

1. What is the most significant advantage that you can see in using references instead of
pointers?
2. How does an inline function differ from a preprocessor macro?
3. What do we mean by overloading of a fucations? Explain with an example when do we
use this concept?
4. How do we achieve function overloading? On what basis, the compiler distinguishes
between a set of overloaded functions having the same name?
5. Write a funcation to read a matrix of size m x n from the keyboard.
6. Write a program to compute the area of a triangle and a circle by overloading the area()
funcation.

Tutorial-4 Unit-2

1. Explain function prototyping.


2. What is the purpose of default arguments in C++ functions?
3. What is the difference between call by value and call by reference with example?
4. How do you pass constant arguments in C++?
5. Why do we use function overloading in OOP?
6. What is friend function and virtual function?

Prof.- RIPUSOODAN SHARMA (MCA) 3


LNCT UNIVERSITY-BCA/MCA, BHOPAL(MP)
Department of Computer application
Tutorial-5 Unit-3

1. What is a class? How does it accomplish data hiding?


2. What are objects? How are they created?
3. Can we use the same functions name for a member function of a class and an outside
function in the same program file? If yes, how are they distinguished? If no, give
reasons.
4. Create a class named “Student” with a string variable “name” and an integer variable
“roll_no.”Assign the value of roll_no as “2” and that of name as “John” by creating an
object of the class Student.
5. Write a program to print the area and perimeter of a triangle having sides of 3, 4 and 5
units by creating a class named “Triangle” with the constructor having the three sides as
its parameters.

Tutorial-6 Unit-3

1. When do we declare a member of a class static? Justify the static members.


2. Can we pass class objects as function arguments? Explain with the help of an example.
3. Can public member functions call private member function C++?
4. What are static data members? Classes have static members?
5. What are access modifiers?
6. What is the difference between a while loop and a do-while loop?

Prof.- RIPUSOODAN SHARMA (MCA) 4


LNCT UNIVERSITY-BCA/MCA, BHOPAL(MP)
Department of Computer application
Tutorial-7 Unit-4

1. What is the purpose of using a destructor in C++?


2. What is the order of constructor execution in C++?
3. How do we invoke a constructor function?
4. What is a parameterized constructor?
5. What do you mean by dynamic initialization of objects? Why do we need to do this?

Tutorial-8 Unit-4

1. How many types of constructor are present in C++?


2. How constructor and destructor are called when the object is created and destroyed
3. Explain Characteristics of Constructors in C++
4. Difference between Constructors and Desconstrutors.
5. Create a class named ‘Programming’. While creating an object of the class, if nothing is
passed to it, then the message “I love programming languages” should be printed. If
some String is passed to it, then in place of “programming languages” the name of that
String variable should be printed. For example, while creating the object if we pass
“cpp”, then “i love cpp” should be printed.

Prof.- RIPUSOODAN SHARMA (MCA) 5


LNCT UNIVERSITY-BCA/MCA, BHOPAL(MP)
Department of Computer application

Tutorial-9 Unit-5

1. What are the different forms of inheritance? Give examples for each
2. Describe the syntax of the single inheritance in C++.
3. Explain the Console input output Operations, Methods in C++.
4. What is the difference between inheritance and polymorphism?
5. What is polymorphism?

Tutorial-10 Unit-5

1. What are the Stream Classes in C++?


2. What is the difference between formatted and unformatted io?
3. What are manipulators explain with examples?
4. What are programming concepts and types?

Prof.- RIPUSOODAN SHARMA (MCA) 6

You might also like