Booster Rocket Fuel (Form Designer)

Grade 12

This is a form-based problem — open it in the Form Designer, not the code judge. An edit box (edtFuel) holds a booster's starting fuel level in litres; a button (btnSimulate) and a memo (redOutput) are already on the form. Write btnSimulate's OnClick handler so that it simulates the burn, one stage at a time: the rocket burns a fixed 12 litres per stage, and each stage's fuel level — before that stage's burn — is added as its own line to redOutput. The simulation stops the moment fuel would drop below 0.

No input/output in the console sense. Grading sets edtFuel.Text to a starting fuel level, clicks btnSimulate once, then checks redOutput.Text. Each line: 'Fuel: <n>' — one per stage, starting from the value in edtFuel, each subsequent line 12 less than the last, stopping as soon as the next value would be negative. Example: fuel = 50 produces five lines: 'Fuel: 50', 'Fuel: 38', 'Fuel: 26', 'Fuel: 14', 'Fuel: 2' (the next stage would be −10, so the simulation stops there).

Booster Rocket Fuel─ ▢ ✕
Starting fuel (litres):
Simulate
Fuel at each stage:

5 components · drag to move, corner handle to resize, Delete to remove

Object Inspector

Select a component on the form to edit its properties.

Palette

Pick a component, then click the form

Standard

Additional

Data

Non-visual