Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Complete the provided (partial) C++ program to calculate the volume of regular shapes. a. (10 points) for successful execution. b. (1 point) for consistent
1. Complete the provided (partial) C++ program to calculate the volume of regular shapes. a. (10 points) for successful execution. b. (1 point) for consistent styling and commenting. #include using namespace std; // Function prototypes. double cubevolume (double, double); // Function prototype for cube volume. // Function prototype for pyramid volume. // Function prototype for sphere volume. // Function prototype for cone volume. // Function prototype for cylinder volume. // Initialize main. // Declare variables. // Variables for height and width (double). // Variable for the volume (double) set to zero for initial value. // Variable for the shape (int). // Prompt the user for values for height and width, and enter them in. // For circular objects, the width is the diameter. // Print values of height and width back to the user. // Ask the user to identify which shape they wish to calculate. // Have them enter 1 for cube, 2 for pyramid, etc. // Enter the user inputted value for shape. // Create a switch where each case is one of the shapes. // The default switch case will be not recognizing what the user entered. case 1: cout
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started