0% found this document useful (0 votes)
15 views3 pages

Totalpractprog (29mar)

The document contains a series of programming tasks in C++ focusing on object-oriented concepts such as classes, constructors, function overloading, and inheritance. It includes creating classes for Date, Shape, Matrix, Student, Seller, Media, and Mobile inventory, along with specific functionalities like calculating areas, handling matrices, and managing sales commissions. Each task is designed to reinforce C++ programming skills and understanding of class structures and member functions.

Uploaded by

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

Totalpractprog (29mar)

The document contains a series of programming tasks in C++ focusing on object-oriented concepts such as classes, constructors, function overloading, and inheritance. It includes creating classes for Date, Shape, Matrix, Student, Seller, Media, and Mobile inventory, along with specific functionalities like calculating areas, handling matrices, and managing sales commissions. Each task is designed to reinforce C++ programming skills and understanding of class structures and member functions.

Uploaded by

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

Marks : 15

Q. 1 a) Write a C++ program to create a class Date with data members day, month, and
year. Use default and parameterized constructor to initialize date and display date in dd-
Mon-yyyy format. (Example: Input: 04-01-2021 Output: 04-Jan-2021)

Q.1) a) Write a C++ program to find volume of cylinder, cone and sphere. (Use function
overloading).

Q.1 a ) Write a C++ program to find average of 3 integer numbers and average of 3 float numbers.
(Use function overloading)

Q.1 a) Write a C++ program to create a class which contains two data members. Write
member functions to accept display and swap two entered numbers using call by reference.

Q.1 A) Write a C++ program to check maximum and minimum of two integer numbers. (Use
Inline function and Conditional operator)

Q. 1 a) Write a C++ program to create a class Number, which contain static data member
'cnt and member function 'Display()'. Display() should print number of times display
operation is performed irrespective of the object responsible for calling Display().

25 Marks
Q.1 B) Create a C++ base class Shape. Derive three different classes Circle, Sphere and
Cylinder from shape class. Write a C++ program to calculate area of Circle, Sphere and
Cylinder. (Use pure virtual function)

Q. 1b) Create a C++ class


class Matrix

int **p;
int r, c; public:
//member functions
Write necessary member functions to:
i. Accept Matrix elements ii. Display Matrix elements. iii Calculate transpose of a
Matrix. (Use constructor and destructor)

Q.1 B) Create a C++ base class Shape. Derive three different classes Circle, Sphere and
Cylinder from shape class. Write a C++ program to calculate area of Circle, Sphere and
Cylinder. (Use pure virtual function)
Q.1 b) Create a C++ class for student having following members-Rollno, Name,
No. of subjects, Marks of each subject (no. of subjects varies for each student)
Write a parameterized constructor which initializes Rollno, Name & no. of
Subjects & creates the array of marks dynamically. Display the details of
all students with percentage & class obtained. [25 marks]

Q. 1 b) Create a base class Student with data members Roll No. Name. Derives two classes
from it, class
Theory with data members M1, M2, M3, M4 and class Practical with data members P1, P2.
Class Result(Total_Marks, Percentage, Grade) inherits both Theory and Practical classes.
(Use concept of Virtual Base Class and protected access specifiers) Write a C++ menu driven
program to perform the following functions: i. Accept Student Information ii. Display
Student Information iii. Calculate Total_marks, Percentage and Grade.
------------------------------------------------------------------------------------------------------------------------
Q. 1 b) Write a C++ class Seller (S_Name, Product_name, Sales Quantity, Target_Quantity,
Month,
Commission). Each salesman deals with a separate product and is assigned a target for a
month. At the end of the month his monthly sales is compared with target and commission
is calculated as follows:
• If Sales Quantity>Target_Quantity then is 25% of extra sales made + 10% of target.
• If Sales Quantity = Target_Quantitythen commission is 10% of target. Otherwise
commission is zero. Display salesman information along with commission obtained. (Use
array of objects) [25 Marks]

Q. 1b) Create a C++ base class Media. Derive two different classes from it, class NewsPaper
with data members N_Name, N_Editor, N_Price, No_of_Pagesand class Magazine with data
members M_Name, M_Editor, M Price. Write a C++ program to accept and display
information of both NewsPape rand Magazine. (Use pure virtual function)

Q. 1 b) Create a C++ class for inventory of Mobiles with data members Model,Mobile
Company, Color, Price and Quantity. Mobile can be sold, if stock is available, otherwise
purchase will be made. Write necessary member functions for the following: i. To accept
mobile details from user. ii. sale a mobile. (Sale contains Mobile details & number of
mobiles to be sold.) iii. To Purchase a Mobile. (Purchase contains Mobile details & number
of mobiles to be purchased)

You might also like