Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- txt1 = (TextView) findViewById(R.id.txt1);
- txt2 = (TextView) findViewById(R.id.txt2);
- txt3 = (TextView) findViewById(R.id.txt3);
- total = (TextView) findViewById(R.id.total);
- edittext2 = (EditText) findViewById(R.id.edittext2);
- edittext3 = (EditText) findViewById(R.id.edittext3);
- calc = (Button) findViewById(R.id.calc);
- calc.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- float M = float.parseFloat;
- float V = float.parseFloat(edittext3.getText().toString());
- float ec = (M * (V * V)) / 2;
- total.setText(Float.toString(ec));
- }
- })
- ;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement