var
x, y: integer;
top_student, temp_student: string;
top_score, temp_score: double;
begin
top_score := 0
showmessage('Please enter the number of students into the text box 1');
x := StrToInt(textbox1.text);
if x > o then
begin
for y:= 1 to x do
begin
temp_student := inputbox('student name', 'Please enter student name', '');
temp_score = StrToFloat(inputbox('student score', 'Please enter student score', ''));
if temp_score > top_score then
begin
top_score := temp_score;
top_student := temp_student;
end;
end;
showmessage('The top student is ' + top_student + ' with a score of ' + FloatToStr(top_score));
end;
end;