Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  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. ;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement