Practical Set-OOP
Practical Set-OOP
2
G1
5
6
G2
7
10
G3
11
12
13
14
G4
15
16
17
18
19 G5
20
VIDYALANKAR POLYTECHNIC
Week1 : Set 1
Exp 1 Exp 2
1. Write a C++ program to evaluate the following Write programs usingScope resolution
expressions: operator
Memory management operator
Manipulators 1) To access a global variable
when there is a local variable with same
name
1. Write a C++ program to evaluate the following Write programs usingScope resolution
expressions: C1 = [(x1 + x2 + x3)/ 3,C2= (y1 + y2 + operator
y3)/ 3] Memory management operator
Manipulators 2) To define a function
outside a class.
2.Write a c++ program to take input rollnumber
and marks score in all subject of second semester
from user and display on screen.
1. Write a C++ program to evaluate the following Write programs usingScope resolution
expressions: y=50x^3 – 20xyz + 8x + 21x^3z – 3xw operator
+ 15x – 41x^3 Memory management operator
Manipulators 5) To use delete operator
2.Write a c++ program to take educational details
from user and display on screen.
Week2 : Set 2
Exp 3 Exp 4
Write programs to demonstrate use
ofImplicit type casting
Explicit type casting 1) Integer to
Floating Point:
Write programs to show use of classes and
objects to define the function inside the class
1)Initialize and Display Student data through
method
5
6
G2
7
10
11 G3
12
13
14
G4
15
16
17
18
19 G5
20
VIDYALANKAR POLYTECHNIC
Write C++ program to count number of objects created Write a program to declare a class ‘employee’
with the help of static data member. containing data members ‘emp-id’ and ‘salary’.
Accept and display this data for 10 employees.
Write a Program to calculate weight of object at Write a Program to declare a class birthday
different planets using formula weight=m*g having data member day, month and year. Accept
Where m=mass of object G=gravitational force this info for object using pointer to array of object
Declare g as static member variable. and display it.
Write A C++ program to count number of employees Write a C++ program to declare a class mobile
in an oganization using static data member. having data members as price and model number.
Accept and display the data for Ten objects
Write a Program to define a class having data Write a program to declare a class ‘student’
members principal, duration and rate of interest. having data members as ‘stud_name’ and
Declare rate _of_ interest as static member ‘roll_no’. Accept and display this data for 5
variable .calculate the simple interest and display it. students.
Week6 : Set 6
Exp 10
WAP to declare a class student having
datamembers as name and percentage .Write
constructor to initialise these data members.
Accept and display data for one object.
3 G1
G2
7
10
G3
11
12
13
G4
14
15 G4
16
17
18
19 G5
20
.
THIRD SEMESTER
2
G1
6
G2
10
G3
11
12
13
14
G4
15
16
17
18
G5
19
20
VIDYALANKAR POLYTECHNIC
1. Write a C++ program declare a class 1.Write C++ program to find the area of
“Animal” having data members various geometrical shapes by Function
nooflegs and sound. Derive classes overloading. (eg.Area of circle,
“Dog” from “Animal” having display() as circumference of circle etc…)
member function. Display details of
Dog using pointer to derived class
object.
1. Write a C++ program declare a class 1.Write C++ program to find the
“Fruit” having data members taste and hightNumber of various Number by
size. Derive classes “Apple” from “Fruit” Function overloading. (eg.three
having display() as member function. integer,four floating point number
Display details of Apple using pointer to etc…)
derived class object.
YTECHNIC
GINEERING (CO3K)
Week 11 : Set 11
Exp 19 Exp 20
1. Write a C++ program to overload 1. Write a C++ program to add two
Unary Operator ++ used as prefix. complex numbers using operator
overloading by a friend function.
1. Write a C++ program to create class 1. Write a C++ program to subtract two
distance takes two member objects i.e. complex numbers using operator
feet and inches, and creates a function overloading by using member function.
by which the Distance object should
decrement the value of feet and inches
by overloading Unary Operator (- ) .
1. Write a C++ program declare a class 1. Write a C++ program declare a class
“Shape” having data members width “Animal” having pure virtual function
and sound() as a member function. Create
height and area() as class Cat to inherit class Animal.
a member function. Create class
Rectangle to inherit class Shape using
virtual function.
1. Write a C++ program declare a class 1. Write a C++ program declare a class
“polygon” having data members width “Human” having pure virtual function
and height() as a member function. Create
height and area() as class Boy to inherit class Human.
a member function. Create class
Triangle to inherit class polygon with
the help of virtual function.
1. Write a C++ program declare a class 1. Write a C++ program declare a class
“Fruit” taste() as “Shape” having data members width
a member function. Create class Mango and
to inherit class Fruit with the help of height and pure virtual function area()
virtual function. as
a member function. Create class
Rectangle to inherit class Shape.
1. Write a C++ program declare a class 1. Write a C++ program declare a class
“Shape” having data members width “Fruit” pure virtual function taste() as
and a member function. Create class Mango
height and area() as to inherit class Fruit.
a member function. Create class
Rectangle to inherit class Shape virtual
function.
Week 13 : Set 14
Exp 23 Exp 24
1. Write a program in C++ in which 1. Write a C++ program to use
open a file data.txt in read and write sequential
mode and display the content on input and output operations on data.txt
output screen using open() function . file .
1. Write a C++ Program to Copy the 1. Write a C++ program to copy entire
Contents of circle.txt file into area.txt content of one binary file at a time to
file. another
file using read () and write ().
10
G3
11
12
13
14
G4
15
16
17
18
G5
19
20
VIDYALANKAR POLYTECHNIC
Develop advanced calculator for the Develop Hotel Management Application. It should
following function: Binary to Decimal, accept room reservation for 10 rooms. Find number of
Decimal to Binary etc.. emptyrooms. Display relevant information and write
maximum 5 records into file.
Develop Employee Management System Develop Games USing C++ like Tic-Tac-Toe
using Inheritance. Collect following game,Snake Game
information from
user:Employee_ID ,Employee_Name,
Basic_Salary, Leave taken in the month
Calculate Net Salary assuming
applicabledeductions and display. Write
maximum 5 records into file.
Develop application in C++ to Control Toys Develop application in C++ to Control Drone