0% found this document useful (0 votes)
21 views4 pages

C++ Theory Assign

The document outlines two assignments for a BTech(CSE) course on Object Oriented Programming using C++. Assignment 1 consists of various programming tasks related to C++ concepts such as classes, inheritance, and polymorphism, with a strict submission deadline. Assignment 2 requires students to create a C++ project involving classes and file handling, along with a video presentation of the project, also with a fixed deadline.
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)
21 views4 pages

C++ Theory Assign

The document outlines two assignments for a BTech(CSE) course on Object Oriented Programming using C++. Assignment 1 consists of various programming tasks related to C++ concepts such as classes, inheritance, and polymorphism, with a strict submission deadline. Assignment 2 requires students to create a C++ project involving classes and file handling, along with a video presentation of the project, also with a fixed deadline.
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/ 4

Object Oriented Programming Using C++

Semester: 2 BTech(CSE) Section: A/B/C


Assignment 1
Faculty: Prof.(Dr.) Vikas Thada
Submission Date: 14th June 4 PM
Instructions:

1. Deadline is final and will not be changed at all. Violation of deadline will award zero
marks in assignment.
2. All questions are to be completed handwritten in neat and clean manner.
3. Submit in a short register and no loose bound assignment will be accepted.
4. In all the question assume suitable data and methods yourself. The question itself
should guide you in this regard.

Module I: Introduction
1. C vs C++ Program: Write a simple "Hello World" program in both C and C++ to
compare the syntax and structure differences.
2. Object and Class: Implement a C++ program to define a class named Student with
attributes and methods, and create an object to access them.
3. Abstraction: Write a C++ program to create an abstract class Shape with a pure virtual
function area() and derive classes Circle and Rectangle.
4. Encapsulation: Implement a class Employee with private data members and public
member functions to get and set the data.
5. Inheritance: Create a base class Animal with a method sound() and derive classes Dog
and Cat that override the sound() method.
6. Polymorphism: Write a program to demonstrate function overloading with a class Math
that has multiple add methods.
7. Dynamic Binding: Create a base class Base with a virtual function show() and a derived
class Derived that overrides show(). Use pointers to demonstrate dynamic binding.
8. Message Passing: Implement a program where two classes Sender and Receiver
communicate by passing messages through member functions.
9. Object-Oriented Concepts: Write a program to demonstrate the principles of object-
oriented programming (abstraction, encapsulation, inheritance, and polymorphism).

Module II: Classes and Objects


10. Class Definition: Define a class Car with attributes like model, year, and price, and
methods to display these attributes.
11. Local and Global Class: Implement a local class within a function and a global class in
the same program and demonstrate their usage.
12. State, Identity, and Behavior: Create a class Book with attributes (state), methods
(behavior), and demonstrate the identity of different objects.
13. Scope Resolution Operator: Write a program to access a global variable using the scope
resolution operator inside a class method.
14. Friend Function: Implement a friend function that accesses the private members of a class
Box.
15. Inline Function: Define an inline function within a class Calculator that performs basic
arithmetic operations.
16. Constructors and Destructors: Write a program that includes a class Point with
constructors to initialize coordinates and a destructor to clean up.
17. Types of Constructors: Demonstrate default, parameterized, and copy constructors in a
class Person.
18. Static Members: Create a class Account with a static data member interestRate and a
static member function to modify it.
19. Array of Objects: Implement a program that creates an array of objects of a class Student
and displays their details.
20. Constant Member Functions: Write a class Clock with constant member functions to get
the time.
21. Memory Management Operators: Demonstrate the use of new and delete operators in a
class DynamicArray to allocate and deallocate memory.

Module III: Inheritance


22. Single Inheritance: Implement single inheritance with a base class Vehicle and a derived
class Car.
23. Multiple Inheritance: Create a program that demonstrates multiple inheritance with
classes Engine and Body as base classes and Car as a derived class.
24. Access Specifiers: Write a program to demonstrate public, private, and protected
inheritance.
25. Abstract Class: Define an abstract class Employee with a pure virtual function
calculateSalary() and derive classes FullTime and PartTime that implement the function.
26. Scope Resolution Operator: Use the scope resolution operator to resolve ambiguity in
multiple inheritance with a class Person derived from Father and Mother.
27. Virtual Base Class: Implement a virtual base class Device and derive classes Scanner and
Printer from it. Then derive a class AllInOne from Scanner and Printer.
28. Aggregation: Demonstrate aggregation by creating a class Team that contains objects of
class Player.
29. Composition: Implement composition by creating a class Library that contains objects of
class Book.
30. Classification Hierarchies: Create a classification hierarchy with a base class Appliance
and derived classes Washer and Dryer.
31. Overriding Methods: Write a program where a derived class Derived overrides a method
of the base class Base.
32. Base Class Constructor: Demonstrate how to call a base class constructor from a derived
class in a program.
33. Nested Class: Implement a nested class Inner within an outer class Outer and demonstrate
its usage.

Module IV: Polymorphism


34. Function Overloading: Implement function overloading in a class MathOperations with
different multiply methods.
35. Operator Overloading (Unary): Overload the unary - operator in a class Vector to negate
its components.
36. Operator Overloading (Binary): Overload the binary + operator in a class Complex to add
two complex numbers.
37. Parameterized Polymorphism: Create a template function swap to exchange the values of
two variables of any data type.
38. Pointer to Objects: Demonstrate the use of pointers to objects with a class Employee and
dynamically allocate memory for an object.
39. This Pointer: Write a class Box that uses the this pointer to return the current object from
member functions.
40. Virtual Functions: Create a base class Shape with a virtual function draw() and derive
classes Circle and Square that override draw().
41. Pure Virtual Functions: Define a pure virtual function in an abstract class Instrument and
implement it in derived classes Guitar and Piano.

Module V: Strings, Files, and Exception Handling


42. String Manipulation: Write a program to concatenate two strings using a class
StringManipulator.
43. File Handling (Formatted I/O): Implement a program to read and write formatted data to
a file using file streams.
44. File Handling (Unformatted I/O): Demonstrate reading and writing unformatted data to a
file in C++.
45. Basic Exception Handling: Create a program to handle division by zero using try, catch,
and throw.
46. Function Template: Implement a generic function template to find the maximum of two
values.
47. Class Template: Create a class template Array to handle arrays of various data types.
48. STL Containers: Write a program that uses STL containers like vector and list to store
and manipulate data.
49. STL Algorithms: Implement a program that uses STL algorithms to sort a list of integers
and search for a value.
50. STL Iterators: Write a program to demonstrate the use of iterators to traverse through
elements of an STL container like vector.
Semester: 2 BTech(CSE) Section: A/B/C
Assignment 2
Faculty: Prof.(Dr.) Vikas Thada
Submission Date: 14th June 4 PM
Instructions:

1. Deadline is final and will not be changed at all. Violation of deadline will award zero
marks in assignment.
2. Create/Copy/Get any C++ project that make use of classes, objects, inheritance, file
handling, exception handling, virtual function, STL etc.
3. Create a Video Presentation with PPT for the project and show the execution. The
video presentation must have your face visible while recording. Show execution
within the video presentation itself.
4. Upload the video on Youtube and share with me the URL on or before deadline.
5. Get your project topic registered/approved by Friday 31st May 4 PM with me to
avoid any rejection of selected project.

EITHER OF THE ASSIGNMENT IS TO BE DONE !

You might also like