#include <stdio.h>
/* Kanyaphat Ongsantpap*/
/* 66070503015 CHE */
 

float cubeVolume();
float cylinderVolume();
float prismVolume();
float sphereVolume();
float pyramidvolume();
float coneVolume();
#define PI 3.14
  float cube ;
  float cylinder, prism, sphere, pyramid,cone;
  float a, rC, h, base, height, rS, basep, heightp, rCone, hcone;
int main(void) {
  int i;
  printf("Press 1 to find Volume of Cube\nPress 2 to find Volume of Cylinder\nPress 3 to find Volume of Prism\nPress 4 to find Volume of sphere\nPress 5 to find Volume of Pyramid\nPress 6 to find Volume of Cone\nPress 0 to exit the program\n");
  scanf("%d", &i);
   switch(i){
     case 1: {
       
        printf("Side of the cube:");
        scanf("%f", &a);
        float cube = cubeVolume();
       if(cube >= 0.01){
        printf("The Volume of Cube is %0.2f", cube);
       }
     }
     break;
     case 2:{
        printf("Radius of the Cylinder:");
        scanf("%f", &rC);
        printf("Height of the Cylinder:");
        scanf("%f", &h);
        float cylinder = cylinderVolume();
       if(cylinder >= 0.01){
        printf("The Volume of Cylinder is %0.2f", cylinder);
       }
     }
     break;
     case 3:{
        printf("Area base of pryamid:");
        scanf("%f", &base);
        printf("Height of the Prism:");
        scanf("%f", &height);
        float prism = prismVolume();
       if(prism >= 0.01){
        printf("The Volume of Prism is %0.2f", prism);
       }
     }
        break;
     case 4:{
        printf("Radius of the Sphere:");
        scanf("%f", &rS);
        float sphere = sphereVolume();
       if(sphere >= 0.01){
       printf("The Volume of Sphere is %0.2f", sphere);
       }
     }
        break;
     case 5:{
        printf("Base of the Pyramid:");
        scanf("%f", &basep);
        printf("Height of the Pyramid:");
        scanf("%f", &heightp);
        float pyramid = pyramidvolume();
       if(pyramid >= 0.01){
       printf("The Volume of Pyramid is %0.2f", pyramid);
       }
     }
     break;
     case 6:{
        printf("Radius of the Cone:");
        scanf("%f", &rCone);
        printf("Height of the Cone:");
        scanf("%f", &hcone);
        float cone = coneVolume();
       if(cone >= 0.01){
       printf("The Volume of Cone is %0.2f", cone);
       }
     }
       break;
     case 0:
        printf("Exiting the program");
     break;
   } 
  return 0;
  
}
float cubeVolume(){
  return a*a*a;
}
float cylinderVolume(){
  return PI*rC*rC*h;
}
float prismVolume(){
  return base*height;
}
float sphereVolume(){
  return 4.00/3.00*PI*rS*rS*rS;
}
float pyramidvolume(){
  return 1.00/3.00*basep*heightp;
}
float coneVolume(){
  return 1.00/3.00*PI*rCone*rCone*hcone;
}