Vous êtes sur la page 1sur 25

Q.

l) Write a C ++ program that takes two numbers from the user (a base number and an
exponent) and calculates the power. [ 1O]

Q.2) Write a C++ program to create a class Array that contains one float array as member.
Overload the Unary ++ and -- operators to increase or decrease the value of each element of
an array. Use friend function for operator function . [20]

Q.3) Create a base class Conversion. Derive three different classes


Weight (Gram, Kilogram),
Volume (Milliliter, Liter),
Currency (Rupees, Paise)
from Conversion class .
Write a C++ program to perform read, convert and display operations . (Use Pure virtual
function) [30]

Q.4) External Viva [l O]

Q.5) Internal Assessment [30]

Slio 1
Savitribai Phule Pune University
S.Y .B.C.A. (Science) Practical Examination, March/ April 2018
Lab Course I (BCA-405)
C++
Duration: 3 Hrs. Max Marks: 70+ (Internal 30)

1• l) Write a C++ program to display factors of a number. [l O]

~.2) Write a C++ program to create a class Employee that has data members as
Employee_number, Employee_Name, Designation, Salary. Create and initialize the object
using default constructor, parameterized constructor and copy constructor. Also write
member function to calculate Income tax of the Employee, which is 20% of his salary.
[20]

Q.3) Write a C++ program to create a class Person that contains data members as Person_Name,
City, Mob_No. Write a C++ program to perfom1 following functions:
a. To accept and display Person information
b. To search the Person details for a given city.
c. To search the Person details of a given mobile number
(Use Function Overloading) [30]

[1 O]
Q.4) External Viva

[30]
Q.5) Internal Assessment

Slin 4
[ mt:r ts z ;; ; i ;, z ;: Mt, f tltt ♦W&SM ffl:it..zn

Savitribai Phule Pune University


S. Y.B.C.A. (Science) Practical Examination, March/ April 2018
Lab Course I (BCA-405)
C++
Duration: 3 Hrs. Max Marks: 70+ (Internal 30)

Q. I) Write a C++ program to find the factorial of a number using a recursive function [J OJ

Q.2) A book(ISBN) and CD(data capacity) are two types of media(id, title) objects. A person
buys 10 media items, each of which can be either book or CD. Display the list of all books
and CDs bought. Define the classes and appropriate member functions to accept and display
data . Use pointers and concepts of polymorphism (virtual functions) . [20J

Q.3) Write a C++ program to create a class Department which contains data members as
Dept_ld, Dept_Name, H.O.D., Number_Of_Staff. Write necessary member functions to
i. Accept details from user for ' n' departments and write them in a file "Dept.txt".
ii . Display details of a department from file.
iii . Count the number of objects stored in a file . [30J

Q.4) External Viva [1 OJ

Q.5) Internal Assessment [30J

Slip 5
Savitribai Phule Pune Universitv
S.Y.B.C.A. (Science) Practical Examination, M;rch / April 201H
Lab Course I (BCA-405)
C++
Duration: 3 Hrs. Max Marks: 7o+ (Internal 30)

Q. l) Write a C++ program to calculate simple and compound interest usi ng inline func.,1ion . 11 OJ

Q.2) Design a base class Item(ltem_ld, Jtem_Name. Price) . Derive a class Discount
(Discount_In_Percentage) from Item. A customer buys ' n· different items. Cakulate total
price. total di scount and display bill usi ng appropriate manipulators. f20]

Q.3) A file '• Fibonacci'' contains some numbers. Write a C++ program to copy even numbers
from thi s file into the file "even .. and odd numbers into the file "odd". Write on the screen
the count of numbers in each ti le. Compute the median and average of numbers in both files.
130]

Q.4) External Viva 11 O]

Q.5) Internal Assessment 130]

Slip 6
Savitribai Phule Pune University
S.Y.B.C.A. (Science) Practical Examination, March/ April 2018
Lab Course I (BCA-405)
C++
Duration: 3 H,·s. Max Marks: 70+ (Internal 30)

Q. I) Write a C++ program to subtract two integer numbers of two different classes using friend
function . [1 O]

Q.2) Define a class named Clock with three integer data members for hours, minutes and
seconds. Define parameterized and default constructors. Overload increment and decrement
operators appropriately. Overload extraction and insertion operators. [20]

Q.3) Write 100 random numbers in a file "AIINumbers" in increasing order (using editor) . Write
3. program to copy even numbers from this file into the file " Even " and odd numbers into the
fil e ·'Odd ... Compute the median and average of numbers in both files . [30]

Q.4) External Viva


[ I OJ
Q.5) Internal Assessment
[30]

Slip 7
Savitribai Phule Pune University
S.Y.B.C.A. (Science) Practical Examination, March/ April 2018
Lab Course I (BCA-405)
C++
Duration: 3 Hrs. Max Marks: 70+ (Internal 30)

Q.l) Implement a class date with three integer data members day, mo~th an~ year. Writ~ a
function to compress date into a single integer. The date can be an unsigned mteger ( 16 bits)
in the following manner year: bits l 5-9, month : bits 8-5 and day bits 4-0. [IO]

Q.2) Implement the followin g class hierarchy.


Student: id, name,
StudentExam (derived from Student): Marks of n subjects (n can be variable)
StudentResult (derived from StudentExam): percentage, grade
Define a parameterized constructor for each class and appropriate functions to accept and
display details. Create n objects of the StudentResult class and display the mark list using
suitable manipulators. [20]

Q.3) Write a C++ program to create a text file which stores Student Objects (rollno, name,
TotalMarks). Write a menu driven program with the options [30]
a. Append
b. Modify
c. Delete
d. Display
e. Exit

Q.4) External Viva


[IO]

Q.5) Internal Assessment


[30]

Slip 8
Savitribai Phule Pune University
S.Y.B.C.A. (Science) Practical Examination, March/ April 2018
Lab Course I (BCA-405)
C++
Duration: 3 Hrs. Max Marks: 70+ (Internal 30)

Q. I) Write a C++ program to subtract two integer numbers belonging to two different classes
using friend function. [IO]

Q.2) Write a program in C++ to perform the following using the function template concepts:
a. To read a set of integer numbers
b. To read a set of float numbers
c. Find out average of the integer numbers
d. Find out average of the float number [20]

Q.3) Create a class called LIST with two pure virtual function store() and retrieve(). To store a
value call store() and to retrieve a value call retrieve() function. Derive two classes stack and
queue from it and override store and retrieve. [30]

Q.4) External Viva [1 O]

Q.5) Internal Assessment [30]

Slip I 0
Savitribai Phule Pune University
S.Y.B.C.A. (Science) Pral'tical Examination, M~rch / April 2018
Lab Course I (BCA-405)
C++
l)urnrion: 3 Hrs. Max Marks: 70+ (Internal 30)

Q.I ) \\'rilt' a C++ program to create a class Pan which contains data members as Pan_ld,
P:irt_Nam1:'. Part_Prict?. Create and Initialize all values of Part object by using parameterized
n)ns1111ctor. Display the values of Part object.
l P:1r1_pril'1:' should be right justi tied with a precision of two digits) [ 1OJ

Q.~) Write a C++ program to calculate the area of circle. rectangle and triangle using function
ln·erloading [20J

QJ) Write a program to find factorial of a given number. Throw exceptions for negative number
and out of memory and define multiple catch statements to handle these exceptions.
Negative number exception should be thrown if given number is negative and out of
menwry exception is thrown if the given number is greater than 20. (30J

Q.4) External Viva [ I OJ

Q.S) Internal Assessment [30J

Slip 11
Savitribai Phule Pune University
S.Y.B.C.A. (Science) Practical Examination, March/ April 2018
Lab Course I (BCA-405)
C++
Duration: 3 Hrs. Max Marks: 70+ (Internal 30)

Q.l) Write a C++ program to calculate volume of cube, cylinder and Sphere using function
overloading. [IO]

Q.2) Write a class template to represent a Vector. Include member functions to perform the
following tasks:
a. Create the Vector
b. Modify the value of given element.
c. Multiply by a scalar value
d. Display the Vector in the form (I 0, 20, 30 . .. ) [20]

Q.3) Create a base class Account (Acc_Holder_Name, Acc_Holder_Contact_No). Derive two


classes as Saving_Account(S_Acc_No., Balance) and Current_Account(C_Acc_No,
Balance) from Account. The savings account provides interest and withdrawal facility. The
current account provides no interest facility. Saving account maintains a minimum balance
of 2000 and if the balance falls below this level, a service charge of Rs. 500 is imposed.
Current account maintains a minimum balance of 5000 and if the balance falls below this
level, a service charge of Rs I 000 is imposed. Write a C++ menu driven program to perform
following functions :
a. Accept Amount and deposit it into account
b. Withdraw amount from account.
c. Calculate Interest and service charge where interest rate for Saving account is
I 0% of balance
d. Display information of account. [30]

0.4) External Viva [IO]

Q.s) Internal Assessment [30]

Slip 12
C

-i
t•
1

-
7

~~ E
.-,
? ~

tt,.,C:
...
Savitribai Phule Pune University
S.Y .B.C.A. (Science) Practical Examination, March/ April 2018
Lab Course I (BCA-405)
C++
I)ur111io11: 3 Hrs. Max Marks: 70+ (Internal 30)

Q. l) Write a func_tion called smalltozero() that has two integer argume~ts being passed by
rden:nce and 1t sets the smaller of the two numbers to 0. Write the mam program to access
thl~ function . [1O]

Q2.) Dl:'line a class Message wit!, two data members, one character pointer and an integer storing
length. Overload operator bmary + to represent concatenation of messages. [20]

Q.3) Write a C++ program to accept employee 's name and age . If the age is less than< 18 or
gn:•ater than> 60 raise user defined exception "Invalid age", if name contains digits raise
usl'r defined exception "Invalid name''. [30]

[ 1O]
Q.4) External Viva

[30]
Q.5) Internal Assessment

Slip 15
Savitribai PhuJe Pune University
S.Y.B.C.A. (Science) Practical Examination, March/ April 2018
Lab Course I (BCA-405)
C++
Duration: 3 Hrs. Max Marks: 70+ (Internal 30)

1) Write a C ++ program t? create two classes Circle I and Circle2 . Compare area of both the
circles using friend funct10n [ J OJ

.2) Define a class named C_lock with three integer data members for hours, minutes and
seconds. Define parametenzed and default constructors. Overload increment and decrement
operators appropriately. [20J

~.3) Write a C++program that reads from a fom1atted file a list of 4 students and their marks for
3 tests, computes the average test score for each student and the grade and outputs them in
another file [30J

_.4) External Viva [ I OJ

[30J
P) Internal Assessment

Slip 13
Savitribai Phule Pune University
S.Y.8.C.A. (Science) Practical Examination, March/ April 2018
Lab Course I (BCA-405)
C++
Duration: 3 Hrs. Max Marks: 70+ (Internal 30)

Q.l) Write a C++ program to print area of circle, square and rectangle using inlinc function. 11 O]

th
Q.2) Write a friend function for square matrix that interchanges the clements of mth and n
column . 120]

Q.3) Write a C++ program to create a class Person that contains data members as
Person_Name, City, Mob_No. Write a C++ program to perform following functions :
a. To accept and display information of IO persons
b. To search the mobile number of a given person
c. To search the Person details of a given mobile number
(Use Function Overloading) [30]

Q.4) External Viva I IO]

Q.5) Internal Assessment [30)

Slip 9
Savitribai Phule Pune University
S.Y.B.C.A. (Science) Practical Examination, March/ April 2018
Lab Course I (BCA-405)
C++
puration: 3 Hrs. Max Marks: 70+ (Internal 30)

Q.1) Write a C++ program to implement function overloading in order to compute power(m.n)
where
a. 111 is double and n is int
b. m and n are int 11 O]

Q.2) Write a C++ program to illustrate exception handling concept using stack (Underflow and
Overflow). l20]

Q.3) Assuming that a text filenamed FIRST.TXT contains some text written into it, write a
function named vowelwords(), that reads the file FIRST.TXT and creates a new filenamed
SECOND.TXT, to contain only those words from the file FIRST.TXT which start with a
. . h'a , e , 1, o , u .
lower case vowe I(1.e.,w1t I I ', · ,' 'I ')

For example, if the file FIRST.TXT contains ·'Carry umbrella and overcoat when it
rains". Then the file SECOND.TXT shall contain umbrella, and, overcoat, it.
[30]

.4) External Viva [IO]

5) Internal Assessment [30]

Slip I 6
Savitribai Phule Pune University
S.Y.B.C.A. (Science) Practical Examination, March/ April 2018
Lab Course I (BCA-405)
C++
Duration : J Hrs. Max Marks: 70+ (Internal 30)

Q. l) Write a C ++ program to create class to read time in HH :MM :SS format and display in
seconds. [ I OJ

Q.2) Write a C ++ program to raise an exception if any at1empt is made to refer an element whose
index is beyond the array size. [20J

Q.3) Write a C++ program which will accept ' n ' integers from user through command line
argument. Store Prime numbers in file "Prime.txt" and remaining numbers in "Others.txt" .
[30]

Q.4) External Viva [l OJ

Q.5) Internal Assessment [30]

Slip 17

---
. . Savitribai Phule Pune University
S.~ .B.C.A. (Science) Practical Examination, March/ April 2018
Lab Course I (BCA-405)
C++
ourarion: 3 Hrs. Max Marks: 70+ (Internal 30)

Q.l) Write a function that receives tv-.ro ~umbers as an argument and display a\\ prime numbers
, between these two numbers. Ca\\ th1s function from main() l\ 01

Q.2) \\"rite a C++ program to create a class shape with functions to find area of the shapes and
display the name of the shape and other essential component of the class. Create derived
classes circle. rectangle and trapezoid each having overridden functions area and display.
\\rite a suitable program to i\\ustrate vi~al functions . l201

Q.3) Create a class Rational to represent a Rationa~ nun:iber. ~rite me~ber functions to accept
and display Rational numbers. Perform the Basic Anthmet1c operatton:
-1- Addition.
Subtraction.
* Multiplication
. DiYision l301
using operator oYerloading for two Rational number.

ll01

l301

Slip 18
Savitribai Phule Pune University
S.Y.B.C.A. (Science) Practical Examination, March/ April 2018
Lab Course I (BCA-405)
c++
0un1tion: 3 Hrs. Max Marks: 70+ (Internal 30)

Q. l) Write a C++ program using class Circle to calculate area. (Use parameterized constructor
llith defoult value for Pl) [10]

Q.2) A Matrix has rows and columns which decide the number of elements in the matrix .
Implement a matrix class that can handle integer matrices of different dimensions. Overload
addition. subtraction and multiplication operators to carry out usual matrix addition,
subtraction and multiplication. [20]

Q.3) Write a C++ program to define the function template for calculating the square of given
numbers with different data type. [30]

Q.4) External Viva [IO]

Q.5) Internal Assessment [30]

Slip 19
Savitribai Phule Pune Universitv
S.Y.B.C.A. (Science) Practical Examination, M;rch / April 2018
Lab Course I (BCA-405)
C++
_Duration: 3 Hrs. Max Marks: 70+ (Internal 30)

.1) Write a C-1+ prog_ran~ which accepts day~ as integer and display total number of years,
months and days in 11. l·or example : If user mput as 856 days the output should be 2 years 4
months6days. [10]

).2) Wri te a C-t I program to create a class District having district_code. district_name.
' arca_sqft . population. litcracy_rate. For displaying detail s use appropriate manipulators. The
program should cont ain following menu :
a. Accept detail s of' n di strict
b. Display details of' a di strict.
c. Display det ai ls of di strict havi ng highest literacy rate . [20]

p ) Deline a class template Arra y to represent an array of any type and size. Define appropriate
constructors for the class.
Define member ti.met ions to Accept and di splay an Array object.
Find the largest element in the arra y ob_iect.
Example: Arra y<int. IO> a: creates an array of the type int and size I 0. [30]

).4) External Viva [IO]

).5) Intern al Assessment f30]

Slip 20

Snvitrihni Pirnie Punt• lJnivcrsily
S.Y .B.C'.A. (Scicm·c) Prnclicnl Examinntion, M~rch / A1>ril 2018
I ,nh Course I (BCA-405)
C++
0un1tion: 3 Hrs. Max Marks: 70+ (Internal 30)

'Q.l) Create a class !'or different d~partments in a college containing data members as
Oept_ ld. Dcpt_ Name. Establtshment_ year, No_ o(_Faculty. No_ of__students
Write a CI I- program with a member function to display department details of a specific
Department [IO]

Q.2) Write a CI -1 program to creatt! a class Instrument with data members lnstr_ code,
lnstr_name. lnstr_ price. Write member functions to read and display information of
instruments and also count the number of objects
. c reated for Instrument class. [20]
.

Q.3) Create a class C'String to represe nt a string.


Write a C++ program to
a. Overload the + operator to concatenate two strings
b. Overload <- . == to compare 2 strings
c. Overload I .I with paramete r index [30]

Q.4) External Viva [l O]

Q.5) Internal Assessment [30]

. Slip 21
Savitribai Plmk Pune University
S.Y.B.C.A. (Science) Practical Examination, March/ April 2018
Lab Course I (UCA-405)
C++
l)un1tion: 3 Hrs. Max Marks: 70+ (Internal 30)

Q.I) Write a c-1:-1-_pro_gram lo c_reale a cl_


ass Number which contains two integer data memb~rs.
Create and 1nil1ahze the ob_1ect by using parameterized constructor. Write a member function
to display maximum fron1 given two numbers for all objects. [ 101

·Q.2) A book(IS~N~ and CD(dat~ ca~acity) are b?th types of media(i?, title) obj_ects. A person
buys 10 media items, each ot which can be either book or CD. Display the hst of all books
and CD's bought. Define the classes and appropriate member functions to accept and
display data. Use pointers and concepts of polymorphism (virtual functions) . [201

Q.3) Create a class String which contains a character pointer (Use new and delete operator).
Write a C++ program to overload following operators:
! To reverse the case of each alphabet from given string
() To print a character present at specified index
< To compare length of two strings
- - To check equality of two strings
+ To concatenate two strings
[30)

Q.4) External Viva


[101
Q.S) Internal Assessment
[30)

Slip 22
-
Savitribai Phule Pone University
S.Y.B.C.A. (Science) Practical Examination, March/ April 2018
Lab Course I (BCA-405)
C++
Duration: 3 Hrs. Max Marks: 70+ (Internal 30)

i.l) Write a C++ program to display factors of a number. [1O]

).2) Write a C++ program to create a class Array that contains one float array as member.
' Overload the Unary ++ and -- operators to increase or decrease the value of each element of
an array. Use friend function for operator function . [20]

J3) Define a function template for finding the maximum value contained in an array. Write
main( ) function to find the maximum value of integer array and maximum value of floating
point numbers in an array. [30]

Q.4) External Viva [l 0]

Q.5) Internal Assessment [30]

Slip 23
Savitribai Phule Pune University
S.Y.B.C.A. (Science) Practical Examination, March/ April 2018
Lab Course I (BCA-405)
C++
ouration: 3 Hrs. Max Marks: 70+ (Internal 30)

Q. l) Write a C+~ program to create _a class ':hich contains two dimensional integer array of si~e
m x n. Write a member function to display transpose of entered matrix . (Use Dynamic
Constructor for allocating memory and Destructor to free memory of an object) [ 10]

Q .i) Write a C+ + program (using function overloading) to sort 10 integer values and 10 double
values. [20]

Q.3) Write a program in C ++ that copies one file to another by changing the case of every
alphabet in the file . Also count the total number of characters, words and lines in the file.
[30]

Q.4) External Vi va [IO]

Q.5) Internal Assessment [30]

Slip 24
........--~
Savitribai Phule Pone University
s .Y.B.C.A. (Science) Practical Examination, March/ April 2018
Lab Course I (BCA-405)
C++
Max Marks: 70+ (Internal 30)
vurarion : 3 Hrs.

I) Write a C++ program to create a class Number. Write necessary member functions to
Q. overload the operators, unary pre and post increment '++ ' for an integer number. [IO]

Q. 2) Write a C+_+ program to cre~te two cl_asses Tempe and TempF that store temperature in
degree Celsms and Fahrenheit, respectively. Write a program to read the value for class
objects. Write a friend function that adds one object of Tempe to TempF. [20]

Q.3) Write a C++ program to create a text file which stores Employee objects (emp_id,
emp_name, emp_sal). Write a menu driven program with the options
a. Append ·
b. Modify
c. Delete
d. Display
e. Exit
[30]

Q.4) External Viva


[l O]

Q.5) Internal Assessment


[30]

Slip 25

~ ~
Savitribai Phule Pune University
S.'\' .B.C.A. (Science) Practical Examination, March/ April 2018
Lab Course I (BCA-405)
C++
Duration: 3 Hrs. Max Marks: 70+ (Internal 30)

Q.\) Write a C++ program to generate the following triangle for given ·n' rows ll 01
For e.g. .. if n=3
*
***
*****

Q.2) Write a C++ program to create a c\ass Student containing Student_name. Marks in 6
subjects. Tota\Marks and Grade as a data members. Write necessary member functions to
accept Student_name and marks in 6 subjects and ca\cu\ate Tota\Marks and Grade. l201

Q.3) Write a c\ass temp\ate to represent a generic vector. \nc\ude member functions to perform
the fo\\owing tasks:
a. To create the vector.
b. To modify the va\ue of a given e\ement.
c. To rnu\tip\y the vector by a sca\ar value.
d. To display the vector in the form {\0, 20. 30, .....) (301

Q.4) Externa\ Viva l\01

Q.5) \nterna\ Assessment l301

S\ip 26
&

Savitribai Phule Pune Universitv


S.Y.B.C.A. (Science) Practical Examination, M;rch / April 2018
Lab Course I (BCA-405)
C++
J)uration: J Hrs. Max Marks: 70+ (Internal 30)

Q. I) Write the ~lass ca lled \Ylin?er that contai ns data me mbers radius and height. The class has
the follow mg memhe r I unctio ns:
a. ,oid setradi us( fl oat ) to set the radius of data me mber
h. H11 d ~t:t hc ight( float) to set the heig ht of data membe r
c. noat n,lurnd ) to calculate and return the volume o f the cylinder
Create two cylinder ohjects and displa y the ir area and volume . 1101

Q .2 ) A hook( ISBN) and CD( data capacity) both an: types of media( id, title) objects. A pe rson
bur IO media items. ea1.:h of whic h can be either book or CD . Display the list of a ll books
and ('I) ' :-- nought. Define the classes and appropriate membe r fun ctions to accept and
di~play data . l h i: poi nters and concept s of polymorphism (virtual functions). [20]

Q .3) \\'rite a class template for queue dass. Assume the users using the queue won't make
1111:--takcs. like exceeding the capacity o f the queue. or try ing to remove an ite m when the
qucw: ,~ empt y. Dcfine sen :~ ral queues o f different data types and insert and remove data
from th..:111 . f30]

[IO]
Q.4 ) External \ "i , a

[30]
Q.5) lntcma I Assessment

Slip 27

Vous aimerez peut-être aussi