Program Aritmatika dengan Windows Form

Bismillah.. 🙂

Tutorial membuat program operasi aritmatika menggunakan windows form

1. Kode program tombol hitung.


private: System::Void bhitung_Click(System::Object^ sender, System::EventArgs^ e) {
 double n1, n2, hasil;
 String^ op;
 n1=double ::Parse(tn1->Text);
 n2=double ::Parse(tn2->Text);

op=cop ->Text;
 if(op =="+")
 hasil=Convert::ToDouble(n1+n2);
 else if(op=="-")
 hasil=Convert::ToDouble(n1-n2);
 else if(op=="*")
 hasil=Convert::ToDouble(n1*n2);
 else if(op=="/")
 hasil=Convert::ToDouble(n1)/ Convert::ToDouble(n2);
 thasil ->Text=hasil.ToString();

}
 private: System::Void bselesai_Click(System::Object^ sender, System::EventArgs^ e) {
 this ->Close();
 }

Output Program :

aritform

2. Video tutorial

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google

You are commenting using your Google account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s