English, asked by Anonymous, 8 months ago

Write a program to accept Basic salary of an employee. Calculate and display his gross salary based on the following information Basic Salary House Rent Allowance (HRA) Up to Rs. 10,000 10% Rs.10, 001 – Rs.20, 000 12% Rs.20, 001 – Rs.30, 000 15% Rs.30, 001 and above 20% Gross Salary= Basic+ HRAWrite a program to accept Basic salary of an employee. Calculate and display his gross salary based on the following information Basic Salary House Rent Allowance (HRA) Up to Rs. 10,000 10% Rs.10, 001 – Rs.20, 000 12% Rs.20, 001 – Rs.30, 000 15% Rs.30, 001 and above 20% Gross Salary= Basic+ HRA Please answer

Answers

Answered by poojan
3

Program to accept Basic salary of an employee and to Calculate, display his gross salary.

Given data :

Basic Salary - Input

House Rent Allowance (HRA)

Up to Rs. 10,000 10%

Rs.10, 001 – Rs.20, 000 12%

Rs.20, 001 – Rs.30, 000 15%

Rs.30, 001 and above 20%

Gross Salary= Basic+ HRA

Language using : Python Programming

[Refer the ATTACHMENT for thr execution of program, generation of output.]

Program :

Basic = int(input("Enter the basic salary : Rs."))

if Basic <= 10000 :

   HRA = (10/100)*Basic

elif Basic <= 20000 :

   HRA = (12/100)*Basic

elif Basic <= 30000 :

   HRA = (15/100)*Basic

elif Basic > 30000 :

   HRA = (20/100)*Basic

Gross_Salary = Basic + HRA

print("Gross Salary is Rs.{0}".format(Gross_Salary))

Test cases :

Input 1 : (Basic Salary Rs.20, 001 – Rs.30, 000, HRA = 15%  of Basic)

Enter the basic salary : Rs.22000

Output 1:

Gross Salary is Rs.25300.0

Input 2 : (Basic Salary upto Rs.10, 000, HRA = 10%  of Basic)

Enter the basic salary : Rs.9800

Output 2:

Gross Salary is Rs.10780.0

Input 3 : (Basic Salary Rs.10, 001 – Rs.20, 000, HRA = 12%  of Basic)

Enter the basic salary : Rs.12000

Output 3:

Gross Salary is Rs.13440.0

Input 4 : (Basic Salary greater than Rs.30, 001, HRA = 20%  of Basic)

Enter the basic salary : Rs.100000

Output 4:

Gross Salary is Rs.120000.0

Learn more :

1. Write the program for : Raju has a square-shaped puzzle made up of small square pieces containing numbers on them...

https://brainly.in/question/16956126

2. Printing all the palindromes formed by a palindrome word.

brainly.in/question/19151384

Attachments:
Similar questions