jadi di sini ada 5 macam latihan : sesuai dengan tulisannya jika penjumlahan hanya akan ada soal penjumlahan saja dan seterusnya kecuali yang acak akan memberikan keempat latihan secara acak.
pada umumnya anak akan di berikan 2 sesi per hari jangan terlalu banyak nanti bosan per sesi rentang waktunya adalah 15 menit. rata2 anak jika sudah bisa mencapai 200 - 250 tanpa salah soal berarti sudah terbiasa.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
grp1: TGroupBox;
lbl1: TLabel;
lbl3: TLabel;
lbl2: TLabel;
lbl4: TLabel;
edt1: TEdit;
btn1: TButton;
btn2: TButton;
btn3: TButton;
btn4: TButton;
btn5: TButton;
btn6: TButton;
btn7: TButton;
btn8: TButton;
btn9: TButton;
btn10: TButton;
btn11: TButton;
btn12: TButton;
lbl5: TLabel;
tmr1: TTimer;
lbl6: TLabel;
rg1: TRadioGroup;
procedure FormCreate(Sender: TObject);
procedure btn2Click(Sender: TObject);
procedure btn12Click(Sender: TObject);
procedure btn3Click(Sender: TObject);
procedure btn4Click(Sender: TObject);
procedure btn5Click(Sender: TObject);
procedure btn6Click(Sender: TObject);
procedure btn7Click(Sender: TObject);
procedure btn8Click(Sender: TObject);
procedure btn9Click(Sender: TObject);
procedure btn10Click(Sender: TObject);
procedure btn11Click(Sender: TObject);
procedure btn1Click(Sender: TObject);
procedure tmr1Timer(Sender: TObject);
procedure edt1KeyPress(Sender: TObject; var Key: Char);
procedure edt1Change(Sender: TObject);
procedure rg1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
jawab : string;
i,hasil_pembagi : byte;
benar,salah,total : word;
waktu : word;
tabel1 : array [2..10,2..10] of Integer;
procedure acak_soal ();
end;
const
A : array [1..10] of byte = (11,12,13,14,15,16,17,18,19,20);
var
Form1: TForm1;
implementation
uses Math;
{$R *.dfm}
procedure Tform1.acak_soal ();
var
c1 : integer;
x,y : Byte;
begin
//Randomize;
if rg1.ItemIndex < 2 then
begin
c1 := RandomRange(11,21);
lbl1.Caption := IntToStr(c1);
c1 := RandomRange(4,11);
lbl2.Caption := IntToStr(c1);
end;
if rg1.ItemIndex = 2 then
begin
c1 := RandomRange(2,11);
lbl1.Caption := IntToStr(c1);
c1 := RandomRange(2,11);
lbl2.Caption := IntToStr(c1);
end;
if rg1.ItemIndex = 3 then
begin
x := RandomRange(2,11);
y := RandomRange(2,11);
lbl1.Caption := inttostr(tabel1[x,y]);
lbl2.Caption := IntToStr(y);
hasil_pembagi := x;
end;
if rg1.ItemIndex = 4 then
begin
c1 := RandomRange(1,5);
case c1 of
1 : begin
lbl3.Caption := '+';
c1 := RandomRange(11,21);
lbl1.Caption := IntToStr(c1);
c1 := RandomRange(4,11);
lbl2.Caption := IntToStr(c1);
end;
2 : begin
lbl3.Caption := '-';
c1 := RandomRange(11,21);
lbl1.Caption := IntToStr(c1);
c1 := RandomRange(4,11);
lbl2.Caption := IntToStr(c1);
end;
3 : begin
lbl3.Caption := 'x';
c1 := RandomRange(2,11);
lbl1.Caption := IntToStr(c1);
c1 := RandomRange(2,11);
lbl2.Caption := IntToStr(c1);
end;
4 : begin
lbl3.Caption := ':';
x := RandomRange(2,11);
y := RandomRange(2,11);
lbl1.Caption := inttostr(tabel1[x,y]);
lbl2.Caption := IntToStr(y);
hasil_pembagi := x;
end;
end;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
x,y : Byte;
begin
waktu := 0; tmr1.Enabled := false; btn1.Enabled := false;
jawab := ''; lbl1.Caption := ''; lbl2.Caption := ''; lbl5.Caption := 'Benar = 0 Salah = 0 Total = 0';
edt1.Text := jawab;
Randomize;
acak_soal;
benar := 0; salah := 0; total := 0;
if rg1.ItemIndex = 0 then lbl3.Caption := '+';
// menyiapkan tabel
for x := 2 to 10 do
begin
for y := 2 to 10 do
begin
tabel1[x,y] := x*y;
end;
end;
end;
procedure TForm1.btn2Click(Sender: TObject);
begin
jawab := jawab + '1';
edt1.Text := jawab;
end;
procedure TForm1.btn12Click(Sender: TObject);
begin
jawab := '';
edt1.Text := jawab;
end;
procedure TForm1.btn3Click(Sender: TObject);
begin
jawab := jawab + '2';
edt1.Text := jawab;
end;
procedure TForm1.btn4Click(Sender: TObject);
begin
jawab := jawab + '3';
edt1.Text := jawab;
end;
procedure TForm1.btn5Click(Sender: TObject);
begin
jawab := jawab + '4';
edt1.Text := jawab;
end;
procedure TForm1.btn6Click(Sender: TObject);
begin
jawab := jawab + '5';
edt1.Text := jawab;
end;
procedure TForm1.btn7Click(Sender: TObject);
begin
jawab := jawab + '6';
edt1.Text := jawab;
end;
procedure TForm1.btn8Click(Sender: TObject);
begin
jawab := jawab + '7';
edt1.Text := jawab;
end;
procedure TForm1.btn9Click(Sender: TObject);
begin
jawab := jawab + '8';
edt1.Text := jawab;
end;
procedure TForm1.btn10Click(Sender: TObject);
begin
jawab := jawab + '9';
edt1.Text := jawab;
end;
procedure TForm1.btn11Click(Sender: TObject);
begin
jawab := jawab + '0';
edt1.Text := jawab;
end;
procedure TForm1.btn1Click(Sender: TObject);
var
x,y : word;
begin
if rg1.ItemIndex = 0 then
begin
x := strtoint(lbl1.Caption) + strtoint(lbl2.Caption);
end;
if rg1.ItemIndex = 1 then
begin
x := strtoint(lbl1.Caption) - strtoint(lbl2.Caption);
end;
if rg1.ItemIndex = 2 then
begin
x := tabel1[strtoint(lbl1.Caption),strtoint(lbl2.Caption)];
end;
if rg1.ItemIndex = 3 then
begin
x := hasil_pembagi;
end;
if rg1.ItemIndex = 4 then
begin
if lbl3.Caption = '+' then x := strtoint(lbl1.Caption) + strtoint(lbl2.Caption);
if lbl3.Caption = '-' then x := strtoint(lbl1.Caption) - strtoint(lbl2.Caption);
if lbl3.Caption = 'x' then x := tabel1[strtoint(lbl1.Caption),strtoint(lbl2.Caption)];
if lbl3.Caption = ':' then x := hasil_pembagi;
end;
if edt1.Text = '' then edt1.Text := '0'; // jika kosong rubah jadi 0
y := strtoint(edt1.Text);
if x = y then
begin
inc(benar);
edt1.Text := '';
end
else inc(salah);
total := benar + salah ;
acak_soal;
lbl5.Caption := 'Benar = '+inttostr(benar)+' Salah = '+inttostr(salah)+ ' Total = '+ inttostr(total);
jawab := '';
end;
procedure TForm1.tmr1Timer(Sender: TObject);
begin
inc(waktu);
lbl6.Caption := inttostr(900 - waktu);
if waktu >= 900 then
begin
tmr1.Enabled := false;
waktu := 0; btn1.Enabled := false;
ShowMessage('Waktu sudah habis catat berapa benar dan salah kirimkan ke wa ayah');
end;
end;
procedure TForm1.edt1KeyPress(Sender: TObject; var Key: Char);
begin
if not (key in['0'..'9',#8,#13,#32]) then
begin
key:=#0;
showmessage('inputan hanya angka bro');
end;
end;
procedure TForm1.edt1Change(Sender: TObject);
begin
jawab := edt1.Text;
end;
procedure TForm1.rg1Click(Sender: TObject);
begin
tmr1.Enabled := false;
lbl6.Caption := '900';
if rg1.ItemIndex = 0 then lbl3.Caption := '+';
if rg1.ItemIndex = 1 then lbl3.Caption := '-';
if rg1.ItemIndex = 2 then lbl3.Caption := 'X';
if rg1.ItemIndex = 3 then lbl3.Caption := ':';
if rg1.ItemIndex = 4 then ;
ShowMessage('Lama test adalah 15 menit, dan dimulai setelah di kilk OK');
waktu := 0;
acak_soal;
tmr1.Enabled := true; btn1.Enabled := true;
end;
end.