0% found this document useful (0 votes)
23 views

A. Algoritma Program: Start

This document describes an algorithm program for calculating averages. It includes: 1. The algorithm starts by inputting a minimum and maximum value. It then uses a for loop to iterate from the minimum to the maximum value. 2. It provides steps for running the program, which include inputting the minimum and maximum values, selecting to iterate up or down, inputting data values, and viewing the output of total, count, and average. 3. The source code is provided in Pascal language and includes interfaces and implementations for forms, buttons, labels, and calculations.

Uploaded by

Rezki Lawalata
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

A. Algoritma Program: Start

This document describes an algorithm program for calculating averages. It includes: 1. The algorithm starts by inputting a minimum and maximum value. It then uses a for loop to iterate from the minimum to the maximum value. 2. It provides steps for running the program, which include inputting the minimum and maximum values, selecting to iterate up or down, inputting data values, and viewing the output of total, count, and average. 3. The source code is provided in Pascal language and includes interfaces and implementations for forms, buttons, labels, and calculations.

Uploaded by

Rezki Lawalata
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

A.

Algoritma Program
Start

Masukanbatasnilai

For To Do

Down To

Nilaiawallebihkecild
arinilaiakhir

Nilaiawallebihbesardar
inilaiakhir

Nilai ratarata

Cetak

End

B. GambarAplikasi

C. Cara Menjalankan Program


1. mulai
2. Masukan nilai batas awal dn batas akhir
3. Klik For To Do (untuk mengurutkan nilai dari batas awal ke akhir) atau Down To Do
(untuk mengurutkan data dari ke batas akhir ke batas awal) .
4. Masukkan data nilai kemudian klik ok.
5. Kemudian keterangan jumlah, banyak data dan nilai rata-rata akan muncul secara
otomatis.
6. Klik cetak untuk mencetak data.
7. Klik kembali atau close.
8. Selesai.

D. Source Code
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants,
Classes, Graphics, Controls, Forms,
Dialogs, jpeg, ExtCtrls, StdCtrls,
Buttons;
type
TForm1 = class(TForm)
Image1: TImage;
Label1: TLabel;
Etgl: TEdit;
Etime: TEdit;
Grata: TGroupBox;
GroupBox2: TGroupBox;
Eawaliky: TEdit;
Eakhiriky: TEdit;
Label2: TLabel;
Label3: TLabel;
Button1: TButton;
Button2: TButton;
BitBtn1: TBitBtn;
Label4: TLabel;
Efc1: TEdit;
Efc2: TEdit;
Metode: TGroupBox;

Rfor: TRadioButton;
Rdown: TRadioButton;
Rnone: TRadioButton;
Lb1: TListBox;
StaticText1: TStaticText;
Erata2: TEdit;
procedure FormCreate(Sender:
TObject);
procedure RforClick(Sender: TObject);
procedure Efc1Change(Sender:
TObject);
procedure RdownClick(Sender:
TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender:
TObject);
begin
dateseparator :='-';

shortdateformat := 'mm/dd/yyyy';
etgl.Text := 'Tanggal:' + datetostr (date);
timeseparator :=':';
shorttimeformat := 'hh/mm/ss';
etime.Text := 'JAM: ' + timetostr (now);
end;
procedure TForm1.RforClick(Sender:
TObject);
var
inputdata :string;
h,i,j:integer;
jumlah:real;
begin
jumlah:=0;
h:=Strtoint(eawaliky .text );
j:=Strtoint(eakhiriky .text );
efc2.Text:=floattostr(j);
begin
for i:= h to j do
begin
inputdata:=inputbox('input','masukan
nilai','');
lb1.items.Add('Nilai -->' +(inputdata));
jumlah:= jumlah+strtofloat(inputdata);
efc2.text:=floattostr(jumlah);
end;
end;
end;
procedure TForm1.Efc1Change(Sender:
TObject);
var
n1,n2:integer ;

key:real ;
begin
n1:=strtoint(efc1.Text) ;
n2:=strtoint(efc2.Text) ;
key:=n1/n2;
erata2.text := floattostr(key) ;
end;
procedure TForm1.RdownClick(Sender:
TObject);
var
inputdata:string;
a,b,c:integer;
jumlah:real;
begin
jumlah:=0;
a:=Strtoint(eawaliky .text );
b:=Strtoint(eakhiriky .text );
efc2.Text:=floattostr(b);
begin
for c:= b downto a do
begin
inputdata:=inputbox('input','masukan
nilai','');
lb1.items.Add('Nilai -->' +(inputdata));
jumlah:= jumlah+strtofloat(inputdata);
efc1.text:=floattostr(jumlah);
end;
end;
end;
end.

You might also like