Gross Salary - CodeChef Solution

Hello coders, today we are going to solve Gross Salary CodeChef Solution Whose Problem Code is FLOW011. In a company an emplopyee is paid as under: If

Hello coders, today we are going to solve Gross Salary CodeChef Solution Whose Problem Code is FLOW011.

Gross Salary - CodeChef Solution
👊 Table Of Contents

Task

In a company an emplopyee is paid as under: If his basic salary is less than Rs. 1500, then HRA = 10% of base salary and DA = 90% of basic salary.

If his salary is either equal to or above Rs. 1500, then HRA = Rs. 500 and DA = 98% of basic salary. If the Employee's salary is input, write a program to find his gross salary.

NOTE: Gross Salary = Basic Salary + HRA + DA

Input 

The first line contains an integer T, total number of testcases. Then follow T lines, each line contains an integer salary.

Output

For each test case, output the gross salary of the employee in a new line. Your answer will be considered correct if the absolute error is less than 10^-2.

Constraints

  • 1 ≤ T ≤ 1000
  • 1 ≤ salary ≤ 100000

Example

Sample Input 

3
1203
10042
1312

Sample Output 

2406.00
20383.16
2624

Solution - Gross Salary - CodeChef Solution 

Python 3 

#Solution Provided by Sloth Coders 
T = int(input())
for i in range(T):
    n = int(input())
    if n < 1500:
        salary = n + (90*n/100) + (10*n/100)
        print(salary)
    else:
        salary = n + (98*n/100) + 500
        print(salary)

Disclaimer: The above Problem (Gross Salary) is generated by CodeChef but the Solution is Provided by Sloth Coders. This tutorial is only for Educational and Learning Purpose.

Also Read:

Sloth Coders is a Learning Platform for Coders, Programmers and Developers to learn from the basics to advance of Coding of different langauges(python, Java, Javascript and many more).

Post a Comment