Branch Sales Totals (2D Array, Form Designer)

Grade 12

This is a form-based problem — open it in the Form Designer, not the code judge. A constant 2D array, Sales, holds three branches' daily sales figures over four days. A button (btnCalculate) and a memo (memResult) are already on the form. Write btnCalculate's OnClick handler so that it works out each branch's total sales and displays one line per branch in memResult.

No input/output in the console sense. Grading clicks btnCalculate, then checks memResult.Text. Sales: array[1..3, 1..4] of Integer = ((1200, 1500, 1100, 1800), (900, 1000, 950, 1100), (2000, 2200, 1900, 2100)) — row = branch, column = day. Format (one line per branch): 'Branch <n>: R<total>'. Expected output: Branch 1: R5600 Branch 2: R3950 Branch 3: R8200

Branch Sales─ ▢ ✕
One total per branch:
Calculate

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