Is the code below correct? My compiler says there are errors but i cant find any.
// depletion of CFC compounds
const double limit = 0.01; // amount we want from what start with
cout <<"Enter half life of the element/compound:" ;
amount = 1.0; // % of what we start with
numyears=0.0; //number of years we have waited
while (amount > limit) //the new concept here. see NOTE
numyears=numyears + half_life;
amount = amount*0.5;
cout <<"You would have to wait " <<numyears << " years" <<endl;
//the new concept here. It means...while the amount >limit , it keeps looping.
//Stops only if the stuff in() is false
//the next line is the main meat of loop
//it means, DO number of years =numyears+halflife while numyears increases by 1.
// While that happens, the amount is halved