tugas lagi
- MENGHITUNG GAJI KARYAWAN _1
Kode program:
void __fastcall TForm1::ComboBox1Change(TObject *Sender)
{
if (ComboBox1->Text == “GOL1”)
{
Edit3->Text =600000 ;
}
else if(ComboBox1->Text == “GOL2”)
{
Edit3->Text =700000 ;
}
else if(ComboBox1->Text == “GOL3”)
{
Edit3->Text =800000;
}
else if(ComboBox1->Text == “GOL4”)
{
Edit3->Text = 900000;
}
else
{
Edit3->Text = 0 ;
}
}
//—————————————————————————
void __fastcall TForm1::Button1Click(TObject *Sender)
{
char nip[5];
char nama[25];
int kode_gol;
float gaji_pokok, tunjangan, gaji_bersih;
tunjangan = StrToInt(Edit3->Text)* 0.1 ;
Edit5->Text = tunjangan;
gaji_bersih =StrToInt(Edit3->Text) + StrToInt(Edit5->Text);
Edit4->Text = gaji_bersih;
}
//———————————————————————–
- MENGHITUNG GAJI GURU
Kode program:
void __fastcall TForm1::ComboBox1Change(TObject *Sender)
{
if (ComboBox1->Text == “GOL1”)
{
Edit3->Text =800000 ;
}
else if(ComboBox1->Text == “GOL2”)
{
Edit3->Text =900000 ;
}
else if(ComboBox1->Text == “GOL3”)
{
Edit3->Text =1000000;
}
else if(ComboBox1->Text == “GOL4”)
{
Edit3->Text = 1100000;
}
else
{
Edit3->Text = 0 ;
}
}
//—————————————————————————
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int kode_gol;
float gaji_pokok, pensiun, askes, gaji_bersih ;
pensiun= StrToInt(Edit3->Text)*0.2;
Edit4->Text = pensiun;
askes= StrToInt(Edit3->Text)*0.05;
Edit5->Text=askes;
gaji_bersih =StrToInt(Edit3->Text) – StrToInt(Edit4->Text) – StrToInt(Edit5->Text);
Edit6->Text = gaji_bersih;
}
//—————————————————————————
void __fastcall TForm1::Button2Click(TObject *Sender)
{
Application->Terminate();
}
- MENGHITUNG GAJI PEGAWAI_2
Kode program:
void __fastcall TForm1::ComboBox1Change(TObject *Sender)
{
if (ComboBox1->Text == “GOL1”)
{
Edit3->Text =600000 ;
}
else if(ComboBox1->Text == “GOL2”)
{
Edit3->Text =700000 ;
}
else if(ComboBox1->Text == “GOL3”)
{
Edit3->Text =800000;
}
else if(ComboBox1->Text == “GOL4”)
{
Edit3->Text = 900000;
}
else
{
Edit3->Text = 0 ;
}
}
//——————————————————————–
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int kode_gol;
float gaji_pokok, tunj,tunj_pasangan, tunj_anak, gaji_bersih ;
tunj_pasangan = StrToInt(Edit3->Text)*0.1;
Edit4->Text = tunj_pasangan;
if (Edit7->Text == 1)
{
tunj_anak = StrToInt(Edit7->Text)*0.05*StrToInt(Edit3->Text);
}
else if (Edit7->Text == 2)
{
tunj_anak = StrToInt(Edit7->Text)*0.05*StrToInt(Edit3->Text);
}
else if (Edit7->Text == 3)
{
tunj_anak = StrToInt(Edit7->Text)*0.05*StrToInt(Edit3->Text);
}
else
{
tunj_anak = 0;
}
Edit5->Text=tunj_anak;
gaji_bersih =StrToInt(Edit3->Text) +StrToInt(Edit4->Text) + StrToInt(Edit5->Text);
Edit6->Text = gaji_bersih;
}
//—————————————————————————
void __fastcall TForm1::Button2Click(TObject *Sender)
{
Application->Terminate();
}
//—————————————————————————