BMI Calculator (Form Designer)

Grade 10

This is a form-based problem — open it in the Form Designer, not the code judge. Two edit boxes (edtWeight in kg, edtHeight in metres) are already on the form, along with a button (btnCalculate) and a label (lblResult). Write btnCalculate's OnClick handler so that it works out the Body Mass Index and shows both the value and its category on lblResult.

No input/output in the console sense. Grading sets edtWeight.Text and edtHeight.Text, clicks btnCalculate once, then checks lblResult.Caption. Formula: . Categories: under 18.5 'Underweight', under 25 'Normal', under 30 'Overweight', otherwise 'Obese'. Format: '<BMI to 1 decimal> - <category>'. Examples: weight = 70, height = 1.75 -> '22.9 - Normal' weight = 100, height = 1.7 -> '34.6 - Obese'

BMI Calculator─ ▢ ✕
Weight (kg):
Height (m):
Calculate
lblResult

6 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