SlideShare a Scribd company logo
1 of 8
Question-01
#include<iostream>
using namespace std;
class Citizen
{
private:
string name;
string nationality;
public:
Citizen()
{
}
Citizen(string n,string na)
{
name=n;
nationality=na;
}
void display()
{
cout<<"Name is: "<<name<<endl;
cout<<"Nationality is: "<<nationality<<endl;
}
~Citizen()
{
cout<<"distructor is called"<<endl;
}
};
main()
{
Citizen call1("usman","Pakistan");
Citizen call2=call1;
Citizen call3=call1;
call1.display();
call2.display();
cout<<" "<<endl;
call3.display();
return 0;
}
Question-02
#include <iostream>
#include<string>
using namespace std;
class Time
{
private:
int hour,minute,second;
public:
void get()
{
cout<<"Enter the hours: "<<endl;
cin>>hour;
cout<<"Enter the minutes: "<<endl;
cin>>minute;
cout<<"Enter the seconds: "<<endl;
cin>>second;
}
void show()
{
cout<<"Time is: n ";
cout<<hour<<":"<<minute<<":"<<second;
}
Time sum(Time a)
{
Time res;
res.hour=a.hour+hour;
res.minute=a.minute+minute;
res.second=a.second+second;
return res;
}
};
int main()
{
Time tim,tim2,tim3;
tim.get();
tim2.get();
tim3=tim.sum(tim2);
tim3.show();
return 0;
}
Question-03
#include<iostream>
#include<conio.h>
using namespace std;
class Box
{
private:
float length,breadth,height;
public:
Box(float l,float b, float h)
{
length=l;
breadth=b;
height=h;
}
void display()
{
cout<<"Length:"<<length<<endl;
cout<<"Breadth:"<<breadth<<endl;
cout<<"Height:"<<height<<endl;
}
};
int main()
{
Box call(25.4,45.2,20.22);
call.display();
return 0;
}
Question-04
#include<iostream>
#include<conio.h>
using namespace std;
class Shape
{
public:
void area(float n,float b,float r)
{
float ar;
ar=0.5*3.141*r;
cout<<"Area of rectangle is:"<<ar<<endl;
}
float area(float r)
{
float res;
res=3.141*r*r;
cout<<"Area of Circle: "<<res<<endl;
}
float area(float l,float b)
{
float ress;
ress=l*b;
cout<<"Area of Rectangle Box:"<<ress<<endl;
}
};
int main()
{
float b,h,r,l;
float result;
Shape call;
cout<<"Enter the Base"<<endl;
cin>>b;
cout<<"Enter the Hieght"<<endl;
cin>>h;
call.area(b,h);
cout<<"Enter the Radius of Circle: "<<endl;
cin>>r;
call.area(r);
cout<<"Enter the Length:"<<endl;
cin>>l;
cout<<"Enter the Bredth:"<<endl;
cin>>b;
call.area(l,b);
return 0;
}
Question=-05
#include<iostream>
#include<conio.h>
using namespace std;
class hospital
{
int rooms,bed,days,pationt;
float per_day;
public:
void set(int rm, int be, int da, int pat,float perd)
{
rooms=rm;
bed=be;
days=da;
pationt=pat;
per_day=perd;
}
void geter()
{
cout<<"Total Room is:"<<rooms<<endl;
cout<<"Total bed is:"<<bed<<endl;
cout<<"Total days:"<<days<<endl;
cout<<"total pationt:"<<pationt<<endl;
cout<<"Pationt charges"<<per_day<<endl;
}
void bedallotment()
{
int bdal;
bdal=(rooms*bed)-pationt;
cout<<"Total number of the bed is:"<<bdal;
}
};
int main()
{
int ro, b,d,p;
float perd;
hospital call;
cout<<"Enter the room :"<<endl;
cin>>ro;
cout<<"Enter the bed :"<<endl;
cin>>b;
cout<<"Enter the days :"<<endl;
cin>>d;
cout<<"Enter the pationt :"<<endl;
cin>>p;
cout<<"Enter the perday charges :"<<endl;
cin>>perd;
call.set(ro,b,d,p,perd);
call.geter();
call.bedallotment();
return 0;
}
Question-06
#include<iostream>
using namespace std;
class rectangle
{
private:
float width,i,j;
int length;
public:
void setwid(float wid)
{
width=wid;
}
void setlen(int len)
{
length=len;
}
float area()
{
float i;
i=length*width;
return i;
}
float pirem()
{
float j;
j= 2*length*2 *width;
return j;
}
int same(rectangle te)
{
if(i==te.i)
{
cout<<"Same type"<<endl;
return 1;
}
else
{
cout<<"Not same"<<endl;
return 0;
}
}
};
int main()
{
float area,pirem,are,pir;
int rectangl;
rectangle call,call1;
call.setwid(2.5);
call.setlen(5);
call1.setwid(18.9);
call1.setlen(5);
area=call.area();
pirem=call.pirem();
cout<<"Area is:"<<area<<endl<<"n";
cout<<"Perimeters is:"<<pirem<<endl<<"n";;
are=call1.area();
pir=call1.pirem();
cout<<"Second Area is:"<<are<<endl<<"n";;
cout<<"Second Piremeters is :"<<pir<<endl<<"n";;
rectangl=call.same(call1);
cout<<rectangl<<endl;
return 0;
}
Question-07
#include<iostream>
#include<conio.h>
#include<string>
using namespace std;
class batsman
{
private:
string bcode;
string bname;
int innings, notout, runs;
public:
void readdata(string bde, string nme, int ings,int nt,int rn)
{
bname=nme;
bcode=bde;
innings=ings;
notout=nt;
runs=rn;
}
void displaydata()
{
cout<<"Bats Name is:"<<bname<<endl;
cout<<"Innings is:"<<innings<<endl;
cout<<"Not out is:"<<notout<<endl;
cout<<"Runs is:"<<runs<<endl;
}
void calavg()
{
float batavg;
batavg =runs/(innings-notout);
cout<<"Avg Is :"<<batavg<<endl;
}
};
int main()
{
string na,bco;
int in,no,rns;
cout<<"Enter the Bats Man Name:"<<endl;
cin>>na;
cout<<"Enter the Bats Man Code:"<<endl;
cin>>bco;
cout<<"Enter the Innings :"<<endl;
cin>>in;
cout<<"Enter the Notout:"<<endl;
cin>>no;
cout<<"Enter the runs :"<<endl;
cin>>rns;
batsman call;
call.readdata(na,bco,in,no,rns);
call.displaydata();
call.calavg();
return 0;
}
Question-08
#include<iostream>
#include<conio.h>
using namespace std;
class complex1;
class complex{
private:
int x,y;
public:
complex()
{
}
void in()
{
cout<<"Enter real number";
cin>>x;
cout<<"Enter an imaginary number";
cin>>y;
}
void show()
{
cout<<"n1st complex numbern";
cout<<x<<"+"<<y<<"i"<<"n";
}
friend void show2(complex,complex1);
};
class complex1
{
private:
int m,n;
public:
complex1()
{
}
void input()
{
cout<<"nEnter 2nd complex numbern";
cout<<"Enter real number";
cin>>m;
cout<<"Enter an imaginary number";
cin>>n;
}
void show1()
{
cout<<"n2nd complex numbern";
cout<<m<<"+"<<n<<"i";
}
friend void show2(complex,complex1);
};
void show2(complex c, complex1 d )
{
int img,real;
real=c.x+d.m;
img=c.y+d.n;
cout<<"sum of complex numbern";
cout<<real<<"+"<<img<<"i";
}
int main()
{
complex obj1;
complex1 obj2;
obj1.in();
obj2.input();
obj1.show();
obj2.show1();
show2(obj1,obj2);
_getch();
}
Question-10
#include<iostream>
#include<conio.h>
using namespace std;
class complex1;
class complex{
private:
int x,y;
public:
complex()
{
}
void in()
{
cout<<"Enter real number";
cin>>x;
cout<<"Enter an imaginary number";
cin>>y;
}
void show()
{
cout<<"n1st complex numbern";
cout<<x<<"+"<<y<<"i"<<"n";
}
friend void show2(complex,complex1);
};
class complex1
{
private:
int m,n;
public:
complex1()
{
}
void input()
{
cout<<"nEnter 2nd complex numbern";
cout<<"Enter real number";
cin>>m;
cout<<"Enter an imaginary number";
cin>>n;
}
void show1()
{
cout<<"n2nd complex numbern";
cout<<m<<"+"<<n<<"i";
}
friend void show2(complex,complex1);
};
void show2(complex c, complex1 d )
{
int img,real;
real=c.x+d.m;
img=c.y+d.n;
cout<<"sum of complex numbern";
cout<<real<<"+"<<img<<"i";
}
int main()
{
complex obj1;
complex1 obj2;
obj1.in();
obj2.input();
obj1.show();
obj2.show1();
show2(obj1,obj2);
_getch();
}

More Related Content

What's hot

What's hot (20)

C++ L05-Functions
C++ L05-FunctionsC++ L05-Functions
C++ L05-Functions
 
Oop1
Oop1Oop1
Oop1
 
[WELC] 21. I’m Changing the Same Code All Over the Place
[WELC] 21. I’m Changing the Same Code All Over the Place[WELC] 21. I’m Changing the Same Code All Over the Place
[WELC] 21. I’m Changing the Same Code All Over the Place
 
Implementing Software Machines in C and Go
Implementing Software Machines in C and GoImplementing Software Machines in C and Go
Implementing Software Machines in C and Go
 
C++ TUTORIAL 9
C++ TUTORIAL 9C++ TUTORIAL 9
C++ TUTORIAL 9
 
C++ TUTORIAL 8
C++ TUTORIAL 8C++ TUTORIAL 8
C++ TUTORIAL 8
 
C++ TUTORIAL 6
C++ TUTORIAL 6C++ TUTORIAL 6
C++ TUTORIAL 6
 
Go ahead, make my day
Go ahead, make my dayGo ahead, make my day
Go ahead, make my day
 
C++ L07-Struct
C++ L07-StructC++ L07-Struct
C++ L07-Struct
 
C++ L09-Classes Part2
C++ L09-Classes Part2C++ L09-Classes Part2
C++ L09-Classes Part2
 
C++ L01-Variables
C++ L01-VariablesC++ L01-Variables
C++ L01-Variables
 
C++ Lambda and concurrency
C++ Lambda and concurrencyC++ Lambda and concurrency
C++ Lambda and concurrency
 
Whispered secrets
Whispered secretsWhispered secrets
Whispered secrets
 
.NET 2015: Будущее рядом
.NET 2015: Будущее рядом.NET 2015: Будущее рядом
.NET 2015: Будущее рядом
 
Asssignment2
Asssignment2 Asssignment2
Asssignment2
 
C++ L03-Control Structure
C++ L03-Control StructureC++ L03-Control Structure
C++ L03-Control Structure
 
Ds 2 cycle
Ds 2 cycleDs 2 cycle
Ds 2 cycle
 
Computer Programming- Lecture 6
Computer Programming- Lecture 6Computer Programming- Lecture 6
Computer Programming- Lecture 6
 
Computer Programming- Lecture 4
Computer Programming- Lecture 4Computer Programming- Lecture 4
Computer Programming- Lecture 4
 
C++ L04-Array+String
C++ L04-Array+StringC++ L04-Array+String
C++ L04-Array+String
 

Similar to Oopppp

Computer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdfComputer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdfHIMANSUKUMAR12
 
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloadingkinan keshkeh
 
Part 3-functions1-120315220356-phpapp01
Part 3-functions1-120315220356-phpapp01Part 3-functions1-120315220356-phpapp01
Part 3-functions1-120315220356-phpapp01Abdul Samee
 
Tugas praktikukm pemrograman c++
Tugas praktikukm  pemrograman c++Tugas praktikukm  pemrograman c++
Tugas praktikukm pemrograman c++Dendi Riadi
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing Swakriti Rathore
 
ch9_additional.ppt
ch9_additional.pptch9_additional.ppt
ch9_additional.pptLokeshK66
 
ch5_additional.ppt
ch5_additional.pptch5_additional.ppt
ch5_additional.pptLokeshK66
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd StudyChris Ohk
 
C++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfC++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfyamew16788
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101premrings
 
Programming - Marla Fuentes
Programming - Marla FuentesProgramming - Marla Fuentes
Programming - Marla Fuentesmfuentessss
 
Program(Output)
Program(Output)Program(Output)
Program(Output)princy75
 
Cs1123 8 functions
Cs1123 8 functionsCs1123 8 functions
Cs1123 8 functionsTAlha MAlik
 

Similar to Oopppp (20)

Ch7 C++
Ch7 C++Ch7 C++
Ch7 C++
 
oop Lecture 4
oop Lecture 4oop Lecture 4
oop Lecture 4
 
Algo
AlgoAlgo
Algo
 
oodp elab.pdf
oodp elab.pdfoodp elab.pdf
oodp elab.pdf
 
Computer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdfComputer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdf
 
C++ practical
C++ practicalC++ practical
C++ practical
 
Oop lab report
Oop lab reportOop lab report
Oop lab report
 
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
 
Part 3-functions1-120315220356-phpapp01
Part 3-functions1-120315220356-phpapp01Part 3-functions1-120315220356-phpapp01
Part 3-functions1-120315220356-phpapp01
 
Tugas praktikukm pemrograman c++
Tugas praktikukm  pemrograman c++Tugas praktikukm  pemrograman c++
Tugas praktikukm pemrograman c++
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing
 
ch9_additional.ppt
ch9_additional.pptch9_additional.ppt
ch9_additional.ppt
 
ch5_additional.ppt
ch5_additional.pptch5_additional.ppt
ch5_additional.ppt
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd Study
 
C++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfC++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdf
 
Cpp c++ 1
Cpp c++ 1Cpp c++ 1
Cpp c++ 1
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101
 
Programming - Marla Fuentes
Programming - Marla FuentesProgramming - Marla Fuentes
Programming - Marla Fuentes
 
Program(Output)
Program(Output)Program(Output)
Program(Output)
 
Cs1123 8 functions
Cs1123 8 functionsCs1123 8 functions
Cs1123 8 functions
 

Recently uploaded

VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...Suhani Kapoor
 
Delhi Call Girls South Ex 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Ex 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls South Ex 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Ex 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual serviceanilsa9823
 
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call GirlsDelhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girlsshivangimorya083
 
Call Girls In Bhikaji Cama Place 24/7✡️9711147426✡️ Escorts Service
Call Girls In Bhikaji Cama Place 24/7✡️9711147426✡️ Escorts ServiceCall Girls In Bhikaji Cama Place 24/7✡️9711147426✡️ Escorts Service
Call Girls In Bhikaji Cama Place 24/7✡️9711147426✡️ Escorts Servicejennyeacort
 
CFO_SB_Career History_Multi Sector Experience
CFO_SB_Career History_Multi Sector ExperienceCFO_SB_Career History_Multi Sector Experience
CFO_SB_Career History_Multi Sector ExperienceSanjay Bokadia
 
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...Suhani Kapoor
 
PM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterPM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterHector Del Castillo, CPM, CPMM
 
Dubai Call Girls Starlet O525547819 Call Girls Dubai Showen Dating
Dubai Call Girls Starlet O525547819 Call Girls Dubai Showen DatingDubai Call Girls Starlet O525547819 Call Girls Dubai Showen Dating
Dubai Call Girls Starlet O525547819 Call Girls Dubai Showen Datingkojalkojal131
 
Dubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big Boody
Dubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big BoodyDubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big Boody
Dubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big Boodykojalkojal131
 
NPPE STUDY GUIDE - NOV2021_study_104040.pdf
NPPE STUDY GUIDE - NOV2021_study_104040.pdfNPPE STUDY GUIDE - NOV2021_study_104040.pdf
NPPE STUDY GUIDE - NOV2021_study_104040.pdfDivyeshPatel234692
 
VIP Call Girl Bhilai Aashi 8250192130 Independent Escort Service Bhilai
VIP Call Girl Bhilai Aashi 8250192130 Independent Escort Service BhilaiVIP Call Girl Bhilai Aashi 8250192130 Independent Escort Service Bhilai
VIP Call Girl Bhilai Aashi 8250192130 Independent Escort Service BhilaiSuhani Kapoor
 
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...gurkirankumar98700
 
Experience Certificate - Marketing Analyst-Soham Mondal.pdf
Experience Certificate - Marketing Analyst-Soham Mondal.pdfExperience Certificate - Marketing Analyst-Soham Mondal.pdf
Experience Certificate - Marketing Analyst-Soham Mondal.pdfSoham Mondal
 
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...Suhani Kapoor
 
Delhi Call Girls Preet Vihar 9711199171 ☎✔👌✔ Whatsapp Body to body massage wi...
Delhi Call Girls Preet Vihar 9711199171 ☎✔👌✔ Whatsapp Body to body massage wi...Delhi Call Girls Preet Vihar 9711199171 ☎✔👌✔ Whatsapp Body to body massage wi...
Delhi Call Girls Preet Vihar 9711199171 ☎✔👌✔ Whatsapp Body to body massage wi...shivangimorya083
 
Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...
Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...
Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...Niya Khan
 
Internshala Student Partner 6.0 Jadavpur University Certificate
Internshala Student Partner 6.0 Jadavpur University CertificateInternshala Student Partner 6.0 Jadavpur University Certificate
Internshala Student Partner 6.0 Jadavpur University CertificateSoham Mondal
 
Business Development and Product Strategy for a SME named SARL based in Leban...
Business Development and Product Strategy for a SME named SARL based in Leban...Business Development and Product Strategy for a SME named SARL based in Leban...
Business Development and Product Strategy for a SME named SARL based in Leban...Soham Mondal
 
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service CuttackVIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service CuttackSuhani Kapoor
 

Recently uploaded (20)

VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
 
Delhi Call Girls South Ex 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Ex 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls South Ex 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Ex 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
 
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call GirlsDelhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
 
Call Girls In Bhikaji Cama Place 24/7✡️9711147426✡️ Escorts Service
Call Girls In Bhikaji Cama Place 24/7✡️9711147426✡️ Escorts ServiceCall Girls In Bhikaji Cama Place 24/7✡️9711147426✡️ Escorts Service
Call Girls In Bhikaji Cama Place 24/7✡️9711147426✡️ Escorts Service
 
CFO_SB_Career History_Multi Sector Experience
CFO_SB_Career History_Multi Sector ExperienceCFO_SB_Career History_Multi Sector Experience
CFO_SB_Career History_Multi Sector Experience
 
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
 
PM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterPM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring Chapter
 
Dubai Call Girls Starlet O525547819 Call Girls Dubai Showen Dating
Dubai Call Girls Starlet O525547819 Call Girls Dubai Showen DatingDubai Call Girls Starlet O525547819 Call Girls Dubai Showen Dating
Dubai Call Girls Starlet O525547819 Call Girls Dubai Showen Dating
 
Dubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big Boody
Dubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big BoodyDubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big Boody
Dubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big Boody
 
NPPE STUDY GUIDE - NOV2021_study_104040.pdf
NPPE STUDY GUIDE - NOV2021_study_104040.pdfNPPE STUDY GUIDE - NOV2021_study_104040.pdf
NPPE STUDY GUIDE - NOV2021_study_104040.pdf
 
VIP Call Girl Bhilai Aashi 8250192130 Independent Escort Service Bhilai
VIP Call Girl Bhilai Aashi 8250192130 Independent Escort Service BhilaiVIP Call Girl Bhilai Aashi 8250192130 Independent Escort Service Bhilai
VIP Call Girl Bhilai Aashi 8250192130 Independent Escort Service Bhilai
 
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
 
Experience Certificate - Marketing Analyst-Soham Mondal.pdf
Experience Certificate - Marketing Analyst-Soham Mondal.pdfExperience Certificate - Marketing Analyst-Soham Mondal.pdf
Experience Certificate - Marketing Analyst-Soham Mondal.pdf
 
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
 
Delhi Call Girls Preet Vihar 9711199171 ☎✔👌✔ Whatsapp Body to body massage wi...
Delhi Call Girls Preet Vihar 9711199171 ☎✔👌✔ Whatsapp Body to body massage wi...Delhi Call Girls Preet Vihar 9711199171 ☎✔👌✔ Whatsapp Body to body massage wi...
Delhi Call Girls Preet Vihar 9711199171 ☎✔👌✔ Whatsapp Body to body massage wi...
 
Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...
Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...
Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...
 
Internshala Student Partner 6.0 Jadavpur University Certificate
Internshala Student Partner 6.0 Jadavpur University CertificateInternshala Student Partner 6.0 Jadavpur University Certificate
Internshala Student Partner 6.0 Jadavpur University Certificate
 
Business Development and Product Strategy for a SME named SARL based in Leban...
Business Development and Product Strategy for a SME named SARL based in Leban...Business Development and Product Strategy for a SME named SARL based in Leban...
Business Development and Product Strategy for a SME named SARL based in Leban...
 
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service CuttackVIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
 

Oopppp

  • 1. Question-01 #include<iostream> using namespace std; class Citizen { private: string name; string nationality; public: Citizen() { } Citizen(string n,string na) { name=n; nationality=na; } void display() { cout<<"Name is: "<<name<<endl; cout<<"Nationality is: "<<nationality<<endl; } ~Citizen() { cout<<"distructor is called"<<endl; } }; main() { Citizen call1("usman","Pakistan"); Citizen call2=call1; Citizen call3=call1; call1.display(); call2.display(); cout<<" "<<endl; call3.display(); return 0; } Question-02 #include <iostream> #include<string> using namespace std; class Time { private: int hour,minute,second; public: void get() { cout<<"Enter the hours: "<<endl; cin>>hour; cout<<"Enter the minutes: "<<endl; cin>>minute; cout<<"Enter the seconds: "<<endl; cin>>second; } void show() { cout<<"Time is: n "; cout<<hour<<":"<<minute<<":"<<second; } Time sum(Time a)
  • 2. { Time res; res.hour=a.hour+hour; res.minute=a.minute+minute; res.second=a.second+second; return res; } }; int main() { Time tim,tim2,tim3; tim.get(); tim2.get(); tim3=tim.sum(tim2); tim3.show(); return 0; } Question-03 #include<iostream> #include<conio.h> using namespace std; class Box { private: float length,breadth,height; public: Box(float l,float b, float h) { length=l; breadth=b; height=h; } void display() { cout<<"Length:"<<length<<endl; cout<<"Breadth:"<<breadth<<endl; cout<<"Height:"<<height<<endl; } }; int main() { Box call(25.4,45.2,20.22); call.display(); return 0; } Question-04 #include<iostream> #include<conio.h> using namespace std; class Shape { public: void area(float n,float b,float r) { float ar; ar=0.5*3.141*r; cout<<"Area of rectangle is:"<<ar<<endl; } float area(float r) { float res;
  • 3. res=3.141*r*r; cout<<"Area of Circle: "<<res<<endl; } float area(float l,float b) { float ress; ress=l*b; cout<<"Area of Rectangle Box:"<<ress<<endl; } }; int main() { float b,h,r,l; float result; Shape call; cout<<"Enter the Base"<<endl; cin>>b; cout<<"Enter the Hieght"<<endl; cin>>h; call.area(b,h); cout<<"Enter the Radius of Circle: "<<endl; cin>>r; call.area(r); cout<<"Enter the Length:"<<endl; cin>>l; cout<<"Enter the Bredth:"<<endl; cin>>b; call.area(l,b); return 0; } Question=-05 #include<iostream> #include<conio.h> using namespace std; class hospital { int rooms,bed,days,pationt; float per_day; public: void set(int rm, int be, int da, int pat,float perd) { rooms=rm; bed=be; days=da; pationt=pat; per_day=perd; } void geter() { cout<<"Total Room is:"<<rooms<<endl; cout<<"Total bed is:"<<bed<<endl; cout<<"Total days:"<<days<<endl; cout<<"total pationt:"<<pationt<<endl; cout<<"Pationt charges"<<per_day<<endl; } void bedallotment() { int bdal; bdal=(rooms*bed)-pationt; cout<<"Total number of the bed is:"<<bdal; }
  • 4. }; int main() { int ro, b,d,p; float perd; hospital call; cout<<"Enter the room :"<<endl; cin>>ro; cout<<"Enter the bed :"<<endl; cin>>b; cout<<"Enter the days :"<<endl; cin>>d; cout<<"Enter the pationt :"<<endl; cin>>p; cout<<"Enter the perday charges :"<<endl; cin>>perd; call.set(ro,b,d,p,perd); call.geter(); call.bedallotment(); return 0; } Question-06 #include<iostream> using namespace std; class rectangle { private: float width,i,j; int length; public: void setwid(float wid) { width=wid; } void setlen(int len) { length=len; } float area() { float i; i=length*width; return i; } float pirem() { float j; j= 2*length*2 *width; return j; } int same(rectangle te) { if(i==te.i) { cout<<"Same type"<<endl; return 1; } else { cout<<"Not same"<<endl;
  • 5. return 0; } } }; int main() { float area,pirem,are,pir; int rectangl; rectangle call,call1; call.setwid(2.5); call.setlen(5); call1.setwid(18.9); call1.setlen(5); area=call.area(); pirem=call.pirem(); cout<<"Area is:"<<area<<endl<<"n"; cout<<"Perimeters is:"<<pirem<<endl<<"n";; are=call1.area(); pir=call1.pirem(); cout<<"Second Area is:"<<are<<endl<<"n";; cout<<"Second Piremeters is :"<<pir<<endl<<"n";; rectangl=call.same(call1); cout<<rectangl<<endl; return 0; } Question-07 #include<iostream> #include<conio.h> #include<string> using namespace std; class batsman { private: string bcode; string bname; int innings, notout, runs; public: void readdata(string bde, string nme, int ings,int nt,int rn) { bname=nme; bcode=bde; innings=ings; notout=nt; runs=rn; } void displaydata() { cout<<"Bats Name is:"<<bname<<endl; cout<<"Innings is:"<<innings<<endl; cout<<"Not out is:"<<notout<<endl; cout<<"Runs is:"<<runs<<endl; } void calavg() { float batavg; batavg =runs/(innings-notout); cout<<"Avg Is :"<<batavg<<endl; }
  • 6. }; int main() { string na,bco; int in,no,rns; cout<<"Enter the Bats Man Name:"<<endl; cin>>na; cout<<"Enter the Bats Man Code:"<<endl; cin>>bco; cout<<"Enter the Innings :"<<endl; cin>>in; cout<<"Enter the Notout:"<<endl; cin>>no; cout<<"Enter the runs :"<<endl; cin>>rns; batsman call; call.readdata(na,bco,in,no,rns); call.displaydata(); call.calavg(); return 0; } Question-08 #include<iostream> #include<conio.h> using namespace std; class complex1; class complex{ private: int x,y; public: complex() { } void in() { cout<<"Enter real number"; cin>>x; cout<<"Enter an imaginary number"; cin>>y; } void show() { cout<<"n1st complex numbern"; cout<<x<<"+"<<y<<"i"<<"n"; } friend void show2(complex,complex1); }; class complex1 { private: int m,n; public: complex1() { } void input() { cout<<"nEnter 2nd complex numbern"; cout<<"Enter real number"; cin>>m; cout<<"Enter an imaginary number"; cin>>n; }
  • 7. void show1() { cout<<"n2nd complex numbern"; cout<<m<<"+"<<n<<"i"; } friend void show2(complex,complex1); }; void show2(complex c, complex1 d ) { int img,real; real=c.x+d.m; img=c.y+d.n; cout<<"sum of complex numbern"; cout<<real<<"+"<<img<<"i"; } int main() { complex obj1; complex1 obj2; obj1.in(); obj2.input(); obj1.show(); obj2.show1(); show2(obj1,obj2); _getch(); } Question-10 #include<iostream> #include<conio.h> using namespace std; class complex1; class complex{ private: int x,y; public: complex() { } void in() { cout<<"Enter real number"; cin>>x; cout<<"Enter an imaginary number"; cin>>y; } void show() { cout<<"n1st complex numbern"; cout<<x<<"+"<<y<<"i"<<"n"; } friend void show2(complex,complex1); }; class complex1 { private: int m,n; public: complex1() { } void input() {
  • 8. cout<<"nEnter 2nd complex numbern"; cout<<"Enter real number"; cin>>m; cout<<"Enter an imaginary number"; cin>>n; } void show1() { cout<<"n2nd complex numbern"; cout<<m<<"+"<<n<<"i"; } friend void show2(complex,complex1); }; void show2(complex c, complex1 d ) { int img,real; real=c.x+d.m; img=c.y+d.n; cout<<"sum of complex numbern"; cout<<real<<"+"<<img<<"i"; } int main() { complex obj1; complex1 obj2; obj1.in(); obj2.input(); obj1.show(); obj2.show1(); show2(obj1,obj2); _getch(); }