Total Salary
Write a program to calculate the total salary of a person. The user has to enter the basic salary (an integer) and the grade (an uppercase character), and depending upon which the total salary is calculated as -
where :
Round off the total salary and then print the integral part only.
Note: Try finding out a function on the internet to do so
Input format :
Output Format :
Constraints :
Sample Input 1 :
Sample Output 1 :
Sample Input 2 :
Sample Output 2 :
Explanation of Input 2:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
num,g=input().split() | |
hra=(20*int(num)/100) | |
da=(50*int(num)/100) | |
allow=0 | |
if g == "B": | |
allow=allow+1500 | |
elif g == "A": | |
allow=allow+1700 | |
else: | |
allow = allow + 1300 | |
pf=(11*int(num)/100) | |
salary = int(num)+hra+da+allow-pf | |
print(round(salary)) |
Comments
Post a Comment
Please give us your valuable feedback