Question: I need to have this code produce the output above: C++ obivously. I am trying to run this in visual studio code and I get

I need to have this code produce the output above: C++ obivously. I am trying to run this in visual studio code and I get it to run but no ouput is being produced and its not asking for inputs. Please help me fix this code!
#include #include #include enum class ShapeKind { Circle, Square, Rectangle }; struct Shape { ShapeKind kind; double length; double width; }; double area(Shape s) { switch (s.kind) { case ShapeKind::Circle: return 3.14 * (s.length / 2) * (s.width / 2); case ShapeKind::Square: return s.length * s.width; case ShapeKind::Rectangle: return s.length * s.width; default: return 0; } } double perimeter(Shape s) { switch (s.kind) { case ShapeKind::Circle: return 3.14 * s.length; case ShapeKind::Square: return 4 * s.length; case ShapeKind::Rectangle: return 2 * (s.length + s.width); default: return 0; } } std::string nameOf(Shape s) { switch (s.kind) { case ShapeKind::Circle: return "Circle"; case ShapeKind::Square: return "Square"; case ShapeKind::Rectangle: return "Rectangle"; default: return ""; } } void promptAndReadInputFor(Shape& shape) { std::cout > shape.length; shape.width = shape.length; break; case ShapeKind::Square: std::cout > shape.length; shape.width = shape.length; break; case ShapeKind::Rectangle: std::cout > shape.length; std::cout > shape.width; if (shape.length == shape.width) { shape.kind = ShapeKind::Square; } break; default: break; } } int main() { Shape square = {ShapeKind::Square, 2.0, 3.0}; Shape rectangle = {ShapeKind::Rectangle, 4.0, 5.0}; promptAndReadInputFor(square); promptAndReadInputFor(rectangle); std::cout Enter the diameter of a circle: 5 Enter the length of a square: 6 Enter the length and width of a rectangle: 47 - TEST SCENARIO 2: Another sample outcome wher Enter the diameter of a circle: 4 Enter the length of a square: 5 Enter the length and width of a rectangle: 6.46.4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
