Question: For this Programming Assignment, I want you to extend thePoint and Rectangle classes in above images into threedimensions. Note that: You will need three coordinates

Point blank x->3.0 y4.0image text in transcribed

For this Programming Assignment, I want you to extend the‘Point’ and ‘Rectangle’ classes in above images into threedimensions. Note that:

  • You will need three coordinates (x,y,z) to specify a ‘Point’that will be a corner of your box. (It can be any corner, I don’tcare which)
  • You will need three dimensions (width,height,depth) to specifythe size of your box.
  • Set the corner of your box at the point 5,5,5 in space.
  • Make the initial dimensions of your boxwidth=10,height=20,depth=30

Starting with the above parameters, please:

  • Create correct Class definitions for both the 3-D ‘Point’ and‘Box’
  • Create an instance of a box (mine is called ‘mybox’)
  • Assign to your box the starting point and dimensions describedabove.
  • Write a METHOD that takes your box and doubles each of itsdimensions and also calculates the volume of the new,larger box. (The volume is of course the width *height * depth). The volume should be returned as an attribute ofyour box object, for example,as mybox.volume.
  • Call the METHOD and print the volume.

The solution to this problem is seventeen lines of code --perhaps you can do it in fewer!

Point blank x->3.0 y4.0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!