SlideShare a Scribd company logo
1 of 1
Download to read offline
#include #include #include using namespace std; class Point { public: Point(int x, int y) :
m_x(x), m_y(y) {} int getX() const { return m_x; } int getY() const { return m_y; } private: int
m_x, m_y; }; class Shape { public: Shape(const string& name, const Point& p) : m_name(name),
m_point(p) {} virtual ~Shape() {} virtual void draw() const = 0; virtual void print() const { cout
<< "Shape: " << m_name << " (" << m_point.getX() << "," << m_point.getY() << ")" << endl; }
private: string m_name; Point m_point; }; class OneD : public Shape { public: OneD(const
string& name, const Point& p1, const Point& p2) : Shape(name, p1), m_p2(p2) {} void draw()
const override {} void print() const override { Shape::print(); cout << " Point2: (" <<
m_p2.getX() << "," << m_p2.getY() << ")" << endl; } private: Point m_p2; }; class TwoD :
public Shape { public: TwoD(const string& name, const Point& p) : Shape(name, p) {} void
draw() const override {} }; class ThreeD : public Shape { public: ThreeD(const string& name,
const Point& p) : Shape(name, p) {} void draw() const override {} }; class Line : public OneD {
public: Line(const string& name, const Point& p1, const Point& p2) : OneD(name, p1, p2) {}
void draw() const override {} }; class Curve : public OneD { public: Curve(const string& name,
const Point& p1, const Point& p2, const Point& p3) : OneD(name, p1, p2), m_p3(p3) {} void
draw() const override {} void print() const override { OneD::print(); cout << " Point3: (" <<
m_p3.getX() << "," << m_p3.getY() << ")" << endl; } private: Point m_p3; }; class Circle :
public TwoD { public: Circle(const string& name, const Point& p, double radius) : TwoD(name,
p), m_radius(radius) {} void draw() const override {} void print() const override {
TwoD::print(); cout << " Radius: " << m_radius << endl; } private: double m_radius; }; class
Rectangle : public TwoD { public: Rectangle(const string& name, const Point& p1, const
Point& p2) : TwoD(name, p1), m_p2(p2) {} void draw() const override {} void print() const
override { TwoD::print(); cout << " Point2: (" << m_p2.getX() << "," << m_p2.getY() << ")" <<
endl; } private: Point m_p2; }; class Sphere : public ThreeD { public: Sphere(const string&
name, const Point& p, double radius) : ThreeD(name, p), m_radius(radius) {} void draw() const
override {} void print() const override { ThreeD::print(); cout << " Radius: " << m_radius <<
endl; } private
Errors I am getting. Please fix.

More Related Content

Similar to #include iostream #include vector #include string using namesp.pdf

code#includeiostream using namespace std; class Point {.pdf
code#includeiostream using namespace std; class Point {.pdfcode#includeiostream using namespace std; class Point {.pdf
code#includeiostream using namespace std; class Point {.pdfARYAN20071
 
Go ahead, make my day
Go ahead, make my dayGo ahead, make my day
Go ahead, make my dayTor Ivry
 
Pads lab manual final
Pads lab manual finalPads lab manual final
Pads lab manual finalAhalyaR
 
Help with the following code1. Rewrite to be contained in a vecto.pdf
Help with the following code1. Rewrite to be contained in a vecto.pdfHelp with the following code1. Rewrite to be contained in a vecto.pdf
Help with the following code1. Rewrite to be contained in a vecto.pdfezzi97
 
C++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorC++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorJussi Pohjolainen
 
C++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxC++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxssuser3cbb4c
 
Csphtp1 09
Csphtp1 09Csphtp1 09
Csphtp1 09HUST
 
#ifndef COURSES_H #define COURSES_H class Courses { privat.pdf
#ifndef COURSES_H #define COURSES_H class Courses { privat.pdf#ifndef COURSES_H #define COURSES_H class Courses { privat.pdf
#ifndef COURSES_H #define COURSES_H class Courses { privat.pdfanupambedcovers
 
L25-L26-Parameter passing techniques.pptx
L25-L26-Parameter passing techniques.pptxL25-L26-Parameter passing techniques.pptx
L25-L26-Parameter passing techniques.pptxhappycocoman
 

Similar to #include iostream #include vector #include string using namesp.pdf (20)

Oop objects_classes
Oop objects_classesOop objects_classes
Oop objects_classes
 
Lecture4
Lecture4Lecture4
Lecture4
 
Lecture4
Lecture4Lecture4
Lecture4
 
12
1212
12
 
code#includeiostream using namespace std; class Point {.pdf
code#includeiostream using namespace std; class Point {.pdfcode#includeiostream using namespace std; class Point {.pdf
code#includeiostream using namespace std; class Point {.pdf
 
C++ programs
C++ programsC++ programs
C++ programs
 
662305 10
662305 10662305 10
662305 10
 
Go ahead, make my day
Go ahead, make my dayGo ahead, make my day
Go ahead, make my day
 
Pads lab manual final
Pads lab manual finalPads lab manual final
Pads lab manual final
 
C++ L09-Classes Part2
C++ L09-Classes Part2C++ L09-Classes Part2
C++ L09-Classes Part2
 
Help with the following code1. Rewrite to be contained in a vecto.pdf
Help with the following code1. Rewrite to be contained in a vecto.pdfHelp with the following code1. Rewrite to be contained in a vecto.pdf
Help with the following code1. Rewrite to be contained in a vecto.pdf
 
C++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorC++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operator
 
oop Lecture 5
oop Lecture 5oop Lecture 5
oop Lecture 5
 
C++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxC++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptx
 
oop objects_classes
oop objects_classesoop objects_classes
oop objects_classes
 
3433 Ch09 Ppt
3433 Ch09 Ppt3433 Ch09 Ppt
3433 Ch09 Ppt
 
Csphtp1 09
Csphtp1 09Csphtp1 09
Csphtp1 09
 
#ifndef COURSES_H #define COURSES_H class Courses { privat.pdf
#ifndef COURSES_H #define COURSES_H class Courses { privat.pdf#ifndef COURSES_H #define COURSES_H class Courses { privat.pdf
#ifndef COURSES_H #define COURSES_H class Courses { privat.pdf
 
C++ Inheritance
C++ InheritanceC++ Inheritance
C++ Inheritance
 
L25-L26-Parameter passing techniques.pptx
L25-L26-Parameter passing techniques.pptxL25-L26-Parameter passing techniques.pptx
L25-L26-Parameter passing techniques.pptx
 

More from alstradecentreerode

(Rational Class) - use the original files to create the new progra.pdf
(Rational Class) - use the original files to create the new progra.pdf(Rational Class) - use the original files to create the new progra.pdf
(Rational Class) - use the original files to create the new progra.pdfalstradecentreerode
 
(Q001) Expand the Geotour10 folder in Google Earth by clicking the t.pdf
(Q001) Expand the Geotour10 folder in Google Earth by clicking the t.pdf(Q001) Expand the Geotour10 folder in Google Earth by clicking the t.pdf
(Q001) Expand the Geotour10 folder in Google Earth by clicking the t.pdfalstradecentreerode
 
(if any) is your opportunity cost.pdf
(if any) is your opportunity cost.pdf(if any) is your opportunity cost.pdf
(if any) is your opportunity cost.pdfalstradecentreerode
 
(Forecasting and forecast error metrics calculation) Suzy Homemaker .pdf
(Forecasting and forecast error metrics calculation) Suzy Homemaker .pdf(Forecasting and forecast error metrics calculation) Suzy Homemaker .pdf
(Forecasting and forecast error metrics calculation) Suzy Homemaker .pdfalstradecentreerode
 
(Elementary Statistics) Computer=1100(102r+1).pdf
(Elementary Statistics) Computer=1100(102r+1).pdf(Elementary Statistics) Computer=1100(102r+1).pdf
(Elementary Statistics) Computer=1100(102r+1).pdfalstradecentreerode
 
(Derecho empresarial) X le otorga a Y un patrimonio vitalicio. Pos.pdf
(Derecho empresarial) X le otorga a Y un patrimonio vitalicio. Pos.pdf(Derecho empresarial) X le otorga a Y un patrimonio vitalicio. Pos.pdf
(Derecho empresarial) X le otorga a Y un patrimonio vitalicio. Pos.pdfalstradecentreerode
 
(d) Give a single line of R code that will produce a plot exactly li.pdf
(d) Give a single line of R code that will produce a plot exactly li.pdf(d) Give a single line of R code that will produce a plot exactly li.pdf
(d) Give a single line of R code that will produce a plot exactly li.pdfalstradecentreerode
 
(5 points) There are seven boys and six girls. Coach wants to select.pdf
(5 points) There are seven boys and six girls. Coach wants to select.pdf(5 points) There are seven boys and six girls. Coach wants to select.pdf
(5 points) There are seven boys and six girls. Coach wants to select.pdfalstradecentreerode
 
(1)1�(1+.10000000000000000000000(100))�2(126127) The single precision .pdf
(1)1�(1+.10000000000000000000000(100))�2(126127) The single precision .pdf(1)1�(1+.10000000000000000000000(100))�2(126127) The single precision .pdf
(1)1�(1+.10000000000000000000000(100))�2(126127) The single precision .pdfalstradecentreerode
 
(1)CT13.1) Your parents are considering investing in Apple Inc. co.pdf
(1)CT13.1) Your parents are considering investing in Apple Inc. co.pdf(1)CT13.1) Your parents are considering investing in Apple Inc. co.pdf
(1)CT13.1) Your parents are considering investing in Apple Inc. co.pdfalstradecentreerode
 
(10 points) Construct a BST by inserting the following keys into an .pdf
(10 points) Construct a BST by inserting the following keys into an .pdf(10 points) Construct a BST by inserting the following keys into an .pdf
(10 points) Construct a BST by inserting the following keys into an .pdfalstradecentreerode
 
#2 Listed below are the numbers of triplets born in a country each y.pdf
#2 Listed below are the numbers of triplets born in a country each y.pdf#2 Listed below are the numbers of triplets born in a country each y.pdf
#2 Listed below are the numbers of triplets born in a country each y.pdfalstradecentreerode
 
#52 In a large American university in 1969, the male and female pro.pdf
#52 In a large American university in 1969, the male and female pro.pdf#52 In a large American university in 1969, the male and female pro.pdf
#52 In a large American university in 1969, the male and female pro.pdfalstradecentreerode
 
#define LOGFILE signal_log.txt Signal handlers void sigusr1.pdf
#define LOGFILE signal_log.txt  Signal handlers void sigusr1.pdf#define LOGFILE signal_log.txt  Signal handlers void sigusr1.pdf
#define LOGFILE signal_log.txt Signal handlers void sigusr1.pdfalstradecentreerode
 
�Los Premios Darwin honran adecuadamente sus ideas sobre la selecci.pdf
 �Los Premios Darwin honran adecuadamente sus ideas sobre la selecci.pdf �Los Premios Darwin honran adecuadamente sus ideas sobre la selecci.pdf
�Los Premios Darwin honran adecuadamente sus ideas sobre la selecci.pdfalstradecentreerode
 
�derine NTHikEaDs 10 itatic thresd-t thread void nolint all cosit os .pdf
 �derine NTHikEaDs 10 itatic thresd-t thread void nolint all cosit os .pdf �derine NTHikEaDs 10 itatic thresd-t thread void nolint all cosit os .pdf
�derine NTHikEaDs 10 itatic thresd-t thread void nolint all cosit os .pdfalstradecentreerode
 
�Es el az�car bueno... malo... ninguno... ambos Dime por qu�. �Cu�.pdf
 �Es el az�car bueno... malo... ninguno... ambos Dime por qu�. �Cu�.pdf �Es el az�car bueno... malo... ninguno... ambos Dime por qu�. �Cu�.pdf
�Es el az�car bueno... malo... ninguno... ambos Dime por qu�. �Cu�.pdfalstradecentreerode
 
�Cu�les de los siguientes son ejemplos de intervenciones de educa.pdf
 �Cu�les de los siguientes son ejemplos de intervenciones de educa.pdf �Cu�les de los siguientes son ejemplos de intervenciones de educa.pdf
�Cu�les de los siguientes son ejemplos de intervenciones de educa.pdfalstradecentreerode
 
�Cu�l de los siguientes se considera un indicador principal de la e.pdf
 �Cu�l de los siguientes se considera un indicador principal de la e.pdf �Cu�l de los siguientes se considera un indicador principal de la e.pdf
�Cu�l de los siguientes se considera un indicador principal de la e.pdfalstradecentreerode
 

More from alstradecentreerode (20)

(Rational Class) - use the original files to create the new progra.pdf
(Rational Class) - use the original files to create the new progra.pdf(Rational Class) - use the original files to create the new progra.pdf
(Rational Class) - use the original files to create the new progra.pdf
 
(Q001) Expand the Geotour10 folder in Google Earth by clicking the t.pdf
(Q001) Expand the Geotour10 folder in Google Earth by clicking the t.pdf(Q001) Expand the Geotour10 folder in Google Earth by clicking the t.pdf
(Q001) Expand the Geotour10 folder in Google Earth by clicking the t.pdf
 
(if any) is your opportunity cost.pdf
(if any) is your opportunity cost.pdf(if any) is your opportunity cost.pdf
(if any) is your opportunity cost.pdf
 
(Forecasting and forecast error metrics calculation) Suzy Homemaker .pdf
(Forecasting and forecast error metrics calculation) Suzy Homemaker .pdf(Forecasting and forecast error metrics calculation) Suzy Homemaker .pdf
(Forecasting and forecast error metrics calculation) Suzy Homemaker .pdf
 
(Elementary Statistics) Computer=1100(102r+1).pdf
(Elementary Statistics) Computer=1100(102r+1).pdf(Elementary Statistics) Computer=1100(102r+1).pdf
(Elementary Statistics) Computer=1100(102r+1).pdf
 
(Derecho empresarial) X le otorga a Y un patrimonio vitalicio. Pos.pdf
(Derecho empresarial) X le otorga a Y un patrimonio vitalicio. Pos.pdf(Derecho empresarial) X le otorga a Y un patrimonio vitalicio. Pos.pdf
(Derecho empresarial) X le otorga a Y un patrimonio vitalicio. Pos.pdf
 
(d) Give a single line of R code that will produce a plot exactly li.pdf
(d) Give a single line of R code that will produce a plot exactly li.pdf(d) Give a single line of R code that will produce a plot exactly li.pdf
(d) Give a single line of R code that will produce a plot exactly li.pdf
 
(5 points) There are seven boys and six girls. Coach wants to select.pdf
(5 points) There are seven boys and six girls. Coach wants to select.pdf(5 points) There are seven boys and six girls. Coach wants to select.pdf
(5 points) There are seven boys and six girls. Coach wants to select.pdf
 
(2ab)5.pdf
(2ab)5.pdf(2ab)5.pdf
(2ab)5.pdf
 
(1)1�(1+.10000000000000000000000(100))�2(126127) The single precision .pdf
(1)1�(1+.10000000000000000000000(100))�2(126127) The single precision .pdf(1)1�(1+.10000000000000000000000(100))�2(126127) The single precision .pdf
(1)1�(1+.10000000000000000000000(100))�2(126127) The single precision .pdf
 
(1)CT13.1) Your parents are considering investing in Apple Inc. co.pdf
(1)CT13.1) Your parents are considering investing in Apple Inc. co.pdf(1)CT13.1) Your parents are considering investing in Apple Inc. co.pdf
(1)CT13.1) Your parents are considering investing in Apple Inc. co.pdf
 
(10 points) Construct a BST by inserting the following keys into an .pdf
(10 points) Construct a BST by inserting the following keys into an .pdf(10 points) Construct a BST by inserting the following keys into an .pdf
(10 points) Construct a BST by inserting the following keys into an .pdf
 
#2 Listed below are the numbers of triplets born in a country each y.pdf
#2 Listed below are the numbers of triplets born in a country each y.pdf#2 Listed below are the numbers of triplets born in a country each y.pdf
#2 Listed below are the numbers of triplets born in a country each y.pdf
 
#52 In a large American university in 1969, the male and female pro.pdf
#52 In a large American university in 1969, the male and female pro.pdf#52 In a large American university in 1969, the male and female pro.pdf
#52 In a large American university in 1969, the male and female pro.pdf
 
#define LOGFILE signal_log.txt Signal handlers void sigusr1.pdf
#define LOGFILE signal_log.txt  Signal handlers void sigusr1.pdf#define LOGFILE signal_log.txt  Signal handlers void sigusr1.pdf
#define LOGFILE signal_log.txt Signal handlers void sigusr1.pdf
 
�Los Premios Darwin honran adecuadamente sus ideas sobre la selecci.pdf
 �Los Premios Darwin honran adecuadamente sus ideas sobre la selecci.pdf �Los Premios Darwin honran adecuadamente sus ideas sobre la selecci.pdf
�Los Premios Darwin honran adecuadamente sus ideas sobre la selecci.pdf
 
�derine NTHikEaDs 10 itatic thresd-t thread void nolint all cosit os .pdf
 �derine NTHikEaDs 10 itatic thresd-t thread void nolint all cosit os .pdf �derine NTHikEaDs 10 itatic thresd-t thread void nolint all cosit os .pdf
�derine NTHikEaDs 10 itatic thresd-t thread void nolint all cosit os .pdf
 
�Es el az�car bueno... malo... ninguno... ambos Dime por qu�. �Cu�.pdf
 �Es el az�car bueno... malo... ninguno... ambos Dime por qu�. �Cu�.pdf �Es el az�car bueno... malo... ninguno... ambos Dime por qu�. �Cu�.pdf
�Es el az�car bueno... malo... ninguno... ambos Dime por qu�. �Cu�.pdf
 
�Cu�les de los siguientes son ejemplos de intervenciones de educa.pdf
 �Cu�les de los siguientes son ejemplos de intervenciones de educa.pdf �Cu�les de los siguientes son ejemplos de intervenciones de educa.pdf
�Cu�les de los siguientes son ejemplos de intervenciones de educa.pdf
 
�Cu�l de los siguientes se considera un indicador principal de la e.pdf
 �Cu�l de los siguientes se considera un indicador principal de la e.pdf �Cu�l de los siguientes se considera un indicador principal de la e.pdf
�Cu�l de los siguientes se considera un indicador principal de la e.pdf
 

Recently uploaded

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 

Recently uploaded (20)

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 

#include iostream #include vector #include string using namesp.pdf

  • 1. #include #include #include using namespace std; class Point { public: Point(int x, int y) : m_x(x), m_y(y) {} int getX() const { return m_x; } int getY() const { return m_y; } private: int m_x, m_y; }; class Shape { public: Shape(const string& name, const Point& p) : m_name(name), m_point(p) {} virtual ~Shape() {} virtual void draw() const = 0; virtual void print() const { cout << "Shape: " << m_name << " (" << m_point.getX() << "," << m_point.getY() << ")" << endl; } private: string m_name; Point m_point; }; class OneD : public Shape { public: OneD(const string& name, const Point& p1, const Point& p2) : Shape(name, p1), m_p2(p2) {} void draw() const override {} void print() const override { Shape::print(); cout << " Point2: (" << m_p2.getX() << "," << m_p2.getY() << ")" << endl; } private: Point m_p2; }; class TwoD : public Shape { public: TwoD(const string& name, const Point& p) : Shape(name, p) {} void draw() const override {} }; class ThreeD : public Shape { public: ThreeD(const string& name, const Point& p) : Shape(name, p) {} void draw() const override {} }; class Line : public OneD { public: Line(const string& name, const Point& p1, const Point& p2) : OneD(name, p1, p2) {} void draw() const override {} }; class Curve : public OneD { public: Curve(const string& name, const Point& p1, const Point& p2, const Point& p3) : OneD(name, p1, p2), m_p3(p3) {} void draw() const override {} void print() const override { OneD::print(); cout << " Point3: (" << m_p3.getX() << "," << m_p3.getY() << ")" << endl; } private: Point m_p3; }; class Circle : public TwoD { public: Circle(const string& name, const Point& p, double radius) : TwoD(name, p), m_radius(radius) {} void draw() const override {} void print() const override { TwoD::print(); cout << " Radius: " << m_radius << endl; } private: double m_radius; }; class Rectangle : public TwoD { public: Rectangle(const string& name, const Point& p1, const Point& p2) : TwoD(name, p1), m_p2(p2) {} void draw() const override {} void print() const override { TwoD::print(); cout << " Point2: (" << m_p2.getX() << "," << m_p2.getY() << ")" << endl; } private: Point m_p2; }; class Sphere : public ThreeD { public: Sphere(const string& name, const Point& p, double radius) : ThreeD(name, p), m_radius(radius) {} void draw() const override {} void print() const override { ThreeD::print(); cout << " Radius: " << m_radius << endl; } private Errors I am getting. Please fix.