Word Occurrence Counter (Form Designer)

Grade 12

This is a form-based problem — open it in the Form Designer, not the code judge. A data file, Words.txt, is supplied alongside your project — one word per line. An edit box (edtQ1_4) holds a word to search for; a button (btnQ1_4) and a memo (redQ1_4) are already on the form. Write btnQ1_4's OnClick handler so that it reads Words.txt line by line, counts how many lines match edtQ1_4's text (case-insensitive), and shows the result in redQ1_4.

No input/output in the console sense. Grading sets edtQ1_4.Text to a word, clicks btnQ1_4 once, then checks redQ1_4.Text. If the word appears one or more times, show 'Occurrences: <n>' (e.g. 'Occurrences: 1'). If it doesn't appear at all, show 'Word not found'. Words.txt (one word per line, exactly as supplied): capacity variable Capacity loop array string boolean integer

Provided data file

Words.txt

capacity
variable
Capacity
loop
array
string
boolean
integer
Word Occurrence Counter─ ▢ ✕
Word to search for:
Search
Result:

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