so i sort of got the hang of c++ but i still havent been able to finish the project... heres what i have so far but keeps giving me errors..anything that u guys can teach would be greatly apreciated
//Yair Jimenez
#include <iostream>
using namespace std;
int main
{
int double length=0,width=0,volume=0,maxvolume=0,height=0,max height=0;cut;
cout << "\nEnter Length in cm: "<<endl;
char again = 'y';
while (again=='y'||again=='Y')
while (!(cin >> length)||length <=0)
{
cout << "\nEnter length"<<endl;
while (!(cin>>length)||length <=0)
{
cout << "\nError,invalid entry.Re-Enter length in cm (must be positive integer): "<<endl;
cin.clear();
fflush(stdin);
}
cout <<"\nEnter width: "<<endl;
while(!(cin >> width)||width <=0)
{
cout <<"\nError, invalid entry .Re-Enter Length in cm (must be positive integer): "<<endl;
cin.clear();
fflush(stdin);
}
for (heigh=0;height<(length/2);height+=0.001)
{
Volume = (length-(2*height)) * (width-(2 * height)) * (height);
if (maxvolume < volume
{maxvolume=volume
cut=height
}
{
cout <<"\n with length of"<<length<<"cm"
<<"and width of"<<width
<<"cm: "<<endl;
cout <<"\nResult of maximum volume is: "
<<maxvolume<<",and the cut is: "<<cut<<endl;
fflush(stdin);
cout<<endl<<" press y to start over, other press enter to exit";
cin>>again
}
}
}
}