package com.example.myapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.example.myapplication.R;
public class MainActivity extends AppCompatActivity {
EditText editNot1, editNot2, editNot3, editNot4;
Button buton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
editNot1 = findViewById(R.id.editNot1);
editNot2 = findViewById(R.id.editNot2);
editNot3 = findViewById(R.id.editNot3);
editNot4 = findViewById(R.id.editNot4);
}
public void Onayla(View view){
int not1 = Integer.parseInt(editNot1.getText().toString());
int not2 = Integer.parseInt(editNot2.getText().toString());
int not3 = Integer.parseInt(editNot3.getText().toString());
int not4 = Integer.parseInt(editNot4.getText().toString());
float ort = (not1+not2+not3+not4)/4;
if (ort>=0 && ort<25){
Toast.makeText(this, "0 ile kaldınız.", Toast.LENGTH_SHORT).show();
}else if (ort>=25 && ort<50){
Toast.makeText(this, "1 ile kaldınız.", Toast.LENGTH_SHORT).show();
} else if (ort>=50 && ort<60) {
Toast.makeText(this, "2 ile geçtiniz", Toast.LENGTH_SHORT).show();
} else if (ort>=60 && ort<70) {
Toast.makeText(this, "3 ile geçtiniz", Toast.LENGTH_SHORT).show();
} else if (ort>=70 &&) {
}
}
}
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.example.myapplication.R;
public class MainActivity extends AppCompatActivity {
EditText editNot1, editNot2, editNot3, editNot4;
Button buton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
editNot1 = findViewById(R.id.editNot1);
editNot2 = findViewById(R.id.editNot2);
editNot3 = findViewById(R.id.editNot3);
editNot4 = findViewById(R.id.editNot4);
}
public void Onayla(View view){
int not1 = Integer.parseInt(editNot1.getText().toString());
int not2 = Integer.parseInt(editNot2.getText().toString());
int not3 = Integer.parseInt(editNot3.getText().toString());
int not4 = Integer.parseInt(editNot4.getText().toString());
float ort = (not1+not2+not3+not4)/4;
if (ort>=0 && ort<25){
Toast.makeText(this, "0 ile kaldınız.", Toast.LENGTH_SHORT).show();
}else if (ort>=25 && ort<50){
Toast.makeText(this, "1 ile kaldınız.", Toast.LENGTH_SHORT).show();
} else if (ort>=50 && ort<60) {
Toast.makeText(this, "2 ile geçtiniz", Toast.LENGTH_SHORT).show();
} else if (ort>=60 && ort<70) {
Toast.makeText(this, "3 ile geçtiniz", Toast.LENGTH_SHORT).show();
} else if (ort>=70 &&) {
}
}
}
