Houses File Reader (Form Designer)

Grade 12

This is a form-based problem — open it in the Form Designer, not the code judge. A data file, Houses.txt, lists a street address followed by its number of bedrooms, alternating line by line, for a set of houses. A button (btnRead) and a memo (redOutput) are already on the form. Write btnRead's OnClick handler so that it reads the whole file and displays one formatted line per house in redOutput.

No input/output in the console sense. Grading clicks btnRead once, then checks redOutput.Text. Format per line: '<street address> - <number of bedrooms>-bedroom house' Houses.txt: 61 Loop street 4 83 Church street 2 17 School street 3

Provided data file

Houses.txt

61 Loop street
4
83 Church street
2
17 School street
3
Houses─ ▢ ✕
Read file
Houses.txt formatted:

3 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