Code is in Java. Will leave thumbs up and Thank you! To start, creat.pdf

Code is in Java. Will leave thumbs up and Thank you! To start, create a package hw2 for the assignment under your project for ITEC 2150. Part 1 Create a Part 1 subpackage p1 under the hw2 package. In the p1 subpackage, create a public abstract class Shape3D that models three- dimensional shapes. Create the following data fields and methods in the class: - A protected data field color which is of type String and a getter for the field. - A constructor public Shape(String color) that sets the color field to the argument. - Public abstract methods volume() and surfaceArea() with no argument that return the volume and surface area of the shape, respectively. The return type of both methods should be double. Create a public (concrete) class Ball as a subclass of the Shape3D class, and the following data fields and methods in the Ball class: - A private data field radius of type double representing the radius of a ball. - A constructor public Ball (String color, double radius) that sets the color and radius fields to the corresponding arguments. - Public (concrete) methods volume() and surfaceArea() that override and implement the corresponding abstract methods of the Shape3D class. They should compute and return the volume and surface area of the ball, respectively. Of a ball with radius r, the volume is 34r3 and the surface area is 4r2 - A toString method that returns a string in the default format of Intellij. Create a public (concrete) class Box as a subclass of the Shape3D class, and the following data fields and methods in the Box class: - Private data fields length, width and height of type double representing the length, width and height of a box, respectively. - A constructor public Rectangle (String color, double length, double width, double height) that sets the color, length, width and height fields to the corresponding arguments. - Public (concrete) methods volume() and surfaceArea() that override and implement the corresponding abstract methods of the Shape3D class. They should compute and return the volume and surface area of the box, respectively. Of a box with length l, width w and height h, the volume is lwh and the surface area is 2(lw+lh+wh) - A toString method that returns a string in the default format of Intellij. Create a public (concrete) class Cylinder as a subclass of the Shape3D class, and the following data fields and methods in the Cylinder class: - Private data fields radius and height representing the radius of the base circle and the height of a cylinder, respectively. - A constructor public Cylinder (String color, double radius, double height) that sets the color, radius and height fields to the corresponding arguments. - Public (concrete) methods volume() and surfaceArea() that override and implement the corresponding abstract methods of the Shape3D class. They should compute and return the volume and surface area of the cylinder, respectively. Of a cylinder with radius r and height h, the volume is r2h and the su.

Code is in Java. Will leave thumbs up and Thank you! To start, create a package hw2 for the
assignment under your project for ITEC 2150. Part 1 Create a Part 1 subpackage p1 under the
hw2 package. In the p1 subpackage, create a public abstract class Shape3D that models three-
dimensional shapes. Create the following data fields and methods in the class: - A protected data
field color which is of type String and a getter for the field. - A constructor public Shape(String
color) that sets the color field to the argument. - Public abstract methods volume() and
surfaceArea() with no argument that return the volume and surface area of the shape,
respectively. The return type of both methods should be double. Create a public (concrete) class
Ball as a subclass of the Shape3D class, and the following data fields and methods in the Ball
class: - A private data field radius of type double representing the radius of a ball. - A constructor
public Ball (String color, double radius) that sets the color and radius fields to the corresponding
arguments. - Public (concrete) methods volume() and surfaceArea() that override and implement
the corresponding abstract methods of the Shape3D class. They should compute and return the
volume and surface area of the ball, respectively. Of a ball with radius r, the volume is 34r3 and
the surface area is 4r2 - A toString method that returns a string in the default format of Intellij.
Create a public (concrete) class Box as a subclass of the Shape3D class, and the following data
fields and methods in the Box class: - Private data fields length, width and height of type double
representing the length, width and height of a box, respectively. - A constructor public Rectangle
(String color, double length, double width, double height) that sets the color, length, width and
height fields to the corresponding arguments. - Public (concrete) methods volume() and
surfaceArea() that override and implement the corresponding abstract methods of the Shape3D
class. They should compute and return the volume and surface area of the box, respectively. Of a
box with length l, width w and height h, the volume is lwh and the surface area is 2(lw+lh+wh) -
A toString method that returns a string in the default format of Intellij. Create a public (concrete)
class Cylinder as a subclass of the Shape3D class, and the following data fields and methods in
the Cylinder class: - Private data fields radius and height representing the radius of the base
circle and the height of a cylinder, respectively. - A constructor public Cylinder (String color,
double radius, double height) that sets the color, radius and height fields to the corresponding
arguments. - Public (concrete) methods volume() and surfaceArea() that override and implement
the corresponding abstract methods of the Shape3D class. They should compute and return the
volume and surface area of the cylinder, respectively. Of a cylinder with radius r and height h,
the volume is r2h and the surface area is 2rh+2r2 - A toString method that returns a string in the
default format of Intellij.
Create a public class named Shape3dTest. In the main method of the class: - Create an Array List
of Shape3D objects. - Create a Random object using 2150 as the seed. - Create one Ball object
with each of the three colors red, green and blue in this order, using a random integer between 1
and 20 as the radius. Add the three Ball objects in this order to the shapes list. - Create one Box
object with each of the three colors red, green and blue in this order, using a random integer
between 1 and 50 as the length, a random integer between 1 and 20 as the width, and random
integer between 1 and 60 as the height. Add the three Box objects in this order to the shapes list.
- Create one Cylinder object with each of the three colors red, green and blue in this order, using
a random integer between 1 and 15 as the radius and a random integer between 1 and 50 as the
height. Add the three Cylinder objects in this order to the shapes list. - Write a loop to print, in
separate lines, each element of the shapes list as well as its volume and surface area.

Recommandé

To start create a package hw2 for the assignment under your.pdf par
To start create a package hw2 for the assignment under your.pdfTo start create a package hw2 for the assignment under your.pdf
To start create a package hw2 for the assignment under your.pdfajayadinathcomputers
18 vues2 diapositives
Create a Part 2 subpackage 22 under the hw2 package and copy here the.pdf par
 Create a Part 2 subpackage 22 under the hw2 package and copy here the.pdf Create a Part 2 subpackage 22 under the hw2 package and copy here the.pdf
Create a Part 2 subpackage 22 under the hw2 package and copy here the.pdfbhanupreetkaur1
2 vues2 diapositives
I Abstract base class for shapes public abstract class Shap.pdf par
I Abstract base class for shapes public abstract class Shap.pdfI Abstract base class for shapes public abstract class Shap.pdf
I Abstract base class for shapes public abstract class Shap.pdfkashishkochhar5
2 vues1 diapositive
Write a superclass called Shape (as shown in the class diagram), whi.pdf par
Write a superclass called Shape (as shown in the class diagram), whi.pdfWrite a superclass called Shape (as shown in the class diagram), whi.pdf
Write a superclass called Shape (as shown in the class diagram), whi.pdfdbrienmhompsonkath75
5 vues2 diapositives
Assignment in java par
Assignment in javaAssignment in java
Assignment in javaMariel Canonicato
990 vues2 diapositives
Work on Static methods OBJECTIVES -continue to practice to write the .docx par
 Work on Static methods OBJECTIVES -continue to practice to write the .docx Work on Static methods OBJECTIVES -continue to practice to write the .docx
Work on Static methods OBJECTIVES -continue to practice to write the .docxajoy21
4 vues9 diapositives

Contenu connexe

Similaire à Code is in Java. Will leave thumbs up and Thank you! To start, creat.pdf

Define the following 2 classes to represent 2-dimensional objec.pdf par
 Define the following 2 classes to represent 2-dimensional objec.pdf Define the following 2 classes to represent 2-dimensional objec.pdf
Define the following 2 classes to represent 2-dimensional objec.pdfallurafashions98
21 vues1 diapositive
3 - Finding similar items par
3 - Finding similar items3 - Finding similar items
3 - Finding similar itemsViet-Trung TRAN
4.1K vues49 diapositives
Background This course is all about data visualization. However, we.docx par
Background This course is all about data visualization. However, we.docxBackground This course is all about data visualization. However, we.docx
Background This course is all about data visualization. However, we.docxrosemaryralphs52525
2 vues9 diapositives
FIT5047 Semester 1, 2015 Problem Solving as SearchFIT5047 .docx par
FIT5047 Semester 1, 2015 Problem Solving as SearchFIT5047 .docxFIT5047 Semester 1, 2015 Problem Solving as SearchFIT5047 .docx
FIT5047 Semester 1, 2015 Problem Solving as SearchFIT5047 .docxvoversbyobersby
2 vues11 diapositives
Please I need complete codes in c++ in this questionImplem.pdf par
Please I need complete codes in c++ in this questionImplem.pdfPlease I need complete codes in c++ in this questionImplem.pdf
Please I need complete codes in c++ in this questionImplem.pdfeyewaregallery
3 vues6 diapositives
Data Visualizing with RStudioBackground As we have learned,.docx par
Data Visualizing with RStudioBackground As we have learned,.docxData Visualizing with RStudioBackground As we have learned,.docx
Data Visualizing with RStudioBackground As we have learned,.docxrandyburney60861
2 vues4 diapositives

Similaire à Code is in Java. Will leave thumbs up and Thank you! To start, creat.pdf(20)

Define the following 2 classes to represent 2-dimensional objec.pdf par allurafashions98
 Define the following 2 classes to represent 2-dimensional objec.pdf Define the following 2 classes to represent 2-dimensional objec.pdf
Define the following 2 classes to represent 2-dimensional objec.pdf
Background This course is all about data visualization. However, we.docx par rosemaryralphs52525
Background This course is all about data visualization. However, we.docxBackground This course is all about data visualization. However, we.docx
Background This course is all about data visualization. However, we.docx
FIT5047 Semester 1, 2015 Problem Solving as SearchFIT5047 .docx par voversbyobersby
FIT5047 Semester 1, 2015 Problem Solving as SearchFIT5047 .docxFIT5047 Semester 1, 2015 Problem Solving as SearchFIT5047 .docx
FIT5047 Semester 1, 2015 Problem Solving as SearchFIT5047 .docx
Please I need complete codes in c++ in this questionImplem.pdf par eyewaregallery
Please I need complete codes in c++ in this questionImplem.pdfPlease I need complete codes in c++ in this questionImplem.pdf
Please I need complete codes in c++ in this questionImplem.pdf
Data Visualizing with RStudioBackground As we have learned,.docx par randyburney60861
Data Visualizing with RStudioBackground As we have learned,.docxData Visualizing with RStudioBackground As we have learned,.docx
Data Visualizing with RStudioBackground As we have learned,.docx
Write simple Code in c++ using the code below- Calulctae the area of t.docx par noreendchesterton753
Write simple Code in c++ using the code below- Calulctae the area of t.docxWrite simple Code in c++ using the code below- Calulctae the area of t.docx
Write simple Code in c++ using the code below- Calulctae the area of t.docx
This is all one question and not very difficult- please have comments.docx par EricIPjGreenes
This is all one question and not very difficult- please have comments.docxThis is all one question and not very difficult- please have comments.docx
This is all one question and not very difficult- please have comments.docx
JAVA ProgramMake a LandTract class with the following fiel.pdf par manjan6
JAVA ProgramMake a LandTract class with the following fiel.pdfJAVA ProgramMake a LandTract class with the following fiel.pdf
JAVA ProgramMake a LandTract class with the following fiel.pdf
manjan63 vues
The Affordable Care Act (ACA) requires all US citizens and legal r.docx par mehek4
The Affordable Care Act (ACA) requires all US citizens and legal r.docxThe Affordable Care Act (ACA) requires all US citizens and legal r.docx
The Affordable Care Act (ACA) requires all US citizens and legal r.docx
mehek42 vues
Implement the following inheritance hierarchy- - Class ThreeDimRoundSh.pdf par asarudheen07
Implement the following inheritance hierarchy- - Class ThreeDimRoundSh.pdfImplement the following inheritance hierarchy- - Class ThreeDimRoundSh.pdf
Implement the following inheritance hierarchy- - Class ThreeDimRoundSh.pdf
asarudheen074 vues
Create class Date with the following capabilities-a) Output the date i.docx par lez31palka
Create class Date with the following capabilities-a) Output the date i.docxCreate class Date with the following capabilities-a) Output the date i.docx
Create class Date with the following capabilities-a) Output the date i.docx
lez31palka3 vues
Cataloging in 3-D: Three-Dimensional Artifacts and Realia par Emily Nimsakont
Cataloging in 3-D: Three-Dimensional Artifacts and RealiaCataloging in 3-D: Three-Dimensional Artifacts and Realia
Cataloging in 3-D: Three-Dimensional Artifacts and Realia
Emily Nimsakont9.2K vues
The Functional Programming Triad of Map, Filter and Fold par Philip Schwarz
The Functional Programming Triad of Map, Filter and FoldThe Functional Programming Triad of Map, Filter and Fold
The Functional Programming Triad of Map, Filter and Fold
Philip Schwarz3.5K vues
Hive Functions Cheat Sheet par Hortonworks
Hive Functions Cheat SheetHive Functions Cheat Sheet
Hive Functions Cheat Sheet
Hortonworks9.3K vues
in Scala 3 language with this informationa value board thats an.pdf par contact41
in Scala 3 language with this informationa value board thats an.pdfin Scala 3 language with this informationa value board thats an.pdf
in Scala 3 language with this informationa value board thats an.pdf
contact412 vues

Plus de secunderbadtirumalgi

Codebaseimport numpy as npimport mathimport cvxpy as cpimpo.pdf par
Codebaseimport numpy as npimport mathimport cvxpy as cpimpo.pdfCodebaseimport numpy as npimport mathimport cvxpy as cpimpo.pdf
Codebaseimport numpy as npimport mathimport cvxpy as cpimpo.pdfsecunderbadtirumalgi
15 vues4 diapositives
Como preliminar a la solicitud de estimaciones presupuestarias de ve.pdf par
Como preliminar a la solicitud de estimaciones presupuestarias de ve.pdfComo preliminar a la solicitud de estimaciones presupuestarias de ve.pdf
Como preliminar a la solicitud de estimaciones presupuestarias de ve.pdfsecunderbadtirumalgi
2 vues1 diapositive
Como director general reci�n nombrado de Minnesota Micromotors, Inc..pdf par
Como director general reci�n nombrado de Minnesota Micromotors, Inc..pdfComo director general reci�n nombrado de Minnesota Micromotors, Inc..pdf
Como director general reci�n nombrado de Minnesota Micromotors, Inc..pdfsecunderbadtirumalgi
3 vues1 diapositive
Como gerente de operaciones de Holz Furniture, debe tomar la decisi�.pdf par
Como gerente de operaciones de Holz Furniture, debe tomar la decisi�.pdfComo gerente de operaciones de Holz Furniture, debe tomar la decisi�.pdf
Como gerente de operaciones de Holz Furniture, debe tomar la decisi�.pdfsecunderbadtirumalgi
30 vues1 diapositive
Como l�der de una empresa, desea que su empresa alcance un mayor niv.pdf par
Como l�der de una empresa, desea que su empresa alcance un mayor niv.pdfComo l�der de una empresa, desea que su empresa alcance un mayor niv.pdf
Como l�der de una empresa, desea que su empresa alcance un mayor niv.pdfsecunderbadtirumalgi
2 vues1 diapositive
Como parte de la investigaci�n de su tesis, genera una biblioteca de.pdf par
Como parte de la investigaci�n de su tesis, genera una biblioteca de.pdfComo parte de la investigaci�n de su tesis, genera una biblioteca de.pdf
Como parte de la investigaci�n de su tesis, genera una biblioteca de.pdfsecunderbadtirumalgi
2 vues1 diapositive

Plus de secunderbadtirumalgi(20)

Codebaseimport numpy as npimport mathimport cvxpy as cpimpo.pdf par secunderbadtirumalgi
Codebaseimport numpy as npimport mathimport cvxpy as cpimpo.pdfCodebaseimport numpy as npimport mathimport cvxpy as cpimpo.pdf
Codebaseimport numpy as npimport mathimport cvxpy as cpimpo.pdf
Como preliminar a la solicitud de estimaciones presupuestarias de ve.pdf par secunderbadtirumalgi
Como preliminar a la solicitud de estimaciones presupuestarias de ve.pdfComo preliminar a la solicitud de estimaciones presupuestarias de ve.pdf
Como preliminar a la solicitud de estimaciones presupuestarias de ve.pdf
Como director general reci�n nombrado de Minnesota Micromotors, Inc..pdf par secunderbadtirumalgi
Como director general reci�n nombrado de Minnesota Micromotors, Inc..pdfComo director general reci�n nombrado de Minnesota Micromotors, Inc..pdf
Como director general reci�n nombrado de Minnesota Micromotors, Inc..pdf
Como gerente de operaciones de Holz Furniture, debe tomar la decisi�.pdf par secunderbadtirumalgi
Como gerente de operaciones de Holz Furniture, debe tomar la decisi�.pdfComo gerente de operaciones de Holz Furniture, debe tomar la decisi�.pdf
Como gerente de operaciones de Holz Furniture, debe tomar la decisi�.pdf
Como l�der de una empresa, desea que su empresa alcance un mayor niv.pdf par secunderbadtirumalgi
Como l�der de una empresa, desea que su empresa alcance un mayor niv.pdfComo l�der de una empresa, desea que su empresa alcance un mayor niv.pdf
Como l�der de una empresa, desea que su empresa alcance un mayor niv.pdf
Como parte de la investigaci�n de su tesis, genera una biblioteca de.pdf par secunderbadtirumalgi
Como parte de la investigaci�n de su tesis, genera una biblioteca de.pdfComo parte de la investigaci�n de su tesis, genera una biblioteca de.pdf
Como parte de la investigaci�n de su tesis, genera una biblioteca de.pdf
Como director ejecutivo de la empresa, su primera orden del d�a es d.pdf par secunderbadtirumalgi
Como director ejecutivo de la empresa, su primera orden del d�a es d.pdfComo director ejecutivo de la empresa, su primera orden del d�a es d.pdf
Como director ejecutivo de la empresa, su primera orden del d�a es d.pdf
Como auditor, ha descubierto los siguientes problemas con el sistema.pdf par secunderbadtirumalgi
Como auditor, ha descubierto los siguientes problemas con el sistema.pdfComo auditor, ha descubierto los siguientes problemas con el sistema.pdf
Como auditor, ha descubierto los siguientes problemas con el sistema.pdf
Como analista de Delta Airlines, se le pide que ayude al personal de.pdf par secunderbadtirumalgi
Como analista de Delta Airlines, se le pide que ayude al personal de.pdfComo analista de Delta Airlines, se le pide que ayude al personal de.pdf
Como analista de Delta Airlines, se le pide que ayude al personal de.pdf
Como alcalde de Tropical Island, se enfrenta al doble mandato de pre.pdf par secunderbadtirumalgi
Como alcalde de Tropical Island, se enfrenta al doble mandato de pre.pdfComo alcalde de Tropical Island, se enfrenta al doble mandato de pre.pdf
Como alcalde de Tropical Island, se enfrenta al doble mandato de pre.pdf
Commentators on the US economy feel the US economy fell into a reces.pdf par secunderbadtirumalgi
Commentators on the US economy feel the US economy fell into a reces.pdfCommentators on the US economy feel the US economy fell into a reces.pdf
Commentators on the US economy feel the US economy fell into a reces.pdf
Comment on Target�s efforts to predict shopper behavior. Do you have.pdf par secunderbadtirumalgi
Comment on Target�s efforts to predict shopper behavior. Do you have.pdfComment on Target�s efforts to predict shopper behavior. Do you have.pdf
Comment on Target�s efforts to predict shopper behavior. Do you have.pdf
Coloque los eventos para explicar c�mo un bien p�blico llega a ser d.pdf par secunderbadtirumalgi
Coloque los eventos para explicar c�mo un bien p�blico llega a ser d.pdfColoque los eventos para explicar c�mo un bien p�blico llega a ser d.pdf
Coloque los eventos para explicar c�mo un bien p�blico llega a ser d.pdf
collective bargaining, as practised in contemporary labour relations.pdf par secunderbadtirumalgi
collective bargaining, as practised in contemporary labour relations.pdfcollective bargaining, as practised in contemporary labour relations.pdf
collective bargaining, as practised in contemporary labour relations.pdf
Colbert opera un servicio de catering en el m�todo de acumulaci�n. E.pdf par secunderbadtirumalgi
Colbert opera un servicio de catering en el m�todo de acumulaci�n. E.pdfColbert opera un servicio de catering en el m�todo de acumulaci�n. E.pdf
Colbert opera un servicio de catering en el m�todo de acumulaci�n. E.pdf
Colin est� tratando de decidir si debe hacer su contribuci�n a la cu.pdf par secunderbadtirumalgi
Colin est� tratando de decidir si debe hacer su contribuci�n a la cu.pdfColin est� tratando de decidir si debe hacer su contribuci�n a la cu.pdf
Colin est� tratando de decidir si debe hacer su contribuci�n a la cu.pdf
Coeficiente de variaci�nFabricaci�n de Metales ha aislado cuatro a.pdf par secunderbadtirumalgi
Coeficiente de variaci�nFabricaci�n de Metales ha aislado cuatro a.pdfCoeficiente de variaci�nFabricaci�n de Metales ha aislado cuatro a.pdf
Coeficiente de variaci�nFabricaci�n de Metales ha aislado cuatro a.pdf
CODE THIS IN C# AND USE VISUAL STUDIOAdditional logic required by .pdf par secunderbadtirumalgi
CODE THIS IN C# AND USE VISUAL STUDIOAdditional logic required by .pdfCODE THIS IN C# AND USE VISUAL STUDIOAdditional logic required by .pdf
CODE THIS IN C# AND USE VISUAL STUDIOAdditional logic required by .pdf
Code using Java Programming. Show your code and output.Create a pe.pdf par secunderbadtirumalgi
Code using Java Programming. Show your code and output.Create a pe.pdfCode using Java Programming. Show your code and output.Create a pe.pdf
Code using Java Programming. Show your code and output.Create a pe.pdf

Dernier

Pharmaceutical Analysis PPT (BP 102T) par
Pharmaceutical Analysis PPT (BP 102T) Pharmaceutical Analysis PPT (BP 102T)
Pharmaceutical Analysis PPT (BP 102T) yakshpharmacy009
121 vues29 diapositives
ANGULARJS.pdf par
ANGULARJS.pdfANGULARJS.pdf
ANGULARJS.pdfArthyR3
54 vues10 diapositives
Guidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptx par
Guidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptxGuidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptx
Guidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptxNiranjan Chavan
48 vues48 diapositives
Geology of Ethiopia and the Horn Chapter 2 GeES 1011.pptx par
Geology of Ethiopia and the Horn Chapter 2 GeES 1011.pptxGeology of Ethiopia and the Horn Chapter 2 GeES 1011.pptx
Geology of Ethiopia and the Horn Chapter 2 GeES 1011.pptxbehailugetu
104 vues42 diapositives
Guess Papers ADC 1, Karachi University par
Guess Papers ADC 1, Karachi UniversityGuess Papers ADC 1, Karachi University
Guess Papers ADC 1, Karachi UniversityKhalid Aziz
119 vues17 diapositives
Ask The Expert! Nonprofit Website Tools, Tips, and Technology.pdf par
 Ask The Expert! Nonprofit Website Tools, Tips, and Technology.pdf Ask The Expert! Nonprofit Website Tools, Tips, and Technology.pdf
Ask The Expert! Nonprofit Website Tools, Tips, and Technology.pdfTechSoup
68 vues28 diapositives

Dernier(20)

ANGULARJS.pdf par ArthyR3
ANGULARJS.pdfANGULARJS.pdf
ANGULARJS.pdf
ArthyR354 vues
Guidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptx par Niranjan Chavan
Guidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptxGuidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptx
Guidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptx
Niranjan Chavan48 vues
Geology of Ethiopia and the Horn Chapter 2 GeES 1011.pptx par behailugetu
Geology of Ethiopia and the Horn Chapter 2 GeES 1011.pptxGeology of Ethiopia and the Horn Chapter 2 GeES 1011.pptx
Geology of Ethiopia and the Horn Chapter 2 GeES 1011.pptx
behailugetu104 vues
Guess Papers ADC 1, Karachi University par Khalid Aziz
Guess Papers ADC 1, Karachi UniversityGuess Papers ADC 1, Karachi University
Guess Papers ADC 1, Karachi University
Khalid Aziz119 vues
Ask The Expert! Nonprofit Website Tools, Tips, and Technology.pdf par TechSoup
 Ask The Expert! Nonprofit Website Tools, Tips, and Technology.pdf Ask The Expert! Nonprofit Website Tools, Tips, and Technology.pdf
Ask The Expert! Nonprofit Website Tools, Tips, and Technology.pdf
TechSoup 68 vues
The Future of Micro-credentials: Is Small Really Beautiful? par Mark Brown
The Future of Micro-credentials:  Is Small Really Beautiful?The Future of Micro-credentials:  Is Small Really Beautiful?
The Future of Micro-credentials: Is Small Really Beautiful?
Mark Brown131 vues
Women From 1850 To 1950 Essay par Amy Williams
Women From 1850 To 1950 EssayWomen From 1850 To 1950 Essay
Women From 1850 To 1950 Essay
Amy Williams41 vues
What is Digital Transformation? par Mark Brown
What is Digital Transformation?What is Digital Transformation?
What is Digital Transformation?
Mark Brown56 vues
NodeJS and ExpressJS.pdf par ArthyR3
NodeJS and ExpressJS.pdfNodeJS and ExpressJS.pdf
NodeJS and ExpressJS.pdf
ArthyR360 vues
Presentation_NC_Future now 2006.pdf par Lora
Presentation_NC_Future now 2006.pdfPresentation_NC_Future now 2006.pdf
Presentation_NC_Future now 2006.pdf
Lora 38 vues
Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption... par BC Chew
Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption...Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption...
Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption...
BC Chew55 vues
Research Methodology (M. Pharm, IIIrd Sem.)_UNIT_IV_CPCSEA Guidelines for Lab... par RAHUL PAL
Research Methodology (M. Pharm, IIIrd Sem.)_UNIT_IV_CPCSEA Guidelines for Lab...Research Methodology (M. Pharm, IIIrd Sem.)_UNIT_IV_CPCSEA Guidelines for Lab...
Research Methodology (M. Pharm, IIIrd Sem.)_UNIT_IV_CPCSEA Guidelines for Lab...
RAHUL PAL53 vues
JRN 362 - Lecture Twenty-Three (Epilogue) par Rich Hanley
JRN 362 - Lecture Twenty-Three (Epilogue)JRN 362 - Lecture Twenty-Three (Epilogue)
JRN 362 - Lecture Twenty-Three (Epilogue)
Rich Hanley46 vues
Career Building in AI - Technologies, Trends and Opportunities par WebStackAcademy
Career Building in AI - Technologies, Trends and OpportunitiesCareer Building in AI - Technologies, Trends and Opportunities
Career Building in AI - Technologies, Trends and Opportunities
WebStackAcademy56 vues

Code is in Java. Will leave thumbs up and Thank you! To start, creat.pdf

  • 1. Code is in Java. Will leave thumbs up and Thank you! To start, create a package hw2 for the assignment under your project for ITEC 2150. Part 1 Create a Part 1 subpackage p1 under the hw2 package. In the p1 subpackage, create a public abstract class Shape3D that models three- dimensional shapes. Create the following data fields and methods in the class: - A protected data field color which is of type String and a getter for the field. - A constructor public Shape(String color) that sets the color field to the argument. - Public abstract methods volume() and surfaceArea() with no argument that return the volume and surface area of the shape, respectively. The return type of both methods should be double. Create a public (concrete) class Ball as a subclass of the Shape3D class, and the following data fields and methods in the Ball class: - A private data field radius of type double representing the radius of a ball. - A constructor public Ball (String color, double radius) that sets the color and radius fields to the corresponding arguments. - Public (concrete) methods volume() and surfaceArea() that override and implement the corresponding abstract methods of the Shape3D class. They should compute and return the volume and surface area of the ball, respectively. Of a ball with radius r, the volume is 34r3 and the surface area is 4r2 - A toString method that returns a string in the default format of Intellij. Create a public (concrete) class Box as a subclass of the Shape3D class, and the following data fields and methods in the Box class: - Private data fields length, width and height of type double representing the length, width and height of a box, respectively. - A constructor public Rectangle (String color, double length, double width, double height) that sets the color, length, width and height fields to the corresponding arguments. - Public (concrete) methods volume() and surfaceArea() that override and implement the corresponding abstract methods of the Shape3D class. They should compute and return the volume and surface area of the box, respectively. Of a box with length l, width w and height h, the volume is lwh and the surface area is 2(lw+lh+wh) - A toString method that returns a string in the default format of Intellij. Create a public (concrete) class Cylinder as a subclass of the Shape3D class, and the following data fields and methods in the Cylinder class: - Private data fields radius and height representing the radius of the base circle and the height of a cylinder, respectively. - A constructor public Cylinder (String color, double radius, double height) that sets the color, radius and height fields to the corresponding arguments. - Public (concrete) methods volume() and surfaceArea() that override and implement the corresponding abstract methods of the Shape3D class. They should compute and return the volume and surface area of the cylinder, respectively. Of a cylinder with radius r and height h, the volume is r2h and the surface area is 2rh+2r2 - A toString method that returns a string in the default format of Intellij.
  • 2. Create a public class named Shape3dTest. In the main method of the class: - Create an Array List of Shape3D objects. - Create a Random object using 2150 as the seed. - Create one Ball object with each of the three colors red, green and blue in this order, using a random integer between 1 and 20 as the radius. Add the three Ball objects in this order to the shapes list. - Create one Box object with each of the three colors red, green and blue in this order, using a random integer between 1 and 50 as the length, a random integer between 1 and 20 as the width, and random integer between 1 and 60 as the height. Add the three Box objects in this order to the shapes list. - Create one Cylinder object with each of the three colors red, green and blue in this order, using a random integer between 1 and 15 as the radius and a random integer between 1 and 50 as the height. Add the three Cylinder objects in this order to the shapes list. - Write a loop to print, in separate lines, each element of the shapes list as well as its volume and surface area.