I cant find anything wrong with my program, any suggestions?
#include <stdio.h>
#include "simpio.h"
#include "strlib.h"
#include "random.h"
int main()
{
int s, r, h, w, l, t, shape;
string box;
string cube;
string cylinder;
printf("Please enter the shape; ");
shape = GetLine();
switch(shape)
{
case 1:cube();break;
case 2:box();break;
case 3:cylinder();break;
}
if (StringEqual(shape, "cube"));
{
printf("Enter side: ");
s = GetInteger();
t = s*s*s;
printf("The volume of a cube with side=%d is: %d",s , t);
}
if (StringEqual(shape, "box"));
{
printf("Enter width: ");
w = GetInteger();
printf("Enter height: ");
h = GetInteger();
printf("Enter length: ");
l = GetInteger();
t = w*l*h;
printf("The volume of a box with width=%d, height=%d and length%d is: %d",w ,h ,l, t);
}
if (StringEqual(shape, "cylinder"));
{
printf("Enter radius: ");
r = GetInteger();
printf("Enter height: ");
h = GetInteger();
t = 3.14*r*r*h;
printf("The volume of a cylinder with radius=%d and height=%d is: ",r ,h , t);
}
system("pause");
}
1> c:\program files (x86)\microsoft visual c++ 2008\vc\include\stdio.h(324) : see declaration of 'sscanf'
1>c:\users\franz sauer\desktop\programs\volumes\volumes\volumes.cpp(18) : error C2450: switch expression of type 'string' is illegal
1> Integral expression required
1>c:\volumes.cpp(21) : error C2064: term does not evaluate to a function taking 0 arguments
1>c:\volumes.cpp(22) : error C2064: term does not evaluate to a function taking 0 arguments
1>c:\volumes.cpp(23) : error C2064: term does not evaluate to a function taking 0 arguments