WhatsApp Channel
Join Now
Telegram Channel
Join Now

Write an algorithm and draw a flowchart that calculates salary of an employee. Prompt the user to enter the Basic Salary, HRA, TA, and DA. Add these components to calculate the Gross Salary. Also deduct 10% salary from the Gross Salary to be paid as tax.

Sunil

Algorithm

The algorithm prompts the user to input the Basic Salary, House Rent Allowance (HRA), Travel Allowance (TA), and Dearness Allowance (DA). It then calculates the Gross Salary by adding these components, deducts 10% of the Gross Salary as tax, and computes the Net Salary. Finally, it displays the Gross Salary, Tax, and Net Salary. Since salaries typically involve decimal values, all variables are declared as real numbers.

begin

    // Step 1: Input Data

    print "Enter the BASIC SALARY: "

    read BASIC_SALARY

    print "Enter the HRA: "

    read HRA

    print "Enter the TA: "

    read TA

    print "Enter the DA: "

    read DA

    // Step 2: Calculate Gross Salary

    GROSS_SALARY = BASIC_SALARY + HRA + TA + DA

    // Step 3: Calculate Tax

    TAX = 0.10 * GROSS_SALARY

    // Step 4: Calculate Net Salary

    NET_SALARY = GROSS_SALARY - TAX

    // Step 5: Output

    print "GROSS SALARY = ", GROSS_SALARY

    print "TAX DEDUCTED (10%) = ", TAX

    print "NET SALARY = ", NET_SALARY

end



Flowchart Description

Below is a textual representation of the flowchart that corresponds to the algorithm:


Explanation of the Flowchart:

  • Start: Indicates the beginning of the process.

  • Input Step: Represents prompts for the user to input the basic salary, HRA, TA, and DA.

  • Calculation Steps:

    • The first calculation block sums up the inputs to get the Gross Salary.

    • The next calculation block computes Tax as 10% of the gross salary.

    • Then, it calculates Net Salary by subtracting tax from the gross salary.

  • Output Step: Displays all the calculated values (Gross Salary, Tax, and Net Salary) to the user.

  • Stop: Marks the end of the process.

Post a Comment

Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.