You are on page 1of 9

Format No. QSP/7.1/01.

F01 (B)
Issue No.04 Rev. No 4 Dated: June 7, 2014
___________________________________________________________________________
__________________
UNIVERSITY OF PETROLEUM & ENERGY STUDIES
College of Engineering Studies
Dehradun
______________________________________________________
COURSE PLAN
Programme : EE+B. Tech. (CSE) IBM (OGI, MFT, OSS, CCVT, BAO,
TI, RA, ITI)
Course : OOPs with C++ LAB
Subject Code :
No. of credits :1
Semester : III
Session : Aug.2014 Dc. 2014
Batch : 2013-2014
Prepared by : Mr. Venkatadri/Dr. Hanumat Sastry/Dr.Inder Singh/ Mr.
Monit Kapoor/Dr. Piyush Chauhan/ Mr. Hukum Singh
Rana/Mr. Rajeev Tiwari/Mr. P Srikanth/Mr. Gunjan
Chhabra
Email : pshrikant@ddn.upes.ac.in
Approved By
_______________________
_______________________
HOD Dean
UPES Campus Tel : +91-135-2770137
Energy Acres Fax : +91 135- 27760904
P.O. Bidholi, Via Prem Nagar Website : www.upes.ac.in
COURSE PLAN
Subject: Course: B.Tech
OOPs
with C+
+ LAB
Duration 120 Minutes Subject code:
:

One Session: 60 Minutes


A. OBJECTIVES:
(a) The overall objective of the modules is that the student should be able to distinguish
between the concepts of structural programming and object oriented programming.
(b) The student should be able to design and code the programs using OOPS concept.
(c) The student should be able to understand the flexibility and modularity provided by
OOPs using C++.

B. COURSE OUTLINE
Sl. No. Experiment Contents
1. Experiment - 1 Basic programming in C++ language
2. Experiment 2 Programs using classes and objects,
3. Experiment 3 Constructor and Destructor
4. Experiment 4 friend function
5. Experiment 5 Inheritance
6. Experiment 6 polymorphism and overloading
7. Experiment 7 Templates
8. Experiment 8 Exceptional Handling
9. Experiment 9 File handling
10. Experiment 10 Standard Libraries

C. PEDAGOGY
1.1 PREREQUISITE : Basic knowledge of Computer Science such as fundamentals
& logic for solving programs, knowledge of basic mathematics.

1.2 CORE REQUISITE: Learning aptitude, Basic knowledge of programming.

D. COURSE COMPLETION PLAN

No.of Labs No.of experiments No.of Quizzes /viva No.of Tests % syllabus
Planned/taken planned/conducted planned/conducted planned/conducted completed
12 12 02 02

E. EVALUATION & GRADING

Students will be evaluated based on the following 2 stages.


Internal assessment - 50%
End term Examination - 50%
INTERNAL ASSESSMENT: WEIGHTAGE- 50%
Internal Assessment shall be based on the following:
Sl. No. Description % of Weightage out of 50%
1 Project & Continuous Assessment 20
2 Viva-Voce/Quiz 20
3 General Discipline 10

Internal Assessment Record Sheet will be displayed on LMS at the end of the
semester i.e. in the last week of regular classroom teaching.

CONTINUOUS ASSESSMENT: Based on the weekly evaluation of the experiments


actually performed by the students in the Laboratory and submitted on the same day or
on the very next turn.
A group project will be submitted and that will be evaluated.
The continuous Assessment will be displayed on LMS on monthly basis i.e. on the last
two or three working days of every month.
MANDATORY: A group project assignment will be submitted by the
students.

Project progress / VIVA: Progress of the project work will be discussed by the
students twice the term each time a viva based exercise will be followed. Those who
fail to do so shall be marked as absent and shall lose their marks.
The marks obtained by the students will be displayed on LMS after evaluation.
GENERAL DISCIPLINE: Based on students regularity, punctuality, sincerity and
behavior in the class.
The marks obtained by the students will be displayed on LMS at the end of
semester.
END TERM EXAMINATION: WEIGHTAGE 50%
End Term Examination shall be Three Hours duration and shall be conducted by
actually performing the experiment.
GRADING:
The overall marks obtained at the end of the semester comprising the above two
mentioned shall be converted to a grade.
F. DETAILED SESSION PLAN
EXPERIMENT NO 1
TITLE: Getting acquainted with the C++ language
Objective: - To understand programming constructs, input/ output, branching, iterative
1. Write a program to compute the roots of the quadratic equation by inputting the co-
efficients
2. Write a program to find sums of even positive, odd-positive, odd-negative numbers in
a given 1-D array.
3. Input any positive integer number and print it in words.
4. Write a Program to find the sum of the series upto to n terms where n =1,2..
5. Write a program to input the elements of m X n (m.n values are user input), then
display the matrix.
6. Write a program for matrix multiplication.
7. Write a function to count the number of words in a given string. Function should
accept string and return the number of words?
8. Write a program using structures to accept the data for 5 students (student id, student
name, marks for 3 subjects) and compute the total, then the program has to display the
student details in ascending order of the total of marks.
EXPERIMENT NO 2
TITLE: Programs using classes and objects
Objective: - To understand the concept of classes, objects, data hiding and encapsulation.
1. WAP with a class date and time with data members such as day, month, year and
hour, min and second with the Methods set () and get () to input and display the
state of the object.
2. WAP to input the distance in feet and inches, then display the distance in feet and
inches (more than 12 inches should be converted into feet) by using classes and
objects.
3. Write a program with the class of bank with data members as Name of the
depositor, Account number, Type of account, Balance amount in the account and
Member functions to To assign initial values, To deposit an amount, To withdraw
an amount after checking the balance, To display name, account number and
balance amount.
4. Write a program to read 3X3 matrix and represent it into Sparse Matrix by using
classes.
5. Write a program to read students details like id , name and marks of 3 subjects
and find out how many students are passed / failed [pass marks =50@in each
subject] and display the student details in ascending order based total. Take the
input for number of students.
6. Given that an EMPLOYEE class contains following members: data members:
Employee number, Employee name, Basic, DA, IT, Net Salary and print data
members. Write a C++ program to read the data of N employee and compute Net
salary of each employee (DA=52% of Basic and Income Tax (IT) =30% of the
gross salary)
7. Write a C++ program to create a class called COMPLEX and implement the
following overloading functions ADD that return a COMPLEX number. I. ADD (a,
s2) - where a is an integer (real part) and s2 is a complex number. II. ADD (s1, s2)-
where s1 & s2 are complex numbers.
8. Define a STUDENT class with USN, Name and MARKS in 3tests of subject.
Declare an array of 10 STUDENT objects. Using appropriate functions. Print
USN, print the USN, Name and the average marks of all the students.
9. Write a C++ program to create a class called QUEUE with member function to add an
element and to delete an element from the queue of integer and double. Demonstrate
the operation by displaying the content of the queue after every operation.

LAB EXERCISE# 3
TITLE: Constructor and destructor
Objective: - To understand the concept of Constructor and destructor.
1. Supply the above classes with the constructors and destructors.
2. Write a default constructor and destructor.
3. Exercise the concept of constructor overloading with parametric constructor and copy
constructor..
4. Exercise the concept of dynamic initialization of objects.

LAB EXERCISE# 4

TITLE: Friend Function

Objective: - To understand the concept of Friend Function.

1. WAP to read molecular values for Oxygen, Hydrogen and Sulpher in three different
classes named Oxygen, Hydrogen and Sulpher, then find out chemical compound that
to be formed based on the given input molecular values.

2. WAP to read the element for 3x2 matrix in MatrixA class and 2x2 matrix in MatrixB
class, then compute the multiplication of these two matrices using friend function.
LAB EXERCISE# 5
TITLE: Inheritance
Objective: - To understand the concept of inheritance and visibility of class members in
inherited class.
1. Further extend the above classes with GMT with private, protected and public
members. Access these members from main(). Write down your observations.

2. Design the following hierarchy:


Shape Base class
Rectangle -- Derived class of Shape
Triangle --- Derived class of Shape
main() should show the following menu:
1. Rectangle
2. Triangle
3. Exit.
(Enter choice:_)
A function calculate_area() should be made to calculate the area of the chosen
shape.
(Hint: Use concepts of inheritance, late binding, virtual functions and abstract class
in
the above program).
LAB EXERCISE# 6, 7, 8,9
TITLE: Polymorphism and overloading, virtual functions, abstract classes Templates
and
Exceptional Handling
Objective: - To understand the concept Polymorphism & overloading, virtual functions,
abstract classes Templates and Exceptional handling .

1. Write a program which calculates the multiplication of two integer numbers and also
calculates multiplication of two float numbers using the function overloading concept.
2. Write a program using the concept of function overloading to find out the area of
different shapes as rectangle, square, circle and triangle.
3. WAP to compute the sum of two given imaginary numbers using operator overloading.
4. Write a program to overload operator +, =, ==, >, < for string class.
5. Write a program which designs a template that performs multiplication of :
a. int type data
b. float type data
6. Write a program which accepts a number and a divisor to divide it. If the divisor is
zero the program terminates abruptly. Modify the program by adding exception
handling in it and prevent abnormal termination.
7. Write a generic function to sort the given elements in any order. This generic function
must support int, char, and double types
8.

Write a c++ program to implement the above multi-path inheritance, declaring the
base class (i.e. Student) as virtual. Take functions as student_Details ( ) and
display_Student_Details ( ) and name, roll no, and gender as data members. Members
of Internal Exam class are array of internal exam for six subjects and a function
get_InternalMarks () for getting internal marks and display_InternalMarks ().
Members of External Exam class are array of external exam for six subjects and a
function get_ExternalMarks () for getting external marks and display_ExternalMarks
(). Members of Result class are and display Results ( ).
LAB EXERCISE# 10,11,12.
TITLE: File handling, Standard Libraries.
Objective: - To understand the concept of File handling and Standard Libraries.

1.Write a program to count number of characters in a given file abc.txt.


2.Write a program to merge contents of two files into a third file.
3.Write a program to maintain students-contact details data file named student.dat
using streams. Make this into a telephone directory in the following manner by adding
the
appropriate functions]
[hint: Create a student class with member functions To add records to the file.
To read records from the file and display them
To query a particular record and display it.]
4.Create a class Student whose data members are name, course and age. Member functions
are get_Details( ), to read the data of a student and show_Details( ) to display the details of
the student.

Write a program to perform read and write operations with objects using the functions
read() and write( ) for n number of students. Name of the file to be store the student
details is StudentDetails.doc.
F. SUGGESTED READINGS:

F: 1 TEXT BOOKS:
F: 2 REFERENCE BOOKS
Ref. 1: OBJECT ORIENTED PROGRAMMING WITH C++; ------ EDITION;
BY E. BALAGURUSAMY; PUBLICATION: TMH
Ref. 2: PROGRAMMING WITH C++; SECOND EDITION; BY
D.RAVICHANDRAN; PUBLICATION: TMH
Ref. 3: OBJECT ORIENTED PROGRAMMING IN TURBO C++; ---------
EDITION, BY ROBERT LAFORE; PUBLICATION: GALGOTIA
F : 3 VIDEO RESOURCES (URL LINK) AND NPTEL LECTURES
www.youtube.com/watch?v=vlEqthyN06A
http://www.youtube.com/watch?v=oqJy4e6Aa0M
www.cplusplus.com
www.cprogramminglanguage.net
www.mycplus.com

GUIDELINES
Cell Phones and other Electronic Communication Devices: Cell phones and other electronic
communication devices (such as Blackberries/Laptops) are not permitted in classes during
Tests or the Mid/Final Examination. Such devices MUST be turned off in the class room.
E-Mail and LMS: Each student in the class should have an e-mail id and a pass word to
access the LMS system regularly. Regularly, important information Date of conducting class
tests, guest lectures, via LMS. The best way to arrange meetings with us or ask specific
questions is by email and prior appointment. All the assignments preferably should be
uploaded on LMS. Various research papers/reference material will be mailed/uploaded on
LMS time to time.
Attendance: Students are required to have minimum attendance of 75% in each subject.
Students with less than said percentage shall NOT be allowed to appear in the end semester
examination.
Passing criterion: Student has to secure minimum 30%/40% marks of the highest marks in
the class scored by a student in that subject (in that class/group class) individually in both the
End-Semester examination and Total Marks in order to pass in that paper.
Passing Criterion for B. Tech: minimum 30% of the highest marks in the class
Passing Criterion for M. Tech: minimum 40% of the highest marks in the class

You might also like