Home Java Advanced Salary Calculation System using Java

Advanced Salary Calculation System using Java

1 min read
0
0
1,459

This tutorial will teach you how to make a Advanced Salary Calculation System using Java. this tutorial help you to find out the Employee bonus,OT amount,netsalary.

when you calculating employee bonus based on the following condition.

if the salary is more than 50000,include 10% bonus of the salary

if the salary is more than 30000,include 5% bonus of the salary

otherwise ,include 5% bonus of the salary

paste the code inside the net salary button

 int bsal,bons,OT_rate,OT_hour,OT_amount,nsal;

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
     
        
        bsal = Integer.parseInt(txtsal.getText());
        
        
        //Calculating Bonus
        
        if(bsal >= 50000)
            bons = bsal * 10/100;
        
        else if(bsal >= 30000)
            bons = bsal * 5/100;
        else
              bons = bsal * 2/100;
        
        txtbon.setText(String.valueOf(bons));
        
         //Calculating OT Amount
         OT_rate = Integer.parseInt(txtotrate.getText());
         OT_hour = Integer.parseInt(txtoths.getText()); 
         
         OT_amount = OT_rate * OT_hour;
         
         txtotamount.setText(String.valueOf(OT_amount));
        
         
           //Calculating OT NetSalary
           
           nsal = bsal + bons + OT_amount;
           
           txtnsal.setText(String.valueOf(nsal));
        
    }

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

Load More Related Articles
  • Conditional Statements in Python

    Conditional statements in Python allow us to control the flow of execution based on condit…
  • Java Beans

    A Java Bean is a reusable software component that follows a specific set of conventions. J…
  • Java String Methods

    Java provides a rich set of built-in methods for handling String operations efficiently. S…
Load More By admin
  • Java Beans

    A Java Bean is a reusable software component that follows a specific set of conventions. J…
  • Java String Methods

    Java provides a rich set of built-in methods for handling String operations efficiently. S…
  • Java Developer Jobs

    Java remains one of the most in-demand programming languages worldwide, powering everythin…
Load More In Java

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also

Conditional Statements in Python

Conditional statements in Python allow us to control the flow of execution based on condit…