0% found this document useful (0 votes)
11 views13 pages

C++ Cover & Index

Uploaded by

surykant4102
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views13 pages

C++ Cover & Index

Uploaded by

surykant4102
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

A

Practical File
On
PROGRAMMING IN C++
(B.C.A.-207)
Submitted
In
Partial fulfillment of the requirements for the award
of the degree of
Bachelor of Computer Application-2nd Year
For
Session: 2021-22

At
SAMADHAN COLLEGE BEMETARA
Affiliated to
HEMCHAND YADAV UNIVERSITY, DURG (C. G.)

Guided by Submitted by
MRS. MONA SAHU SURYKANT DEWANGAN
CERTIFICATE OF EVALUATION
This is to certify that the Practical file entitled
“(PROGRAMMING IN C++) (B.C.A-207)” is carried out by Mr.
SURYKANT DEWANGAN, a student of BCA – II year at
Samadhan College Bemetara (C.G), after proper evaluation and
examination, is hereby approved as a credible work in the discipline
of Computer Science & Information Technology and is done in a
satisfactory manner for its acceptance as a requisite for the award of
degree of Bachelor of Computer Application- II year during the
year 2021-22 from HEMCHAND YADAV UNIVERSITY, DURG
(C. G.)

Internal Examiner External Examiner


------------------------- --------------------------
------------------------- --------------------------
CERTIFICATE OF APPROVAL

This is to certify that the Practical file entitled


“(PROGRAMMING IN C++) (B.C.A-207)” is carried out by
Mr.SURYKANT DEWANGAN a student of BCA – II year at
Samadhan College Bemetara (C.G.), is hereby approved as a
credible work in the discipline of Computer Science & Information
Technology for the award of degree of Bachelor of Computer
Application -II year during the year 2021-22 from HEMCHAND
YADAV UNIVERSITY, DURG (C.G.).

(HOD/Principal)
INDEX
SN NAME OF PRACTICAL PAGE DATE OF Teacher
NO. PRACTICAL signature

Loops, Decision, Nested Method, Member Function Defined Outside Class Body:-
Q.1 a) WAP to generate following pattern:-
ABCDEFG 1-2 03/10/2021
ABC EFG
AB FG
A G
b) WAP to generate following pattern:-
* 3-4 05/10/2021
* *
* * *

c) WAP to generate following pattern:


1 5-6 04/10/2021
1 2
1 2 3
d) WAP to generate following pattern:
1 7-8 06/10/2021
121
1331
14641

Q.2 Write member functions which when called asks pattern


type.if user enters 11 then a member function is 9-12 07-10-2021
called which generates first pattern using for
loop. If user enters 12 then a member function
is called which generates first pattern using
while loop. If user enters 13 then a member
function is called which generates first pattern
using do-while loop. If user enters 21 then a
member function is called which generates
second pattern using for loop and so on.
Q.3) Write program to display number 1 to 10 in octal,
decimal and hexadecimal system. 13-17 08-10-2021

Q.4) Write program to display number from one


number system to another number system. The 18-25 11-10-2021
program must ask for the number system in
which you will input integer value then the
program must ask the number system in which
you will want, output of the input number after
that you have to input the number in specified
number system and program will give the
output according to number system for output
you mentioned earlier.

Array

5 WAP using function to addition, subtraction and


multiplication into matrix of order 3*3 you have to 26-33 12/10/20
create one function for addition which accept 3 array
arguments. First two array argument are matrix to add
third matrix is destination. Where the resulted of addition
of first 2 matrix is stored in similar way create function
for matrix subtraction and multiplication.
Q.6 Create a single program to perform following tasks
without using library function: 34-38 13/10/20
I. To reverse the string accepted as argument.
II. To count the number of characters in string
passed as argument in form of character array.
III. To copy the one string to other string; passed as
arguments in form of source character array and
destination character array without using library
function.
IV. To count no. of vowels, consonants in each word
of a sentence passed as argument in form of
character array.

Class, Object, Array of Object, object Using Array


Q.7 Create a class Student having data members to store roll
number, name of student, name of three subjects, max 39-41 14-10-2021
marks, min marks, obtained marks. Declare an object of
class student. Provide facilities to input data in data
members and display result of student.

Q.8 Create a class Student having data members to store roll


number, name of student, name of three subjects, max 42-45 18/10/21
marks, min marks, obtained marks. Declare array of
object to hold data of 3 students. Provide facilities to
display result of all students. Provide also facility to
display result of specific student whose roll number is
given.

Q.9 Create a class S array having an array of integers having


5 elements as data member provide following facilities: 46-50 21/10/21
a) Constructor to get number in array elements. b) Sort
the elements. c) Find largest element
d) Search for presence of particular value in array
element.

Static Member Function


Q.10 Create a class Simple with static member functions for
following tasks: 51-54 22/10/21
a) To find factorial by recursive member function.
b) To check whether a no. is prime or not.
c) To generate Fibonacci series up to requested terms.
Friend function
Q.13 Create class polar having data members
radius and angle it contains member 55-57 27/10/21
functions for taking input in data members
and Member function for displaying value
of data members class polar contains
declares son of friend function at which
accepts two objects of class polar and
returns object of class polar after addition
test the class using main function and
objects of class polar.
write program to create class distance having data
Q.14. members feet and inch (A single object will store 58-61 28-10-2021
distance in form such as 5 feet 3 inch). It contains
member functions for taking input in data members and
member function for displaying value of data members.
Class Distance contains declaration of friend function
add which accepts two objects of class Distance and
returns object of class Distance after addition. Class
Distance contains declaration of another friend function
Subtract that accepts two objects of class Distanceand
returns object of class Distance after subtraction. Test the
class using main function and objects of class Distance.

Q.15. Write a Program to create class mother having


data member to store salary of mother create 62-64 29-10-2021
another class father having data member to store
salary of father write a friend function which
accept objects of class mother and father and
print sum of salary of mother and father objects.

Friend class

Write a Program to create class mother having


Q.16. data member to store salary of mother create 65-67 08-11-2021
another class father having data member to store
salary of father write a friend function which
accept objects of class mother and father and
print sum of salary of mother and father objects.
create member function in each class to get input
in data member and to display the value of data
member.
Static Data Member
Q.17. Create a class counter having a static member, which
keeps track of no of object created of type counter . one 68-70 09-11-2021
static member function must be created to increase value
of static data member as the object is created one static
member function must be created to decrease value of
static member as the object is destroyed .one static
member function must be created to display the current
value of static data member .use main function to test the
class counter.

Structure And Class


Q.18. Define structure student. Structure student has data
members for storing name, roll no , name of three 71-73 11-11-2021
subjects and marks. Write member function to store and
print data.

Copy constructor, constructor overloading,


this pointer, constructor with default
arguments
write program to create a class polar which has
Q.19. data member radius and angle,define overloaded 74-77 12-11-2021
constructor to initialize object and copy
constructor to initialize one object by another
existing object keep name of parameter of
parametrized constructor same as data members.
Test function of the program in main functions.
write a program to create a class polar which
Q.20. has data member radius and angle.define 78-81 15-11-2021
overloaded constructor to initialize object and
copy constructor to initialize one object by
another existing object keep name of parameter
of parametrized constructor same as data
members. Test function of the program in main
functions.
Function Overload, Reference Variable, Parameter passing by address, static functions
Q.21 Write a class having name calculate that uses
aesthetic overloaded function to calculate area of 82-84 16-11-2021
circle area of rectangle and area of triangle.
Q.22. Write a class Array Sort that uses static overloaded
function to sort an array of floats, an array of integers. 85-88 17-11-2021

Q.23. Write a program using class, which uses static


overloaded function to swap two integers, two floats 89-91 18-11-2021
methods use reference variable.

Write a program using class, which uses static


Q.24. overloaded function to swap two integers, two 92-94 22-11-2021
floats methods use parameter passing by
address.

String, pointer, and operator overloading

Q.25. Create class string having pointer to character as


data member and provide followingfacilities : 95-99 23-11-2021
a) Constructor for
intializationmemoryallocation.
b) Destructor for memory release.
c) Overloaded operator + to add two string on
object.
d)Overloaded operator = to assign one string
object to other string object ,
e)Overloaded operator == to compare whether
the two string objects are equal or not ,
f) Overloaded operator<to compare whether first
string object is less than second string object ,
g) Overloaded operator >to compare whether
first string object is greater than second string
object or not ,
h) Overloaded operator<= to compare whether
first string object is less than or equal to second
string object or not ,
i) Overloaded operator >= to compare weather
first string object is greater than or equal to
second string object ,
j) Overloaded operator !=to compare whether
first string object is not equal to second string
object or not.
k) overloaded insertion and extraction operators
for input in data members and display out put of
data members.
Q.26. create a class Matrix having data member double
dimensional array of floats of size 3×3provide 100-105 25-11-2021
following facilities :-
a) overloaded extraction operator for data input.
b)overloaded insertion operator for data output.
c) overloaded operator + for adding two matrix
using objects .
d) overloaded operator - for subtracting two
using Matrix object.
e) overloaded operator × for multiplying two
using Matrix objects.
Operator Overloading With Friend Function
Q.27. create a class polar having radius and angle as
data members.provide following facilities:- 106-108 26-11-2021
a) Overloaded insertion and extraction
operators for data input and display
b) Overloaded constructor for initialization
of data members.
Overloaded operator + to add two polar co-
ordinates using objects of class polar.

Create class Degree Celsius having a single data member 109-111 29-11-2021
Q.28. to hold value of temperature in degree Celsius. Provide
following facilities:
a) Overloaded operator ++ which will increase value of
data member by 1 (consider postfix and prefix operator
overloading).
b) Overloaded operator -- which will decrease value of
data member by 1 (consider post fix and prefix operator
overloading).
c) Overloaded insertion and extraction operators for
input in data member and display value of data member.

Operator overloading and data type conversion


create a class polar that contains data member
Q.29 radius and angle. Create another class cartesian 112-116 30-11-2021
in the same program and provide following
facilities:
a) It should be possible to assign object of
polar class to object of cartesian class.
b) It should be possible to assign object of
cartesian class to object of polar class.
Q.30. Create a class Fahrenheit that contains data
member to hold temperature in Fahrenheit. 117-120 01-12-2021
create another class Celsius that contain the data
member to hold temperature in degree celsius in
the same Program and provide for following
facilities :
A) it should be possible to assign objects of
fahrenheit class two object of Celsius class,
B) it should be possible to assign objects of
Celsius class two object of fahrenheit class,
C) it should be possible to compare objects of
class Fahrenheit and Celsius to find out which
object contains higher temperature.

Void pointer, pointer and pointer to object


create class polar having data member radius
Q.31. and angle it contains member functions for 121-123 02-12-2021
taking input in data member and member
functions for displaying value of data member
class polar contains declares son of friend at
which accepts two objects of class polar and
returns object of class polar after addition test
the class using main functions and objects of
class polar.

Write program to find biggest number among 124-125 03-12-2021


Q.32. three numbers using pointer and function.

Write swapping program to demonstrate call by


Q.33. value, call by address and call by reference in a 126-132 06-12-2021
single program.

Inline functions

Q.35 Write a Program using inline function to calculate


area of circle. 133-134 08-12-2021
Q.36. Write a Program using inline function to find
minimum of two functions the inline function 135-136 09-12-2021
should take two arguments and should return the
minimum value.

Inheritance
Create a class circle with data member radius,
Q.38. provide Member function to calculate area . 137-139 13-12-2021
derived class Sphere from class circle provide
Member function to calculate volume derived
class cylinder from class sphere with additional
data member for height and Member function to
calculate volume.

Consider an example of declaring the


Q.39. examination result design three classes student 140-142 14-12-2021
exam and result the student class has data
member such as that representing roll number
name of student create the class exam which
contain data members representing name of
subject minimum marks maximum marks
obtained marks for 3 subjects derived class result
from both student and exam classes test the
result class in main function.
Virtual and pure virtual functions
Q.40. Create a base class shape having two data
members with two-member function getdata 143-146 15-12-2021
(pure virtual function) and print area (not pure
virtual function). Derive classes triangle and
rectangle from class shape and redefine member
function print area in both classes triangle and
rectangle and test the functioning of classes
using pointer to base class objects and normal
objects.

You might also like