KnowledgeBoat Logo

Computer Applications

Write a program to calculate the gross salary of an employee when
Basic Salary = Rs.8600
DA = 20% of Salary
HRA = 10% of Salary
CTA = 12% of the Salary.
Gross Salary = (Salary + DA + HRA + CTA)

Java

Input in Java

121 Likes

Answer

public class KboatSalary
{
    public static void main(String args[]) {
        int sal = 8600;
        double da = 20 / 100.0 * sal;
        double hra = 10 / 100.0 * sal;
        double cta = 12 / 100.0 * sal;
        double gross = sal + da + hra + cta;
        System.out.println("Gross Salary = " + gross);
    }
}

Output

BlueJ output of Write a program to calculate the gross salary of an employee when Basic Salary = Rs.8600 DA = 20% of Salary HRA = 10% of Salary CTA = 12% of the Salary. Gross Salary = (Salary + DA + HRA + CTA)

Answered By

53 Likes


Related Questions