Java

Student Marks Calculation using Java FX

Input the Student name,marks for 3 subjects,calculate the avg,grade. In order to calculate the grade using following conditions

if the average is greater than 50 awarded as “Pass” Other wise “Fail”.
StudentMarksFormController
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();


    }
}

i have attached the video link below. which will do this tutorials step by step.

admin

Recent Posts

Creating Grocery Inventory App Using React

Introduction to Grocery Inventory Apps Managing grocery inventory can be a daunting task, but with…

3 days ago

Fish Inventory Shop Management System in Angular

This article explain how to make a Fish Inventory Management App in Angular.this app explain…

1 week ago

Fish Inventory Management with React

Introduction to Fish Inventory Management In the aquaculture industry, managing fish inventory is crucial for…

1 week ago

Java GUI CRUD for Beginners

Introduction to Java GUI CRUD Java is a powerful programming language widely used for building…

2 weeks ago

Creating Beautiful Login Form Design Using React

Introduction to Login Form Design Designing an effective and beautiful login form is crucial for…

2 weeks ago

Creating Responsive Login Form with React

Introduction In today creating a responsive login form is essential for providing a seamless user…

3 weeks ago