SHARE
TWEET

Untitled

a guest Jun 25th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @Override
  2. protected void onCreate(Bundle savedInstanceState) {
  3.     super.onCreate(savedInstanceState);
  4.     setContentView(R.layout.activity_main);
  5.     txt1 = (TextView) findViewById(R.id.txt1);
  6.     txt2 = (TextView) findViewById(R.id.txt2);
  7.     txt3 = (TextView) findViewById(R.id.txt3);
  8.     total = (TextView) findViewById(R.id.total);
  9.     edittext2 = (EditText) findViewById(R.id.edittext2);
  10.     edittext3 = (EditText) findViewById(R.id.edittext3);
  11.     calc = (Button) findViewById(R.id.calc);
  12.     calc.setOnClickListener(new View.OnClickListener() {
  13.         @Override
  14.         public void onClick(View view) {
  15.             float M = float.parseFloat;
  16.             float V = float.parseFloat(edittext3.getText().toString());
  17.             float ec = (M * (V * V)) / 2;
  18.             total.setText(Float.toString(ec));
  19.         }
  20.     })
  21.  
  22. ;}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top