Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.
A van has capacity C kg (float). Packages arrive one at a time; each weight is a positive float. Add weights to a load.
Overloaded - cannot load and do not add it; then stop taking packages.Print final load and whether the van is full (load equals C within a tiny tolerance is optional) or under capacity.
Skills: while, if predicting overload before adding.