Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
27 views
20 pages
Oops Project File
Code questions with answers
Uploaded by
Daizy Sharma
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save oops project file For Later
Download
Save
Save oops project file For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
27 views
20 pages
Oops Project File
Code questions with answers
Uploaded by
Daizy Sharma
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save oops project file For Later
Carousel Previous
Carousel Next
Download
Save
Save oops project file For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 20
Search
Fullscreen
@SRM SRM INSTITUTE OF SCIENCE & TECHNOLOGY Delhi-NCR Campus, Modinagar , Ghaziabad-201204 PRACTICAL FILE SUBJECT TITLE : OBJECT ORIENTED DESIGN AND PROGRAMING SUBJECT CODE : 21CSC101T NAME: Daizy Sharma REGISTRATION NO : RA2311028030008. DEGREE: Btech Cse BRANCH & SECTION: Cse cloud computing A SEMESTER AND YEAR: 2 and 1SRM INSTITUTE OF SCIENCE & TECHNOLOGY (under section 3 of UGC Act, 1956) BONAFIDE CERTIFICATE It is to be certified that the bonafide record submitted by Daizy Sharma_ & Reg.No. RA2311028030008 of FIRST year & SECOND semester for Bachelor of Technology in Bachelor Degree in theDepartment of Computer Science & Engineering, SRM IST has been done for the course Object Oriented Design & Programing Lab during the academic year of 2023-24. LAB IN CHARGE: HEAD OF DEPARTMENT: EXANINER-1 EXAMINER-2©@SRM ‘SRM INSTITUTE OF SCIENCE AND TECHNOLOGY DELHI NCR CAMPUS, MODINAGAR LIST OF EXPERIMENTS Title of Experiments Date | Signature "program for inpuvoutput operators in CH Write a program for data type in CHF Write a program for operators in CH Write a program for decision making in C+¥. Write a program for class and object in CF Write a program for constructor& destructor in CH 1 2 3 4 5 _| Write a program for loops in CH 6 7 8 _ | Write aprogram for operator overloading in C+. Q _| Write a program for function overloading in CH 10 | Write aprogram for inheritance in CH T1 | Write aprogram for fiend function in CHF. 12_| ite @ program for inline function in CH 13 _ | We @PreeFam Tor viral Tunetion in CH ‘ALUE ADDED PROGRAMS Programs Date Signature Write a program for template in C+¥. Write a program for exception handling in C+.Program-1: Write A Program for input/output operators in C++. #include
using namespace std: int main { int num; cout << "Enter an integer" cin>> num; // Taking input cout << "The number is: " << num:retum 0; } OUTPU Enteran integer: 70 ‘The number is: 70 Program-2: Write a Program for Data Type in C++. #include
using namespace std; int main t intmyNum float myPloatNum = 5.99: double myDoubleNum = 9.98908; char myLetter='D’; string myText = "Hello"; cout<
using namespace std; int main { inta, bs 1 b=2; cout<<"a + b=" <<(a +b) << endl; cout << "a -b=" << (a-b) << endl; cout << "a *b="<<(a*b) << endl cout << "a/b =" << (a/b)
> number, if (mumber> 0) { cout <<"You entered a positive integer: " << number << endl; else { cout <<"You entered a negati ) return 0; } OUTPUT: integer: " << number << endl; Enteran integer: 4 ‘You entered a positive integer: 4 Enteran integer: 4 You entered a negative integer: 4 Program-5: Write a program for loops in C++. +#include
using namespace std; int maing { for (int i= 1; i<=3; +44) { cout <<"Hello World! "<< endl; } return 0; ourpur: HelloWorld! HelloWorld! HelloWorld!Program-6: Write a program for class & objects in C++. include
using namespace std: class Rectangle [ private double length; double width: public: Rectangle(double |, double w) : length(!), width(w) {}double area() { return length * width; int main { Rectangle rect(5.0, 3.0); cout << “Area of the rectangle: ” << rectarea() << cendl;retum 0; } OUTPUT: Area of the rectangle: 15 Program-7: Write a program for Constructor & Destructor in C++ ‘include
using namespace std; class Z t public’ mw { cout<<"Constructor called”<
using namespace sid; class Count { private: int value; public: Count : value(s) {} void operator + ot +values void display() { cout << "Count: "<< value << endl; int main() { Count count; +Heountl; count display(); return 0;Program-9: Write a program for function overloading in C++. ‘inelude
using namespace std: void add(int a, intb) fout<< "sum =" << (a+b): void add{double a, double b) , cout << endl << "sum ="<<(a+b): inaing add(10, 2); add(5.3, 62); return 0; Program-10: Write a program for inheritance in C++. +#include
> id cout << "Enter the Name:"; cin >> name;we display_p() cout << endl <<"Id: "<< id << "\nName: " << name <
> fees 3 void display_s() { display_p0s cout <<"Course: "<< course << "\nFee:" << fee << endl; h int main) Students; sset_s()s sdisplay_s() return 0;} ourrur: Enter the 1d:054 Enter the Name: vaibhay Enter the Course Name: B.tech Enter the Course Fee:300000 Ta: 54 Name: vaibhay Course: B.tech Fee: 300000Program 11: Write a program for friend function in C++ include
using namespace std; class Distance private: int meter; fiend int addFive(Distance); public: Distance(): meter(0) {} } int addFive( Distance d) {d.meter += 5. return d.meter; } int main { Distance D: cout << "Distance: " << addFive(D);retum 0; Output; Distance: 5Program12: Write a program for inline function +#include
using namespace std class operation { inta, b,add, sub, mul; float div; public: void get(): void sum(); void difference(): void product): void division() inline void operation =:get() cout << "Enter first value:"scin >> a; cout< “Enter second value:"; b; inline void operation ::sum() { add =a+b; cout << "Addition of two numbers: "
using namespace sid; class, public void show() cout << "Base class" << std:sendl; class derived! : public base public void show() cout << "Derived class 1" << std::endl: bh class derived? : public base { public void show()‘ std::cout << "Derived class 2" << std::endl; int main) { base *b; derived! dl: derived? 42: beadl; b>show(: b=ad2; boshow()s return 0; Base class Base class 2. Pure virtual function#include
using namespace stds # Abstract class class Shape public virtual float caleulateArea() = 0; // pure virtual function.Es class Square - public Shape { float a; public: ‘Square(float 1) t asl; float calculateArea() t reurnata; class Cirele : public Shape { float r; public Circle(float x) { rex: float calculaterea()return 3.14* rr; class Rectangle : public Shape float 1; float b; public: Rectangle (float x, float y) { float calculateArea() { return Ib int main() { Shape *shape; Square s(3.4); Rectangle 15.6); Circle e(7.8);shape =&s; intal =shape>calculateArea(): shape = &r; int a2 = shape->caleulateArea(); shape = int a3 = shape--caleulateArea(); cout << "Area of the square is" <
using namespace stds template
T myMax(T x, T y) return (> y) PX 2y5 int main) { cout << myMax
('g Nc endl; return 0;Program-2: Write a program for exception handling in C++. #include
using namespace std: int main() { double numerator, denominator, divide; cout << "Enter numerator: " cin >> numerator; cout << "Enter denominator: "; cin >> denon nator: wry if (denominator throw 0; divide = numerator / denominator; cout << numerator <<" /" << denominator <<" =" << divide << endl; catch (int num_exception) { cout << "Enror: Cannot divide by" << num_exception << endl; return 0; Output: Enter numerator: 2 Enter denominator: 4 2/4205
You might also like
Oodp Practical File
PDF
No ratings yet
Oodp Practical File
20 pages
Object Oriented Programming Using C++
PDF
No ratings yet
Object Oriented Programming Using C++
5 pages
Lab Manual - 2023-24
PDF
No ratings yet
Lab Manual - 2023-24
6 pages
OOPS
PDF
No ratings yet
OOPS
6 pages
OOP manual
PDF
No ratings yet
OOP manual
18 pages
bcom c and c++
PDF
No ratings yet
bcom c and c++
3 pages
Faculty of Engineering & Technology First Year Bachelor of Engineering Course Code: 102000212 Course Title: Object Oriented Programming
PDF
No ratings yet
Faculty of Engineering & Technology First Year Bachelor of Engineering Course Code: 102000212 Course Title: Object Oriented Programming
5 pages
C++ Lab R19
PDF
No ratings yet
C++ Lab R19
5 pages
Cs Program File Class 12
PDF
No ratings yet
Cs Program File Class 12
320 pages
c++ file
PDF
No ratings yet
c++ file
28 pages
Intro C++ ProgrammingSyllabus(2)
PDF
No ratings yet
Intro C++ ProgrammingSyllabus(2)
3 pages
CS JournalprgmsFinal2024
PDF
No ratings yet
CS JournalprgmsFinal2024
18 pages
Lab Assignment and Answer Format (PCA1-CPP).Docx
PDF
No ratings yet
Lab Assignment and Answer Format (PCA1-CPP).Docx
19 pages
BSC (CS) 2nd Sem
PDF
No ratings yet
BSC (CS) 2nd Sem
2 pages
C++ Practical Program
PDF
No ratings yet
C++ Practical Program
44 pages
OOPS C++ LAB List of Experiments
PDF
No ratings yet
OOPS C++ LAB List of Experiments
2 pages
XIICS-Practical Portfolio
PDF
No ratings yet
XIICS-Practical Portfolio
110 pages
Lab Record
PDF
No ratings yet
Lab Record
126 pages
Sub-C++ Lab Index
PDF
No ratings yet
Sub-C++ Lab Index
2 pages
Programming Practice Using C++ (IT594F) : Assignment
PDF
No ratings yet
Programming Practice Using C++ (IT594F) : Assignment
3 pages
C++ Assignment
PDF
No ratings yet
C++ Assignment
16 pages
OOP-Paradigm with C++
PDF
No ratings yet
OOP-Paradigm with C++
5 pages
APznzaYLsRd8Svkd4QP9GWRBjHWl6JF3tP-DIYCGU7pFD1X6qtAsz7ZX2kQOnid64S7jS975QD-L3XYk3YHaX6yh1fleocZkfr_LBd4bz90MlkJYyWn0n6Pl0YDIRgXKoH-xTdDz_mOXiqy_w72yPfSqcur8RAReuxRPEWSd059J9EaSwx0aY9hUllNjWsY5MwrUpt0qybtFmjwI-kbNsr
PDF
No ratings yet
APznzaYLsRd8Svkd4QP9GWRBjHWl6JF3tP-DIYCGU7pFD1X6qtAsz7ZX2kQOnid64S7jS975QD-L3XYk3YHaX6yh1fleocZkfr_LBd4bz90MlkJYyWn0n6Pl0YDIRgXKoH-xTdDz_mOXiqy_w72yPfSqcur8RAReuxRPEWSd059J9EaSwx0aY9hUllNjWsY5MwrUpt0qybtFmjwI-kbNsr
4 pages
oops labmanual_2
PDF
No ratings yet
oops labmanual_2
74 pages
OOPS Manual
PDF
No ratings yet
OOPS Manual
39 pages
Assignment of C++ by Gourob CSIT 212061001
PDF
No ratings yet
Assignment of C++ by Gourob CSIT 212061001
20 pages
Practical File Oops
PDF
No ratings yet
Practical File Oops
41 pages
Introduction C - Programming-Lab Manual
PDF
No ratings yet
Introduction C - Programming-Lab Manual
12 pages
CSL0203 - OOP-Paradigm With C
PDF
No ratings yet
CSL0203 - OOP-Paradigm With C
5 pages
II bcom-LABPROGRAMS
PDF
No ratings yet
II bcom-LABPROGRAMS
42 pages
Department of Electrical and Electronics Engineering: Lab Manual
PDF
No ratings yet
Department of Electrical and Electronics Engineering: Lab Manual
53 pages
Object Oriented Programming Using C++
PDF
No ratings yet
Object Oriented Programming Using C++
16 pages
PraList C++
PDF
No ratings yet
PraList C++
5 pages
Oops
PDF
No ratings yet
Oops
8 pages
EC 362 C++ Lab Manual PDF
PDF
No ratings yet
EC 362 C++ Lab Manual PDF
26 pages
Lab QBank 2018
PDF
No ratings yet
Lab QBank 2018
4 pages
Computer Science. Syllabus wef 2019-20pdf
PDF
No ratings yet
Computer Science. Syllabus wef 2019-20pdf
38 pages
13 - 1 Sem CS
PDF
No ratings yet
13 - 1 Sem CS
4 pages
Data Structure and C - Lab
PDF
No ratings yet
Data Structure and C - Lab
3 pages
B.sc_.(PMC) Computer Science as One Subject_0
PDF
No ratings yet
B.sc_.(PMC) Computer Science as One Subject_0
51 pages
Complete The Following List of Program For Practical Files
PDF
No ratings yet
Complete The Following List of Program For Practical Files
4 pages
Oops Manual
PDF
No ratings yet
Oops Manual
46 pages
Bca 3
PDF
No ratings yet
Bca 3
35 pages
OOPs With C++ Laboratory Manual 230516 123658
PDF
No ratings yet
OOPs With C++ Laboratory Manual 230516 123658
42 pages
Harsh CPP MSC It 1st Sem
PDF
No ratings yet
Harsh CPP MSC It 1st Sem
76 pages
C Lesson Plan
PDF
No ratings yet
C Lesson Plan
5 pages
Questions
PDF
No ratings yet
Questions
6 pages
24CS101
PDF
No ratings yet
24CS101
5 pages
OOPC LAB MANUAL htfhyfhvhvhg
PDF
No ratings yet
OOPC LAB MANUAL htfhyfhvhvhg
2 pages
c++docfile (1)
PDF
No ratings yet
c++docfile (1)
17 pages
OOPS C++ LAB List of Experiments
PDF
No ratings yet
OOPS C++ LAB List of Experiments
2 pages
OOPs Lab Questions
PDF
No ratings yet
OOPs Lab Questions
2 pages
Cse2001 Object-Oriented-programming-with-c++ LTP 1.0 1 Cse2001
PDF
No ratings yet
Cse2001 Object-Oriented-programming-with-c++ LTP 1.0 1 Cse2001
4 pages
C Lab-2010
PDF
No ratings yet
C Lab-2010
4 pages
Oop Practical Manual
PDF
100% (1)
Oop Practical Manual
34 pages
Practical Set-OOP
PDF
No ratings yet
Practical Set-OOP
31 pages
4th sem major J2 syllabus
PDF
No ratings yet
4th sem major J2 syllabus
2 pages
Object Oriented Programming Using C++
PDF
No ratings yet
Object Oriented Programming Using C++
17 pages