Luas Segitiga ( Android )

package luas.com;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class LuassegitigaActivity extends Activity {
/** Called when the activity is first created. */
private EditText alas2;
private EditText tinggi2;
private EditText hasil2 ;
private Button ok2;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
alas2=(EditText)findViewById(R.id.alas);
tinggi2=(EditText)findViewById(R.id.tinggi);
hasil2=(EditText)findViewById(R.id.hasil);
ok2=(Button)findViewById(R.id.ok);

}
public void View(View view){
int alas3=Integer.parseInt(alas2.getClass().toString());
int tinggi3=Integer.parseInt(tinggi2.getClass().toString());

try {

int hasil3= alas3*tinggi3;

hasil2.setText(String.valueOf(hasil3));
} catch (Exception e) {
// TODO: handle exception
}

}

}

Download Projecnya Di Sini sini

Advertisements

Published by

jarcode

hello I am jarcode

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s