Follow the UML diagram and directions on the attached file to create a RectangularPrism class and...

60.1K

Verified Solution

Question

Programming

Follow the UML diagram and directions on the attached file tocreate a RectangularPrism class and a RectangularPrismDemoclass.

---------------------------------------------------------------------------------------------------------------------------------------

RectangularPrism

           -length: double

      -width: double

      -height: double

+ RectangularPrism()

+ RectangularPrism(l:double,w:double,h:double)

+ setLength(l:double):void

+ setWidth(w:double):void

+ setHeight(h:double):void

+getLength():double

+getWidth():double

+getHeight():double

+getVolume():double

+getSurfaceArea():double

+toString():String

---------------------------------------------------------------------------------------------------------------------

  1. Create a RectangularPrism class in its own file based on theUML
  2. Create a separate RectangularPrismDemo Class file todemonstrate your class by doing the following:
    1. Create two prisms, one with each constructor
    2. Test each of your set and get methods
    3. Print out the information for both of your Prisms, usingprintf()

Answer & Explanation Solved by verified expert
3.8 Ratings (457 Votes)
thanks for the question here are the two classes RectangularPRismjava and RectangularPRismDemojava with screenshotfo the outputpublic class RectangularPrism private double length private double width private double height public RectangularPrism thislength 0 thiswidth 0    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students