SlideShare a Scribd company logo
1 of 3
Download to read offline
) Code the following class. Hopefully the method names clearly imply the specific purpose of
each. Note that – indicates private and + is public
(Rectangle)
- xCoordinate : int
- yCoordinate : int
- height:int
- width:int
- color:string
+ Rectangle(x:int,y:int,h:int,w:int)
+ setHeight(h:int): void
+ setWidth(w:int): void
+ setColor(c:string): void
+ setXCoordinate(new X:int): void
+ setYCoordinate(new Y:int): void
+getHeight():int
+getWidth():int
+getColor():string
+getXCoordinate():int
+getYCoordinate():int
.
(Rectangle)
- xCoordinate : int
- yCoordinate : int
- height:int
- width:int
- color:string
+ Rectangle(x:int,y:int,h:int,w:int)
+ setHeight(h:int): void
+ setWidth(w:int): void
+ setColor(c:string): void
+ setXCoordinate(new X:int): void
+ setYCoordinate(new Y:int): void
+getHeight():int
+getWidth():int
+getColor():string
+getXCoordinate():int
+getYCoordinate():int
Solution
Rectangle.cpp
#include
using namespace std;
class Rectangle{
private:
int xCoordinate;
int yCoordinate;
int height;
int width;
string color;
public:
Rectangle(int x,int y,int h,int w){
height =h;
width = w;
xCoordinate = x;
yCoordinate = y;
}
void setHeight(int h){
height = h;
}
void setWidth(int w){
width = w;
}
void setColor(string c){
color = c;
}
void setXCoordinate(int X){
xCoordinate = X;
}
void setYCoordinate(int Y){
yCoordinate = Y;
}
int getHeight(){
return height;
}
int getWidth(){
return width;
}
string getColor(){
return color;
}
int getXCoordinate(){
return xCoordinate;
}
int getYCoordinate(){
return yCoordinate;
}
};
int main()
{
return 0;
}

More Related Content

Similar to ) Code the following class. Hopefully the method names clearly imply.pdf

4.5 tan and cot.ppt worked
4.5   tan and cot.ppt worked4.5   tan and cot.ppt worked
4.5 tan and cot.ppt workedJonna Ramsey
 
Introduction to Treewidth
Introduction to TreewidthIntroduction to Treewidth
Introduction to TreewidthASPAK2014
 
An Introduction to Coding Theory
An Introduction to Coding TheoryAn Introduction to Coding Theory
An Introduction to Coding TheoryAlexanderWei11
 
Make two classes called Points and Lines- Class points should have the.docx
Make two classes called Points and Lines- Class points should have the.docxMake two classes called Points and Lines- Class points should have the.docx
Make two classes called Points and Lines- Class points should have the.docxsngyun4t79
 
Explanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expertExplanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expert홍배 김
 
Basics of Computer graphics lab
Basics of Computer graphics labBasics of Computer graphics lab
Basics of Computer graphics labPriya Goyal
 
Lectures r-graphics
Lectures r-graphicsLectures r-graphics
Lectures r-graphicsetyca
 
Please use the following UML diagram and main.cpp to complete the c.pdf
Please use the following UML diagram and main.cpp to complete the c.pdfPlease use the following UML diagram and main.cpp to complete the c.pdf
Please use the following UML diagram and main.cpp to complete the c.pdfmohammedfootwear
 
RSA SIGNATURE: BEHIND THE SCENES
RSA SIGNATURE: BEHIND THE SCENESRSA SIGNATURE: BEHIND THE SCENES
RSA SIGNATURE: BEHIND THE SCENESacijjournal
 
Coding theory.pdf
Coding theory.pdfCoding theory.pdf
Coding theory.pdf230231060
 
ImplementDijkstra’s algorithm using the graph class you implemente.pdf
ImplementDijkstra’s algorithm using the graph class you implemente.pdfImplementDijkstra’s algorithm using the graph class you implemente.pdf
ImplementDijkstra’s algorithm using the graph class you implemente.pdfgopalk44
 
HTML5 Canvas - Basics.pptx
HTML5 Canvas - Basics.pptxHTML5 Canvas - Basics.pptx
HTML5 Canvas - Basics.pptxAhmadAbba6
 
2024.03.22 - Mike Heddes - Introduction to Hyperdimensional Computing.pdf
2024.03.22 - Mike Heddes - Introduction to Hyperdimensional Computing.pdf2024.03.22 - Mike Heddes - Introduction to Hyperdimensional Computing.pdf
2024.03.22 - Mike Heddes - Introduction to Hyperdimensional Computing.pdfAdvanced-Concepts-Team
 
1- Create a class called Point that has two instance variables, defi.pdf
1- Create a class called Point that has two instance variables, defi.pdf1- Create a class called Point that has two instance variables, defi.pdf
1- Create a class called Point that has two instance variables, defi.pdfjeeteshmalani1
 
(2015 06-16) Three Approaches to Monads
(2015 06-16) Three Approaches to Monads(2015 06-16) Three Approaches to Monads
(2015 06-16) Three Approaches to MonadsLawrence Evans
 
Linear block coding
Linear block codingLinear block coding
Linear block codingjknm
 

Similar to ) Code the following class. Hopefully the method names clearly imply.pdf (20)

Midterm sols
Midterm solsMidterm sols
Midterm sols
 
4.5 tan and cot.ppt worked
4.5   tan and cot.ppt worked4.5   tan and cot.ppt worked
4.5 tan and cot.ppt worked
 
Introduction to Treewidth
Introduction to TreewidthIntroduction to Treewidth
Introduction to Treewidth
 
Quadraticapplications.ppt
Quadraticapplications.pptQuadraticapplications.ppt
Quadraticapplications.ppt
 
An Introduction to Coding Theory
An Introduction to Coding TheoryAn Introduction to Coding Theory
An Introduction to Coding Theory
 
Matlab plotting
Matlab plottingMatlab plotting
Matlab plotting
 
Make two classes called Points and Lines- Class points should have the.docx
Make two classes called Points and Lines- Class points should have the.docxMake two classes called Points and Lines- Class points should have the.docx
Make two classes called Points and Lines- Class points should have the.docx
 
Explanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expertExplanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expert
 
Basics of Computer graphics lab
Basics of Computer graphics labBasics of Computer graphics lab
Basics of Computer graphics lab
 
Lectures r-graphics
Lectures r-graphicsLectures r-graphics
Lectures r-graphics
 
Please use the following UML diagram and main.cpp to complete the c.pdf
Please use the following UML diagram and main.cpp to complete the c.pdfPlease use the following UML diagram and main.cpp to complete the c.pdf
Please use the following UML diagram and main.cpp to complete the c.pdf
 
RSA SIGNATURE: BEHIND THE SCENES
RSA SIGNATURE: BEHIND THE SCENESRSA SIGNATURE: BEHIND THE SCENES
RSA SIGNATURE: BEHIND THE SCENES
 
Programming with matlab session 6
Programming with matlab session 6Programming with matlab session 6
Programming with matlab session 6
 
Coding theory.pdf
Coding theory.pdfCoding theory.pdf
Coding theory.pdf
 
ImplementDijkstra’s algorithm using the graph class you implemente.pdf
ImplementDijkstra’s algorithm using the graph class you implemente.pdfImplementDijkstra’s algorithm using the graph class you implemente.pdf
ImplementDijkstra’s algorithm using the graph class you implemente.pdf
 
HTML5 Canvas - Basics.pptx
HTML5 Canvas - Basics.pptxHTML5 Canvas - Basics.pptx
HTML5 Canvas - Basics.pptx
 
2024.03.22 - Mike Heddes - Introduction to Hyperdimensional Computing.pdf
2024.03.22 - Mike Heddes - Introduction to Hyperdimensional Computing.pdf2024.03.22 - Mike Heddes - Introduction to Hyperdimensional Computing.pdf
2024.03.22 - Mike Heddes - Introduction to Hyperdimensional Computing.pdf
 
1- Create a class called Point that has two instance variables, defi.pdf
1- Create a class called Point that has two instance variables, defi.pdf1- Create a class called Point that has two instance variables, defi.pdf
1- Create a class called Point that has two instance variables, defi.pdf
 
(2015 06-16) Three Approaches to Monads
(2015 06-16) Three Approaches to Monads(2015 06-16) Three Approaches to Monads
(2015 06-16) Three Approaches to Monads
 
Linear block coding
Linear block codingLinear block coding
Linear block coding
 

More from arsmobiles

For each NADH that supplies electrons to the electron transport syst.pdf
For each NADH that supplies electrons to the electron transport syst.pdfFor each NADH that supplies electrons to the electron transport syst.pdf
For each NADH that supplies electrons to the electron transport syst.pdfarsmobiles
 
Biology II . Please answer all of these questions only if you are su.pdf
Biology II . Please answer all of these questions only if you are su.pdfBiology II . Please answer all of these questions only if you are su.pdf
Biology II . Please answer all of these questions only if you are su.pdfarsmobiles
 
During spermatogenesis in the seminiferous tubules, the position of .pdf
During spermatogenesis in the seminiferous tubules, the position of .pdfDuring spermatogenesis in the seminiferous tubules, the position of .pdf
During spermatogenesis in the seminiferous tubules, the position of .pdfarsmobiles
 
A model of a system is best characterized by the following statement.pdf
A model of a system is best characterized by the following statement.pdfA model of a system is best characterized by the following statement.pdf
A model of a system is best characterized by the following statement.pdfarsmobiles
 
4- what is the link between asset diversification and the liquidit.pdf
4- what is the link between asset diversification and the liquidit.pdf4- what is the link between asset diversification and the liquidit.pdf
4- what is the link between asset diversification and the liquidit.pdfarsmobiles
 
A book by Nozick. The experience machine. “what does matter to us in.pdf
A book by Nozick. The experience machine. “what does matter to us in.pdfA book by Nozick. The experience machine. “what does matter to us in.pdf
A book by Nozick. The experience machine. “what does matter to us in.pdfarsmobiles
 
any one has knowladge in C unix opreating system .. please help Desc.pdf
any one has knowladge in C unix opreating system .. please help Desc.pdfany one has knowladge in C unix opreating system .. please help Desc.pdf
any one has knowladge in C unix opreating system .. please help Desc.pdfarsmobiles
 
A common symptom of pharyngitis is swelling of the. interior cervical.pdf
A common symptom of pharyngitis is swelling of the. interior cervical.pdfA common symptom of pharyngitis is swelling of the. interior cervical.pdf
A common symptom of pharyngitis is swelling of the. interior cervical.pdfarsmobiles
 
Define nonconcordant variation Why does nonconcordant variation mak.pdf
Define nonconcordant variation Why does nonconcordant variation mak.pdfDefine nonconcordant variation Why does nonconcordant variation mak.pdf
Define nonconcordant variation Why does nonconcordant variation mak.pdfarsmobiles
 
Describe the operation of a tubular bowl centrifugeSolutionTub.pdf
Describe the operation of a tubular bowl centrifugeSolutionTub.pdfDescribe the operation of a tubular bowl centrifugeSolutionTub.pdf
Describe the operation of a tubular bowl centrifugeSolutionTub.pdfarsmobiles
 
Could you help me with this question Thanks so much!Let T be an e.pdf
Could you help me with this question Thanks so much!Let T be an e.pdfCould you help me with this question Thanks so much!Let T be an e.pdf
Could you help me with this question Thanks so much!Let T be an e.pdfarsmobiles
 
Briefly discuss Philippa Foot’s contributions to virtue theory.S.pdf
Briefly discuss Philippa Foot’s contributions to virtue theory.S.pdfBriefly discuss Philippa Foot’s contributions to virtue theory.S.pdf
Briefly discuss Philippa Foot’s contributions to virtue theory.S.pdfarsmobiles
 
List for a company you either work or are familiar with, the interna.pdf
List for a company you either work or are familiar with, the interna.pdfList for a company you either work or are familiar with, the interna.pdf
List for a company you either work or are familiar with, the interna.pdfarsmobiles
 
Write a C program that uses a recursive function to print a triangle .pdf
Write a C program that uses a recursive function to print a triangle .pdfWrite a C program that uses a recursive function to print a triangle .pdf
Write a C program that uses a recursive function to print a triangle .pdfarsmobiles
 
Which avenue of research is least likely to reveal whether asexual or.pdf
Which avenue of research is least likely to reveal whether asexual or.pdfWhich avenue of research is least likely to reveal whether asexual or.pdf
Which avenue of research is least likely to reveal whether asexual or.pdfarsmobiles
 
When testing the difference between two population means, the varian.pdf
When testing the difference between two population means, the varian.pdfWhen testing the difference between two population means, the varian.pdf
When testing the difference between two population means, the varian.pdfarsmobiles
 
IT Project Management1. Please compare and contrast a traditional .pdf
IT Project Management1. Please compare and contrast a traditional .pdfIT Project Management1. Please compare and contrast a traditional .pdf
IT Project Management1. Please compare and contrast a traditional .pdfarsmobiles
 
Whats the relationship between DNA and RNA Whats the relat.pdf
Whats the relationship between DNA and RNA Whats the relat.pdfWhats the relationship between DNA and RNA Whats the relat.pdf
Whats the relationship between DNA and RNA Whats the relat.pdfarsmobiles
 
What does it mean to destroy something at the molecular level in ter.pdf
What does it mean to destroy something at the molecular level in ter.pdfWhat does it mean to destroy something at the molecular level in ter.pdf
What does it mean to destroy something at the molecular level in ter.pdfarsmobiles
 
What is a rain shadow, and why does it happenSolutionThe warm.pdf
What is a rain shadow, and why does it happenSolutionThe warm.pdfWhat is a rain shadow, and why does it happenSolutionThe warm.pdf
What is a rain shadow, and why does it happenSolutionThe warm.pdfarsmobiles
 

More from arsmobiles (20)

For each NADH that supplies electrons to the electron transport syst.pdf
For each NADH that supplies electrons to the electron transport syst.pdfFor each NADH that supplies electrons to the electron transport syst.pdf
For each NADH that supplies electrons to the electron transport syst.pdf
 
Biology II . Please answer all of these questions only if you are su.pdf
Biology II . Please answer all of these questions only if you are su.pdfBiology II . Please answer all of these questions only if you are su.pdf
Biology II . Please answer all of these questions only if you are su.pdf
 
During spermatogenesis in the seminiferous tubules, the position of .pdf
During spermatogenesis in the seminiferous tubules, the position of .pdfDuring spermatogenesis in the seminiferous tubules, the position of .pdf
During spermatogenesis in the seminiferous tubules, the position of .pdf
 
A model of a system is best characterized by the following statement.pdf
A model of a system is best characterized by the following statement.pdfA model of a system is best characterized by the following statement.pdf
A model of a system is best characterized by the following statement.pdf
 
4- what is the link between asset diversification and the liquidit.pdf
4- what is the link between asset diversification and the liquidit.pdf4- what is the link between asset diversification and the liquidit.pdf
4- what is the link between asset diversification and the liquidit.pdf
 
A book by Nozick. The experience machine. “what does matter to us in.pdf
A book by Nozick. The experience machine. “what does matter to us in.pdfA book by Nozick. The experience machine. “what does matter to us in.pdf
A book by Nozick. The experience machine. “what does matter to us in.pdf
 
any one has knowladge in C unix opreating system .. please help Desc.pdf
any one has knowladge in C unix opreating system .. please help Desc.pdfany one has knowladge in C unix opreating system .. please help Desc.pdf
any one has knowladge in C unix opreating system .. please help Desc.pdf
 
A common symptom of pharyngitis is swelling of the. interior cervical.pdf
A common symptom of pharyngitis is swelling of the. interior cervical.pdfA common symptom of pharyngitis is swelling of the. interior cervical.pdf
A common symptom of pharyngitis is swelling of the. interior cervical.pdf
 
Define nonconcordant variation Why does nonconcordant variation mak.pdf
Define nonconcordant variation Why does nonconcordant variation mak.pdfDefine nonconcordant variation Why does nonconcordant variation mak.pdf
Define nonconcordant variation Why does nonconcordant variation mak.pdf
 
Describe the operation of a tubular bowl centrifugeSolutionTub.pdf
Describe the operation of a tubular bowl centrifugeSolutionTub.pdfDescribe the operation of a tubular bowl centrifugeSolutionTub.pdf
Describe the operation of a tubular bowl centrifugeSolutionTub.pdf
 
Could you help me with this question Thanks so much!Let T be an e.pdf
Could you help me with this question Thanks so much!Let T be an e.pdfCould you help me with this question Thanks so much!Let T be an e.pdf
Could you help me with this question Thanks so much!Let T be an e.pdf
 
Briefly discuss Philippa Foot’s contributions to virtue theory.S.pdf
Briefly discuss Philippa Foot’s contributions to virtue theory.S.pdfBriefly discuss Philippa Foot’s contributions to virtue theory.S.pdf
Briefly discuss Philippa Foot’s contributions to virtue theory.S.pdf
 
List for a company you either work or are familiar with, the interna.pdf
List for a company you either work or are familiar with, the interna.pdfList for a company you either work or are familiar with, the interna.pdf
List for a company you either work or are familiar with, the interna.pdf
 
Write a C program that uses a recursive function to print a triangle .pdf
Write a C program that uses a recursive function to print a triangle .pdfWrite a C program that uses a recursive function to print a triangle .pdf
Write a C program that uses a recursive function to print a triangle .pdf
 
Which avenue of research is least likely to reveal whether asexual or.pdf
Which avenue of research is least likely to reveal whether asexual or.pdfWhich avenue of research is least likely to reveal whether asexual or.pdf
Which avenue of research is least likely to reveal whether asexual or.pdf
 
When testing the difference between two population means, the varian.pdf
When testing the difference between two population means, the varian.pdfWhen testing the difference between two population means, the varian.pdf
When testing the difference between two population means, the varian.pdf
 
IT Project Management1. Please compare and contrast a traditional .pdf
IT Project Management1. Please compare and contrast a traditional .pdfIT Project Management1. Please compare and contrast a traditional .pdf
IT Project Management1. Please compare and contrast a traditional .pdf
 
Whats the relationship between DNA and RNA Whats the relat.pdf
Whats the relationship between DNA and RNA Whats the relat.pdfWhats the relationship between DNA and RNA Whats the relat.pdf
Whats the relationship between DNA and RNA Whats the relat.pdf
 
What does it mean to destroy something at the molecular level in ter.pdf
What does it mean to destroy something at the molecular level in ter.pdfWhat does it mean to destroy something at the molecular level in ter.pdf
What does it mean to destroy something at the molecular level in ter.pdf
 
What is a rain shadow, and why does it happenSolutionThe warm.pdf
What is a rain shadow, and why does it happenSolutionThe warm.pdfWhat is a rain shadow, and why does it happenSolutionThe warm.pdf
What is a rain shadow, and why does it happenSolutionThe warm.pdf
 

Recently uploaded

Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSean M. Fox
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...EduSkills OECD
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppCeline George
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxAdelaideRefugio
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptxPoojaSen20
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17Celine George
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFVivekanand Anglo Vedic Academy
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxneillewis46
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024Borja Sotomayor
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesPooky Knightsmith
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project researchCaitlinCummins3
 

Recently uploaded (20)

Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 

) Code the following class. Hopefully the method names clearly imply.pdf

  • 1. ) Code the following class. Hopefully the method names clearly imply the specific purpose of each. Note that – indicates private and + is public (Rectangle) - xCoordinate : int - yCoordinate : int - height:int - width:int - color:string + Rectangle(x:int,y:int,h:int,w:int) + setHeight(h:int): void + setWidth(w:int): void + setColor(c:string): void + setXCoordinate(new X:int): void + setYCoordinate(new Y:int): void +getHeight():int +getWidth():int +getColor():string +getXCoordinate():int +getYCoordinate():int . (Rectangle) - xCoordinate : int - yCoordinate : int - height:int - width:int - color:string + Rectangle(x:int,y:int,h:int,w:int) + setHeight(h:int): void + setWidth(w:int): void + setColor(c:string): void + setXCoordinate(new X:int): void + setYCoordinate(new Y:int): void +getHeight():int +getWidth():int +getColor():string
  • 2. +getXCoordinate():int +getYCoordinate():int Solution Rectangle.cpp #include using namespace std; class Rectangle{ private: int xCoordinate; int yCoordinate; int height; int width; string color; public: Rectangle(int x,int y,int h,int w){ height =h; width = w; xCoordinate = x; yCoordinate = y; } void setHeight(int h){ height = h; } void setWidth(int w){ width = w; } void setColor(string c){ color = c; } void setXCoordinate(int X){ xCoordinate = X; } void setYCoordinate(int Y){ yCoordinate = Y;
  • 3. } int getHeight(){ return height; } int getWidth(){ return width; } string getColor(){ return color; } int getXCoordinate(){ return xCoordinate; } int getYCoordinate(){ return yCoordinate; } }; int main() { return 0; }