Original Polyhedra
[Sphere] (2, 2, 2)->Radius: 1 Diameter: 2
[Cylinder] (2, 2, 2)->Radius: 1 Height: 2
[Sphere] (8, 8, 8)->Radius: 4 Diameter: 8
[Cylinder] (6, 6, 2)->Radius: 3 Height: 2
[Composite] (14, 14, 14)->3 polyhedra
[Sphere] (6, 6, 6)->Radius: 3 Diameter: 6
[Sphere] (10, 10, 10)->Radius: 5 Diameter: 10
[Sphere] (14, 14, 14)->Radius: 7 Diameter: 14
[Composite] (10, 10, 10)->2 polyhedra
[Cylinder] (4, 4, 1)->Radius: 2 Height: 1
[Sphere] (10, 10, 10)->Radius: 5 Diameter: 10
[Sphere] (6, 6, 6)->Radius: 3 Diameter: 6
Scaled Polyhedra (Clones)
[Sphere] (4, 4, 4)->Radius: 2 Diameter: 4
[Cylinder] (4, 4, 4)->Radius: 2 Height: 4
[Sphere] (16, 16, 16)->Radius: 8 Diameter: 16
[Cylinder] (12, 12, 4)->Radius: 6 Height: 4
[Composite] (28, 28, 28)->3 polyhedra
[Sphere] (12, 12, 12)->Radius: 6 Diameter: 12
[Sphere] (20, 20, 20)->Radius: 10 Diameter: 20
[Sphere] (28, 28, 28)->Radius: 14 Diameter: 28
[Composite] (20, 20, 20)->2 polyhedra
[Cylinder] (8, 8, 2)->Radius: 4 Height: 2
[Sphere] (20, 20, 20)->Radius: 10 Diameter: 20
[Sphere] (12, 12, 12)->Radius: 6 Diameter: 12
your task is
- Acquire complete versions of Cylinder.h and Cylinder.cpp from Part 1. You may use my Part 1 solution, or your own solution.
Complete add, display, and scale functions for Composite.
Complete the Big-3 for Composite
Note that the Composite::allPolyhedra attribute, is a vector of pointers (std::vector).
[Sphere] (2, 2, 2)->Radius: 1 Diameter: 2
[Cylinder] (2, 2, 2)->Radius: 1 Height: 2
[Sphere] (8, 8, 8)->Radius: 4 Diameter: 8
[Cylinder] (6, 6, 2)->Radius: 3 Height: 2
[Composite] (14, 14, 14)->3 polyhedra
[Sphere] (6, 6, 6)->Radius: 3 Diameter: 6
[Sphere] (10, 10, 10)->Radius: 5 Diameter: 10
[Sphere] (14, 14, 14)->Radius: 7 Diameter: 14
[Composite] (10, 10, 10)->2 polyhedra
[Cylinder] (4, 4, 1)->Radius: 2 Height: 1
[Sphere] (10, 10, 10)->Radius: 5 Diameter: 10
[Sphere] (6, 6, 6)->Radius: 3 Diameter: 6
Scaled Polyhedra (Clones)
[Sphere] (4, 4, 4)->Radius: 2 Diameter: 4
[Cylinder] (4, 4, 4)->Radius: 2 Height: 4
[Sphere] (16, 16, 16)->Radius: 8 Diameter: 16
[Cylinder] (12, 12, 4)->Radius: 6 Height: 4
[Composite] (28, 28, 28)->3 polyhedra
[Sphere] (12, 12, 12)->Radius: 6 Diameter: 12
[Sphere] (20, 20, 20)->Radius: 10 Diameter: 20
[Sphere] (28, 28, 28)->Radius: 14 Diameter: 28
[Composite] (20, 20, 20)->2 polyhedra
[Cylinder] (8, 8, 2)->Radius: 4 Height: 2
[Sphere] (20, 20, 20)->Radius: 10 Diameter: 20
[Sphere] (12, 12, 12)->Radius: 6 Diameter: 12
your task is
- Acquire complete versions of Cylinder.h and Cylinder.cpp from Part 1. You may use my Part 1 solution, or your own solution.
Complete add, display, and scale functions for Composite.
Complete the Big-3 for Composite
Note that the Composite::allPolyhedra attribute, is a vector of pointers (std::vector).
Sample Solution