package com.example.calcutator.Calculator1;

import android.os.Bundle;

import com.example.calcutator.R;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class Calculator_1_10 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_calculator_1_10);
    }

    public void CornDrum_calculation(View v){
        try{
            EditText C_Round = findViewById(R.id.Beam_Round);
            TextView C_drum = findViewById(R.id.CornDrum);
            float Corn_Drum = Float.parseFloat(C_Round.getText().toString());
            double calcul = Corn_Drum/3.14/25.4;
            double calculround =  Math.round(calcul);
            C_drum.setText(calculround+"");
        }catch (NumberFormatException e){
            Toast.makeText(this.getApplicationContext(),"값을 제대로 입력해 주세요", Toast.LENGTH_LONG).show();
        }

    }

}
