Ok so here is my code for a practice homework at LiduidEmberS
#include <iostream>
using namespace std;
int main(void)
{
int a;
int b;
int c;
int d;
int radius;
int volumeprism;
volumeprism = b*c*d;
int volumesphere = 1.3333333333333*3.1415926536*(radius^3);
cout << "Welcome to the program!\n\n";
cout << "Do you want the volume of:\n";
cout << "1. Cube\n";
cout << "2. Sphere\n";
cout << "3. Exit\n";
cin >> a;
switch (a)
{
case 1:
cout<<"enter length";
cin >> b;
cout<<"enter height";
cin >> c;
cout<<"enter width";
cin >> d;
cout << volumeprism;
break;
case 2:
cout << "enter radius";
cin >> radius;
cout << volumesphere;
break;
case 3:
return 0;
break;
}
return 0;
}
...
I always get the following Warnings:
c:\documents and settings\family\my documents\visual studio 2005\projects\homework1volume\homework1volume\the code.cpp(12) : warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data
c:\documents and settings\family\my documents\visual studio 2005\projects\homework1volume\homework1volume\the code.cpp(11) : warning C4700: uninitialized local variable 'b' used
c:\documents and settings\family\my documents\visual studio 2005\projects\homework1volume\homework1volume\the code.cpp(11) : warning C4700: uninitialized local variable 'c' used
c:\documents and settings\family\my documents\visual studio 2005\projects\homework1volume\homework1volume\the code.cpp(11) : warning C4700: uninitialized local variable 'd' used
c:\documents and settings\family\my documents\visual studio 2005\projects\homework1volume\homework1volume\the code.cpp(12) : warning C4700: uninitialized local variable 'radius' used
So by now i KNOW that its something wrong with the variables and the math....
Please help me fix this problem..!