I have a 200 point program to write for school that says how much extra grain will be left in the silo and Tomorrow is the last day to turn it in. But something is wrong with my while loop. Could you help me out? Also, I'm writing this code from memory. So bear with me. The A- version of this program is to write a for loop to enter the number of cars. But I don't have enough time to re-write an entire program. seeing as I can only work on the actual program in class.
#include <iostream.h>
#include <math.h>
int main (void)
{
float Height, Radius, Height, BoxHeight, BoxLength, BoxWidth, SiloVolume, BoxVolume, BoxVolumesum, Grainleft;
char choice = y
cout << "Enter height of silo." << endl;
cin >> Height;
cout << "Enter the Radius of the silo." << endl;
cin >> Radius;
SiloVolume = 3.14 * pow(Radius, 2) * Height;
BoxVolume = 0
while ( choice == 'y')
{
cout << "Enter Height of box car." << endl;
cin >> BoxHeight;
cout << "Enter length of box car. << endl;
cin >> BoxLength;
cout << "Enter the width of box car. << endl;
cin << BoxWidth;
BoxVolume = BoxHeight*BoxLength*BoxWidth;
cout << "Would you like to add another car? Type y if yes, or any other key for no.";
cin >> Choice;
}
BoxVolumesum = BoxVolume + Boxvolumesum;
Grainleft = SiloVolume - BoxVolumesum;
cout << "You will have" <<Grainleft<< "grain left." << endl;
return (0);
}