std::cout << "Please enter a number between 1 and 5.\n\n";
std::cout<< "1.Calculate the Cone Volume. \n";
std::cout<< "2.Calculate the Sphere Volume. \n";
std::cout<< "3.Calculate the Hypotenuse of a Triangle. \n";
std::cout<< "4.Calculate the Volume of a Pyramid. \n";
std::cout<< "5.Calculate the Area of a Circle. \n";
std::cin >> userchoice;
switch(userchoice)
{
case 1:
//Prompt user for dimensions of cone//
std::cout<< "Please enter the cone radius in inches: \n";
std::cin>> coneradius;
std::cout<< "Please enter the cone height in inches: \n";
std::cin>>coneheight;
//Find the volume of the cone//
ConeVolume=(1/3) * Pi * coneradius * coneradius * coneheight;
//Output the values//
std::cout<< "The volume of the cone is: "<<ConeVolume<< "inches^3.\n\n";
break;
case 2:
//Prompt user for sphere dimensions//
std::cout<< "Please enter the sphere radius in inches: \n";
std::cin>>sphereradius;
//Find the volume of the sphere//
SphereVolume=(4/3)* Pi * sphereradius* sphereradius* sphereradius;
//Output the values//
std::cout<< "The volume of the sphere is: "<<SphereVolume<< "inches^3.\n\n";
break;
case 3:
//Prompt user for sides of right triangle//
std::cout<< "Please enter side 1: \n";
std::cin>>side1;
std::cout<< "Please enter side 2: \n";
std::cin>>side2;
//Find hypotenuse of a right triangle//
side3=side1 * side1 + side2 * side2;
HypTriangle= sqrt (side3);
//Output the values//
std::cout<< "The hypotenuse of the right triangle is: "<<HypTriangle<<"inches\n\n";
break;
case 4:
//Prompt user for dimensions of Pyramid with square base//
std::cout<< "Please enter the base in inches: \n";
std::cin>> pyrbase;
std::cout<< "Please enter the height in inches: \n";
std::cin>>pyrheight;
//Find the volume of a Pyramid with a square base//
BaseArea=pyrbase * pyrbase;
PyramidVolume=1/3 * BaseArea * pyrheight;
//Output the values//
std::cout<< "The volume of the Pyramid is: "<<PyramidVolume<<"inches^3.\n\n";
break;
case 5:
//Prompt user for radius of a circle//
std::cout<< "Please enter the radius in inches: \n";
std:cin>>circleradius;
//Find Area of the Circle//
CircleArea=Pi * circleradius * circleradius;
//Output the values//
std::cout<<"The Area of the Circle is: "<<CircleArea<<"inches^2.\n\n";
break;
system ("pause"); Error Message: Code will never be executed
I am about 90% certain the error is from a visual studio compiler.
This warning is because those two limes of code are after a break statement inside of a switch. You probably meant to put those lines after the switch {...}