I have an assignment for my class to create a table of volumes ina sphere. Starting with 5cm end w/50cm increments of 5. I feel I am very close but I can't get it to compile. here is what I have. Any help would be great.
[code=cpp]
#include <iostream>
#include <iomanip>
int main()
{
int i= 5; //radius of sphere
float x= (4.);
float b= (3.14);
float c= (4.0/3.0);
float y=0;// area
float z=0;// volume
{
do
cout<< setw (5) << i << setw (5) << y << set(5) << z <<endl;
<snipped>
}
while (i<=50);
cout<<"out of loop"<<endl;
return(0);
}
[/code]
[code=cpp]
#include <iostream>
#include <iomanip>
int main()
{
int i= 5; //radius of sphere
float x= (4.);
float b= (3.14);
float c= (4.0/3.0);
float y=0;// area
float z=0;// volume
{
do
cout<< setw (5) << i << setw (5) << y << set(5) << z <<endl;
<snipped>
}
while (i<=50);
cout<<"out of loop"<<endl;
return(0);
}
[/code]
Comment