0% found this document useful (0 votes)
5 views

Lab Assignment and Answer Format (PCA1-CPP).Docx

The document outlines a lab course on Object Oriented Programming with C++ at Netaji Shubash Engineering College, focusing on various programming concepts and techniques. It includes a problem statement for finding maximum and minimum elements in an array using the Divide and Conquer strategy, along with a series of programming experiments. Each experiment has a problem statement, program, and expected output, covering topics such as class structures, function overloading, and operator overloading.

Uploaded by

Niraj Ranjan
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)
5 views

Lab Assignment and Answer Format (PCA1-CPP).Docx

The document outlines a lab course on Object Oriented Programming with C++ at Netaji Shubash Engineering College, focusing on various programming concepts and techniques. It includes a problem statement for finding maximum and minimum elements in an array using the Divide and Conquer strategy, along with a series of programming experiments. Each experiment has a problem statement, program, and expected output, covering topics such as class structures, function overloading, and operator overloading.

Uploaded by

Niraj Ranjan
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/ 19

Title:Find maximum and

minimum element in
array.
Problem Statement:Write
a program to find
Maximum and Minimum
element in an array using
Divide
and Conquer strategyand
verify the time
complexity.
Theory:
Title:Find maximum and
minimum element in array.
Problem Statement:Write a
program to find Maximum and
Minimum element in an array
using Divide
and Conquer strategyand verify
the time complexity.
Theory:
NETAJI SHUBASH ENGINEERING COLLEGE
Department of Computer Science and Business System

Subject (Lab): Object Oriented Programming with C++ Lab​ Code: PCC-CSBS492

Course Objectives: In this course, student will learn about:


●​ The basic programming and OOPs concepts
●​ Creating C++ programs
●​ Tokens, expressions and control structures in C++
●​ Arranging same data systematically with arrays
●​ Classes and objects in C++
●​ Constructors and destructors in C++
●​ Files management and templates in C++
●​ Handling exceptions to control errors

Course Outcome:
●​ PCC492.1: to remember the various commands in UNIX/LINUX to system start-up & shutdown
along with know about editor like Vi, practical concepts OOPs and various aspect of OOP in through
programming.
●​ PCC492.2: to understand to learn about, how to write, compile & execute basic C++ program which
are essential for programming.
●​ PCC492.3: to apply to learn about the effective program writing in the environment of Object
Oriented Concept like function overloading and operator overloading.
●​ PCC492.4: to analyze that how to use OOP to simplify complex programs and also got knowledge
about the advantage of using Object Oriented Programming over Process Oriented Programming.
●​ PCC492.5: to evaluate practical exposure about the major object-oriented concepts in C++
specifically stream I/O, templates.
●​ PCC492.6: to create new applications various concepts of advanced OOPs through efficient
algorithms and translate them into well-structured C++ code.

Name of the Student:​ ​ ​ ​ ​


Roll No: ​ ​ ​ ​ ​ Year: 2nd ​ ​ Semester: 4th
Date of Submission:

​ ​ ​ ​ ​
​ Marks/Grade​ ​ ​ ​ ​ Signature of the Teacher
Index:
Page Signature of the Grade/
Sl No Experiments
No Teacher Marks
Write a CPP Program to demonstrate the structure
1
of a C++ program.
Write a program to show the base of a numeric
2 value of a variable using Hex, Oct and Dec
manipulator functions.
Write a CPP Program to define constant pointer
3 and pointer to constant and perform possible
operations.
Write a CPP Program access a variable in different
4 scopes by using scope resolution operator and the
use of comma operator.
Write a CPP Program to swap two numbers using
5 call by value, call by address, call by reference and
return by reference.
Write a CPP Program to calculate square and cube
6
of a number using inline functions and macros.
Write a CPP Program to find the area of a
7 rectangle, a triangle and surface area of a sphere
using function overloading.
Write a C++ program to calculate ax and find a
8 square of the given number using the default
parameter concept.
Write a CPP Program to declare all members of a
9 class as public, Access the members using objects.
(Use public, protected, private).
Write a CPP Program to access the member
10
functions inside and outside a class.
Write a CPP Program to access private data using
11
non-member functions. (Use friend function).
Write a CPP Program to create constructor
12 with arguments and pass the arguments to
constructor.
Write a CPP Program to create object and release
13
them using destructor.
Write a CPP Program to perform addition,
14 subtraction, multiplication of two objects using
operator keyword.
Write a CPP Program to overload unary and binary
15
operator overloading with friend function.
●​ Experiment No.: 01
●​ Problem Statement: Write a CPP Program to demonstrate the structure of a C++ program.
●​ Program:

●​ Output of the Program with a sample test set:


●​ Experiment No.: 02
●​ Problem Statement: Write a program to show the base of a numeric value of a variable
using Hex, Oct and Dec manipulator functions.
●​ Program:

●​ Output of the Program with a sample test set:


●​ Experiment No.: 03
●​ Problem Statement: Write a CPP Program to define constant pointer and pointer to constant
and perform possible operations.
●​ Program:

●​ Output of the Program with a sample test set:


●​ Experiment No.: 04
●​ Problem Statement: Write a CPP Program access a variable in different scopes by using
scope resolution operator and the use of comma operator.
●​ Program:

●​ Output of the Program with a sample test set:


●​ Experiment No.: 05
●​ Problem Statement: Write a CPP Program to swap two numbers using call by value, call by
address, call by reference and return by reference.
●​ Program:

●​ Output of the Program with a sample test set:


●​ Experiment No.: 06
●​ Problem Statement: Write a CPP Program to find the area of a rectangle, a triangle and
surface area of a sphere using function overloading.
●​ Program:

●​ Output of the Program with a sample test set:


●​ Experiment No.: 07
●​ Problem Statement: Write a C++ program to calculate ax and find a square of the given
number using the default parameter concept.
●​ Program:

●​ Output of the Program with a sample test set:


●​ Experiment No.: 08
●​ Problem Statement: Write a CPP Program to declare all members of a class as public,
Access the members using objects. (Use public, protected, private).
●​ Program:

●​ Output of the Program with a sample test set:


●​ Experiment No.: 09
●​ Problem Statement: Write a CPP Program to access the member functions inside and
outside a class.
●​ Program:

●​ Output of the Program with a sample test set:


●​ Experiment No.: 10
●​ Problem Statement: Write a CPP Program to access private data using non-member
functions. (Use friend function).
●​ Program:

●​ Output of the Program with a sample test set:


●​ Experiment No.: 11
●​ Problem Statement: Write a CPP Program to pass objects to functions by pass by value
method.
●​ Program:

●​ Output of the Program with a sample test set:


●​ Experiment No.: 12
●​ Problem Statement: Write a CPP Program to create constructor with arguments and pass
the arguments to constructor.
●​ Program:

●​ Output of the Program with a sample test set:


●​ Experiment No.: 12
●​ Problem Statement: Write a CPP Program to create object and release them using destructor.
●​ Program:

●​ Output of the Program with a sample test set:


●​ Experiment No.: 12
●​ Problem Statement: Write a CPP Program to perform addition, subtraction, multiplication of two
objects using operator keyword.
●​ Program:

●​ Output of the Program with a sample test set:


●​ Experiment No.: 12
●​ Problem Statement: Write a CPP Program to overload unary and binary operator overloading with
friend function.
●​ Program:

●​ Output of the Program with a sample test set:

You might also like