Input the Student name,marks for 3 subjects,calculate the avg,grade. In order to calculate the grade using following conditions
package controller;
import javafx.event.ActionEvent;
import javafx.scene.control.TextField;
import javafx.scene.layout.AnchorPane;
public class StudentMarksFormController
{
public TextField txtMarks1;
public TextField txtMarks2;
public TextField txtMarks3;
public TextField txtTot;
public TextField txtAvg;
public TextField txtGrade;
public AnchorPane pane;
public void BtnCalculate(ActionEvent actionEvent) {
int mark1 = Integer.parseInt(txtMarks1.getText());
int mark2 = Integer.parseInt(txtMarks2.getText());
int mark3 = Integer.parseInt(txtMarks3.getText());
int tot = mark1 + mark2 + mark3;
txtTot.setText(String.valueOf(tot));
double avg = tot/3;
txtAvg.setText(String.valueOf(avg));
String Grade;
if(avg > 50)
{
Grade = "Pass";
}
else
{
Grade = "Fail";
}
txtGrade.setText(Grade);
}
public void BtnClear(ActionEvent actionEvent) {
txtMarks1.setText("");
txtMarks2.setText("");
txtMarks3.setText("");
txtTot.setText("");
txtAvg.setText("");
txtGrade.setText("");
txtMarks1.requestFocus();
}
}
What Is the Tesla Pi Phone? Imagine if Tesla, the company that makes famous…
Inventory Management POS systems are now an essential part of modern businesses such as bookshops,…
If you're just beginning to learn Java GUI programming creating an Water System Calculator is a fantastic project for…
GitHub is a powerful tool used by teams and developers around the globe. This guide is…
It's like having a super-smart buddy that is always there to help you write stories,…
The UK is known for its rich history, diverse culture, and most of all its…