package com.example.profesor.pravougaonik;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.view.View;

import android.widget.EditText;

import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    @Override

    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

    }

    public void KlikNaDugme(View v){

        EditText a1 = (EditText)findViewById(R.id.editTextA);

        EditText b1 = (EditText)findViewById(R.id.editTextB);

        TextView p1 = (TextView)findViewById(R.id.textViewP);

        double a = Double.parseDouble(a1.getText().toString());

        double b = Double.parseDouble(b1.getText().toString());

        double p = a*b;

        p1.setText(Double.toString(p));

    }

}