EduLearn - Online Education Platform

Welcome to EduLearn!

Start learning today with our wide range of courses taught by industry experts. Gain new skills, advance your career, or explore new interests.

Browse Courses

Ramesh basic salary is input through the keyboard, his hra is 40% of his basic salary his da is 20%basic salary

write a java program to find his gross salary

Here’s a simple Java program to calculate Ranesh’s Gross Salary, where:

Basic Salary is input from the user.

HRA (House Rent Allowance) is 40% of the Basic Salary.

DA (Dearness Allowance) is 20% of the Basic Salary.

Gross Salary = Basic Salary + HRA + DA.

✅ Java Code:

import java.util.Scanner;

public class GrossSalaryCalculator {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        // Input basic salary

        System.out.print(“Enter Ranesh’s Basic Salary: “);

        double basicSalary = scanner.nextDouble();

        // Calculate HRA and DA

        double hra = 0.40 * basicSalary;

        double da = 0.20 * basicSalary;

        // Calculate Gross Salary

        double grossSalary = basicSalary + hra + da;

        // Display result

        System.out.println(“Ranesh’s Gross Salary is: ” + grossSalary);

        scanner.close();

    }

}

📝 Sample Input/Output:

Enter Ranesh’s Basic Salary: 10000

Ranesh’s Gross Salary is: 16000.0

Java program for finding the gross salary

Leave a Reply

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

EduLearn - Online Education Platform

Welcome to EduLearn!

Start learning today with our wide range of courses taught by industry experts. Gain new skills, advance your career, or explore new interests.

Browse Courses

Popular Courses

[Course Image]

Introduction to Programming

Learn the fundamentals of programming with Python in this beginner-friendly course.

12 Hours Beginner
[Course Image]

Data Science Essentials

Master the basics of data analysis, visualization, and machine learning.

20 Hours Intermediate
[Course Image]

Web Development Bootcamp

Build modern websites with HTML, CSS, JavaScript and popular frameworks.

30 Hours Beginner
[Course Image]

Digital Marketing Fundamentals

Learn SEO, social media marketing, email campaigns and analytics.

15 Hours Beginner
Educational Website Footer