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

Employee Working Hours Calculation System using C#.net

Initialize the employee number, Hourswork,and Hoursrate to calculate a grosswage use the following condition. if…

1 week ago

Java Payroll System Calculate Employee Overtime

Act as a Java developer to create a program that calculates the gross wage for…

2 weeks ago

Employee Working Hours Calculation System using Java

Initialize the employee number, Hourswork,and Hoursrate to calculate a grosswage use the following condition. if…

2 weeks ago

Laravel 11 School Management System

In this tutorial, we will teach you how to create a simple school management system…

3 weeks ago

How to Make Admin Panel Using React MUI

I have design the Admin Basic templete using React MUI Design Admin Dashboard and Login.Here…

1 month ago

Install Laravel Breeze for Authentication Using Laravel 11

In this tutorial ,i am to going teach the Laravel Breeze.Laravel Breeze provides a simple…

1 month ago