0% found this document useful (0 votes)
25 views2 pages

A - Nama:array (1..5) of String A - Ipa, A - Ips, A - Jumlah:array (1..5) of Integer Baris, I: Integer Nama:string Nilaitertinggi:integer

This document defines a Pascal program that stores student names and test scores in arrays, calculates totals, and finds the highest scoring student. It includes declarations for labels, edits, listboxes and buttons to display the data. Methods are defined to populate the arrays on a button click, calculate totals, and find the highest scoring student by comparing total scores.

Uploaded by

Yuwono Susilo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views2 pages

A - Nama:array (1..5) of String A - Ipa, A - Ips, A - Jumlah:array (1..5) of Integer Baris, I: Integer Nama:string Nilaitertinggi:integer

This document defines a Pascal program that stores student names and test scores in arrays, calculates totals, and finds the highest scoring student. It includes declarations for labels, edits, listboxes and buttons to display the data. Methods are defined to populate the arrays on a button click, calculate totals, and find the highest scoring student by comparing total scores.

Uploaded by

Yuwono Susilo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type

TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; Label3: TLabel; Edit1: TEdit; Edit2: TEdit; Edit3: TEdit; Button1: TButton; Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel; ListBox1: TListBox; ListBox2: TListBox; ListBox3: TListBox; ListBox4: TListBox; Button2: TButton; Label8: TLabel; Label9: TLabel; Edit4: TEdit; Edit5: TEdit; procedure FormActivate(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; a_nama:array[1..5]of string; a_ipa,a_ips,a_jumlah:array[1..5]of integer; baris,i: integer; nama:string; nilaitertinggi:integer; implementation

{$R *.dfm} procedure TForm1.FormActivate(Sender: TObject); begin baris:=0; end; procedure TForm1.Button1Click(Sender: TObject); begin baris:=baris+1; a_nama[baris]:=edit1.Text; listbox1.AddItem(edit1.Text,listbox1); a_ipa[baris]:=strtoint(edit2.Text); listbox2.AddItem(edit2.Text,listbox2); a_ips[baris]:=strtoint(edit3.Text); listbox3.AddItem(edit3.Text,listbox3); a_jumlah[baris]:=a_ipa[baris]+a_ips[baris]; listbox4.AddItem(inttostr(a_jumlah[baris]),listbox4); end; procedure TForm1.Button2Click(Sender: TObject); begin nama:=a_nama[i]; nilaitertinggi:=a_jumlah[i]; for i:=2 to baris do begin if nilaitertinggi>a_jumlah[i] then begin edit4.Text:=a_nama[i]; edit5.Text:=inttostr(a_jumlah[i]); end; end; end; end.

You might also like