SlideShare a Scribd company logo
(B) Add a class named Square.java
Give it private attributes double side and String color
Make a constructor with two attributes for assigning a value to side and color when the Square is
instantiated.
Add getter and setter methods for all of the attributes.
Add a method that returns the area of the shape.
(C) Make the Rectangle.java class.
Also,
Add a color attribute and make it private.
Make a constructor with three attributes for assigning a value to width, height, and color when
the Rectangle is instantiated.
Add getter and setter methods for all of the attributes.
Add a method that returns the area of the shape.

More Related Content

More from Phile3CGreeneg

Database Access with JDBC When a result set is created- its record poi.pdf
Database Access with JDBC When a result set is created- its record poi.pdfDatabase Access with JDBC When a result set is created- its record poi.pdf
Database Access with JDBC When a result set is created- its record poi.pdf
Phile3CGreeneg
 
Data visualization makes data easier to understand and reveals pattern.pdf
Data visualization makes data easier to understand and reveals pattern.pdfData visualization makes data easier to understand and reveals pattern.pdf
Data visualization makes data easier to understand and reveals pattern.pdf
Phile3CGreeneg
 
Data that are usually continuous measurements are called-A- Attributes (1).pdf
Data that are usually continuous measurements are called-A- Attributes (1).pdfData that are usually continuous measurements are called-A- Attributes (1).pdf
Data that are usually continuous measurements are called-A- Attributes (1).pdf
Phile3CGreeneg
 
Data Structures Explain all the double linked list coding processes at.pdf
Data Structures Explain all the double linked list coding processes at.pdfData Structures Explain all the double linked list coding processes at.pdf
Data Structures Explain all the double linked list coding processes at.pdf
Phile3CGreeneg
 
Current Attempt in Progress The trial balance columns of the worksheet.pdf
Current Attempt in Progress The trial balance columns of the worksheet.pdfCurrent Attempt in Progress The trial balance columns of the worksheet.pdf
Current Attempt in Progress The trial balance columns of the worksheet.pdf
Phile3CGreeneg
 
Data Handing Worksheet I Exercise- Gene X is successfully cloned into (1).pdf
Data Handing Worksheet I Exercise- Gene X is successfully cloned into (1).pdfData Handing Worksheet I Exercise- Gene X is successfully cloned into (1).pdf
Data Handing Worksheet I Exercise- Gene X is successfully cloned into (1).pdf
Phile3CGreeneg
 
Data are important for making decisions and developing your plan- Sea.pdf
Data are important for making decisions and developing your plan-  Sea.pdfData are important for making decisions and developing your plan-  Sea.pdf
Data are important for making decisions and developing your plan- Sea.pdf
Phile3CGreeneg
 
Data For (G+) Bands.pdf
Data For (G+) Bands.pdfData For (G+) Bands.pdf
Data For (G+) Bands.pdf
Phile3CGreeneg
 
Data has to meet certain conditions-constraints-requirements in order.pdf
Data has to meet certain conditions-constraints-requirements in order.pdfData has to meet certain conditions-constraints-requirements in order.pdf
Data has to meet certain conditions-constraints-requirements in order.pdf
Phile3CGreeneg
 
Data refers to a- information that have a particular meaning within a.pdf
Data refers to a- information that have a particular meaning within a.pdfData refers to a- information that have a particular meaning within a.pdf
Data refers to a- information that have a particular meaning within a.pdf
Phile3CGreeneg
 
Data Cleaning and Manipulation (10 points) There are five errors in th.pdf
Data Cleaning and Manipulation (10 points) There are five errors in th.pdfData Cleaning and Manipulation (10 points) There are five errors in th.pdf
Data Cleaning and Manipulation (10 points) There are five errors in th.pdf
Phile3CGreeneg
 
Data concerring Bocivell Einterprises Corporation's singte product app.pdf
Data concerring Bocivell Einterprises Corporation's singte product app.pdfData concerring Bocivell Einterprises Corporation's singte product app.pdf
Data concerring Bocivell Einterprises Corporation's singte product app.pdf
Phile3CGreeneg
 
Darin and Brandy McMaster- a married couple who will file jointly- are.pdf
Darin and Brandy McMaster- a married couple who will file jointly- are.pdfDarin and Brandy McMaster- a married couple who will file jointly- are.pdf
Darin and Brandy McMaster- a married couple who will file jointly- are.pdf
Phile3CGreeneg
 
Dada la siguiente lista de cuentas- calcule los activos totales- Cuent.pdf
Dada la siguiente lista de cuentas- calcule los activos totales- Cuent.pdfDada la siguiente lista de cuentas- calcule los activos totales- Cuent.pdf
Dada la siguiente lista de cuentas- calcule los activos totales- Cuent.pdf
Phile3CGreeneg
 
D-inatiod stadiaysy mnne vilute Fodrined itmene funstion Question 10 1.pdf
D-inatiod stadiaysy mnne vilute Fodrined itmene funstion Question 10 1.pdfD-inatiod stadiaysy mnne vilute Fodrined itmene funstion Question 10 1.pdf
D-inatiod stadiaysy mnne vilute Fodrined itmene funstion Question 10 1.pdf
Phile3CGreeneg
 
d- What is the probability that Z is less than 1-51 or greater than 1-.pdf
d- What is the probability that Z is less than 1-51 or greater than 1-.pdfd- What is the probability that Z is less than 1-51 or greater than 1-.pdf
d- What is the probability that Z is less than 1-51 or greater than 1-.pdf
Phile3CGreeneg
 
D2D2.pdf
D2D2.pdfD2D2.pdf
D2D2.pdf
Phile3CGreeneg
 
D- E- Fs Match the number with the line in the figure with the structu.pdf
D- E- Fs Match the number with the line in the figure with the structu.pdfD- E- Fs Match the number with the line in the figure with the structu.pdf
D- E- Fs Match the number with the line in the figure with the structu.pdf
Phile3CGreeneg
 
D) frotes bave been very usefal in a- coding the DNA of erganisme grow.pdf
D) frotes bave been very usefal in a- coding the DNA of erganisme grow.pdfD) frotes bave been very usefal in a- coding the DNA of erganisme grow.pdf
D) frotes bave been very usefal in a- coding the DNA of erganisme grow.pdf
Phile3CGreeneg
 
d- As potassiuni concentration increase in the presence of valinomycin.pdf
d- As potassiuni concentration increase in the presence of valinomycin.pdfd- As potassiuni concentration increase in the presence of valinomycin.pdf
d- As potassiuni concentration increase in the presence of valinomycin.pdf
Phile3CGreeneg
 

More from Phile3CGreeneg (20)

Database Access with JDBC When a result set is created- its record poi.pdf
Database Access with JDBC When a result set is created- its record poi.pdfDatabase Access with JDBC When a result set is created- its record poi.pdf
Database Access with JDBC When a result set is created- its record poi.pdf
 
Data visualization makes data easier to understand and reveals pattern.pdf
Data visualization makes data easier to understand and reveals pattern.pdfData visualization makes data easier to understand and reveals pattern.pdf
Data visualization makes data easier to understand and reveals pattern.pdf
 
Data that are usually continuous measurements are called-A- Attributes (1).pdf
Data that are usually continuous measurements are called-A- Attributes (1).pdfData that are usually continuous measurements are called-A- Attributes (1).pdf
Data that are usually continuous measurements are called-A- Attributes (1).pdf
 
Data Structures Explain all the double linked list coding processes at.pdf
Data Structures Explain all the double linked list coding processes at.pdfData Structures Explain all the double linked list coding processes at.pdf
Data Structures Explain all the double linked list coding processes at.pdf
 
Current Attempt in Progress The trial balance columns of the worksheet.pdf
Current Attempt in Progress The trial balance columns of the worksheet.pdfCurrent Attempt in Progress The trial balance columns of the worksheet.pdf
Current Attempt in Progress The trial balance columns of the worksheet.pdf
 
Data Handing Worksheet I Exercise- Gene X is successfully cloned into (1).pdf
Data Handing Worksheet I Exercise- Gene X is successfully cloned into (1).pdfData Handing Worksheet I Exercise- Gene X is successfully cloned into (1).pdf
Data Handing Worksheet I Exercise- Gene X is successfully cloned into (1).pdf
 
Data are important for making decisions and developing your plan- Sea.pdf
Data are important for making decisions and developing your plan-  Sea.pdfData are important for making decisions and developing your plan-  Sea.pdf
Data are important for making decisions and developing your plan- Sea.pdf
 
Data For (G+) Bands.pdf
Data For (G+) Bands.pdfData For (G+) Bands.pdf
Data For (G+) Bands.pdf
 
Data has to meet certain conditions-constraints-requirements in order.pdf
Data has to meet certain conditions-constraints-requirements in order.pdfData has to meet certain conditions-constraints-requirements in order.pdf
Data has to meet certain conditions-constraints-requirements in order.pdf
 
Data refers to a- information that have a particular meaning within a.pdf
Data refers to a- information that have a particular meaning within a.pdfData refers to a- information that have a particular meaning within a.pdf
Data refers to a- information that have a particular meaning within a.pdf
 
Data Cleaning and Manipulation (10 points) There are five errors in th.pdf
Data Cleaning and Manipulation (10 points) There are five errors in th.pdfData Cleaning and Manipulation (10 points) There are five errors in th.pdf
Data Cleaning and Manipulation (10 points) There are five errors in th.pdf
 
Data concerring Bocivell Einterprises Corporation's singte product app.pdf
Data concerring Bocivell Einterprises Corporation's singte product app.pdfData concerring Bocivell Einterprises Corporation's singte product app.pdf
Data concerring Bocivell Einterprises Corporation's singte product app.pdf
 
Darin and Brandy McMaster- a married couple who will file jointly- are.pdf
Darin and Brandy McMaster- a married couple who will file jointly- are.pdfDarin and Brandy McMaster- a married couple who will file jointly- are.pdf
Darin and Brandy McMaster- a married couple who will file jointly- are.pdf
 
Dada la siguiente lista de cuentas- calcule los activos totales- Cuent.pdf
Dada la siguiente lista de cuentas- calcule los activos totales- Cuent.pdfDada la siguiente lista de cuentas- calcule los activos totales- Cuent.pdf
Dada la siguiente lista de cuentas- calcule los activos totales- Cuent.pdf
 
D-inatiod stadiaysy mnne vilute Fodrined itmene funstion Question 10 1.pdf
D-inatiod stadiaysy mnne vilute Fodrined itmene funstion Question 10 1.pdfD-inatiod stadiaysy mnne vilute Fodrined itmene funstion Question 10 1.pdf
D-inatiod stadiaysy mnne vilute Fodrined itmene funstion Question 10 1.pdf
 
d- What is the probability that Z is less than 1-51 or greater than 1-.pdf
d- What is the probability that Z is less than 1-51 or greater than 1-.pdfd- What is the probability that Z is less than 1-51 or greater than 1-.pdf
d- What is the probability that Z is less than 1-51 or greater than 1-.pdf
 
D2D2.pdf
D2D2.pdfD2D2.pdf
D2D2.pdf
 
D- E- Fs Match the number with the line in the figure with the structu.pdf
D- E- Fs Match the number with the line in the figure with the structu.pdfD- E- Fs Match the number with the line in the figure with the structu.pdf
D- E- Fs Match the number with the line in the figure with the structu.pdf
 
D) frotes bave been very usefal in a- coding the DNA of erganisme grow.pdf
D) frotes bave been very usefal in a- coding the DNA of erganisme grow.pdfD) frotes bave been very usefal in a- coding the DNA of erganisme grow.pdf
D) frotes bave been very usefal in a- coding the DNA of erganisme grow.pdf
 
d- As potassiuni concentration increase in the presence of valinomycin.pdf
d- As potassiuni concentration increase in the presence of valinomycin.pdfd- As potassiuni concentration increase in the presence of valinomycin.pdf
d- As potassiuni concentration increase in the presence of valinomycin.pdf
 

Recently uploaded

World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
NelTorrente
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
AG2 Design
 
Landownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptxLandownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptx
JezreelCabil2
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 

Recently uploaded (20)

World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
 
Landownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptxLandownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptx
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 

(B) Add a class named Square-java Give it private attributes double si.pdf

  • 1. (B) Add a class named Square.java Give it private attributes double side and String color Make a constructor with two attributes for assigning a value to side and color when the Square is instantiated. Add getter and setter methods for all of the attributes. Add a method that returns the area of the shape. (C) Make the Rectangle.java class. Also, Add a color attribute and make it private. Make a constructor with three attributes for assigning a value to width, height, and color when the Rectangle is instantiated. Add getter and setter methods for all of the attributes. Add a method that returns the area of the shape.