Knowee
Questions
Features
Study Tools

Shyam works at a company where his gross salary is calculated based on his basic salary along with other allowances. The company provides him with a Dearness Allowance (DA) of 10% and a Travel Allowance (TA) of 12%. Given Shayam's basic salary, write a program to calculate his gross salary. Note: This question was asked in Wipro coding test.Input format :The input consists of an integer N, representing Shyam's basic salary.Output format :The output prints "Gross Salary = " followed by an integer representing Shyam's gross salary.Refer to the sample output for formatting specifications.Code constraints :1000 ≤ N ≤ 50000Sample test cases :Input 1 :1280Output 1 :Gross Salary = 1561Input 2 :35750Output 2 :Gross Salary = 43615Input 3 :50000Output 3 :Gross Salary = 61000Note :The program will be evaluated only after the “Submit Code” is clicked.Extra spaces and new line characters in the program output will result in the failure of the test case.

Question

Shyam works at a company where his gross salary is calculated based on his basic salary along with other allowances. The company provides him with a Dearness Allowance (DA) of 10% and a Travel Allowance (TA) of 12%. Given Shayam's basic salary, write a program to calculate his gross salary. Note: This question was asked in Wipro coding test.Input format :The input consists of an integer N, representing Shyam's basic salary.Output format :The output prints "Gross Salary = " followed by an integer representing Shyam's gross salary.Refer to the sample output for formatting specifications.Code constraints :1000 ≤ N ≤ 50000Sample test cases :Input 1 :1280Output 1 :Gross Salary = 1561Input 2 :35750Output 2 :Gross Salary = 43615Input 3 :50000Output 3 :Gross Salary = 61000Note :The program will be evaluated only after the “Submit Code” is clicked.Extra spaces and new line characters in the program output will result in the failure of the test case.

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

Here is a Python solution for the problem:

def calculate_gross_salary(basic_salary):
    DA = 0.10 * basic_salary
    TA = 0.12 * basic_salary
    gross_salary = basic_salary + DA + TA
    return int(gross_salary)

basic_salary = int(input())
print("Gross Salary =", calculate_gross_salary(basic_salary))

This program works by first defining a function calculate_gross_salary that takes in the basic salary as an argument. It then calculates the Dearness Allowance (DA) and Travel Allowance (TA) as 10% and 12% of the basic salary respectively. The gross salary is then calculated by adding the basic salary, DA, and TA. The function then returns the gross salary as an integer.

The program then takes an input for the basic salary, and prints the gross salary by calling the calculate_gross_salary function with the basic salary as the argument.

This problem has been solved

Similar Questions

Problem StatementFin is managing salary taxation and wants a program to determine the net salaries based on the provided salary amount. Determine the net salary: If the salary is less than 50000, print "No Tax." For salaries between 50000 (inclusive) and 100000 (exclusive), apply 10% tax and print the net salary after deduction.For 100000 or more, apply 20% tax and print the net salary after deduction.Implement a program that takes Fin's salary as input (integer) and calculates the net salary after converting it into float.Input format :The input consists of an integer value n, representing Fin's monthly salary.Output format :If no tax is applicable, the output prints "No Tax"If a tax is applicable, the output prints "Salary after X% Tax: Y" where X represents the applicable tax percent value and Y represents the net salary after deduction with two decimal places.Refer to the sample output for the formatting specifications.Code constraints :In this scenario, the test cases fall under the following constraints:1000 ≤ n ≤ 120000Sample test cases :Input 1 :40000Output 1 :No TaxInput 2 :60000Output 2 :Salary after 10% Tax: 54000.00Input 3 :120000Output 3 :Salary after 20% Tax: 96000

A  B  C  D  E 1  IDENTICATION NUMBER  BASIC SALARY (N)  TOTAL ALLOWANCE (N)  TOTAL DEDUCTION (N)  NET SALARY (N) 2  WASC/LPT/001  800000  60000  40000  820000 3  WASC/LPT/002  700000  40000  20000  720000 4  WASC/LPT/003  300000  10000  5000  305000 5  WASC/LPT/004  400000  20000  10000  410000Figure 3What formula will correctly display the total number of individuals involved in the computation as shown in Figure 3?A. =COUNT(A2:A5)B. =COUNTIF(A2:A5)C. =COUNTA(A2:A5)D. =SUM(A2:A5)

A  B  C  D  E 1  IDENTICATION NUMBER  BASIC SALARY (N)  TOTAL ALLOWANCE (N)  TOTAL DEDUCTION (N)  NET SALARY (N) 2  WASC/LPT/001  800000  60000  40000  820000 3  WASC/LPT/002  700000  40000  20000  720000 4  WASC/LPT/003  300000  10000  5000  305000 5  WASC/LPT/004  400000  20000  10000  410000 Figure 3What formula will calculate the total number of individuals who earn less than ₦500,000 from the table as shown in Figure 3?A. =COUNT(E2:E5,B. =COUNT(E2:E5)C. =COUNTA(E2:E5)D. =COUNTIF(E2:E5,

Sam, a production manager, wants to calculate the weekly utilization of a machine. He is given the number of production runs, the average run time (in hours), and the total available hours per week for the machine.Your task is to write a program for Sam to calculate the total production hours per week and productivity percentage to help him manage the machine's operations effectively.Note: The productivity percentage is calculated by dividing the total production hours by the total available hours and then multiplying the result by 100.Input format :The first line of input consists of an integer N, representing the number of production runs that take place in a week.The second line consists of a float value A, representing the average run time in hours.The third line consists of a float value T, representing the total available hours per week for the machine.Output format :The first line of output prints "Total Production Hours/Week: X hours", where X is a float value representing the total production hours, rounded off to two decimal places.The second line prints "Productivity Percentage: Y%", where Y is a float value representing the productivity percentage of the machine, rounded off to two decimal places.Refer to the sample output for formatting specifications.Code constraints :In this scenario, the test cases fall under the following constraints:1 ≤ N ≤ 201.0 ≤ A ≤ 24.01.0 ≤ T ≤ 60.0Sample test cases :Input 1 :52.540.0Output 1 :Total Production Hours/Week: 12.50 hoursProductivity Percentage: 31.25%Input 2 :103.054.7Output 2 :Total Production Hours/Week: 30.00 hoursProductivity Percentage: 54

ABC company Ltd. is interested to computerize the pay calcuation of their employee in the form of Basic pay, Dearness Allowance (DA) and House Rent Allowance (HRA). DA and HRA are calculated as certain % of Basic pay (For example, DA is 80% of Basic pay, and HRA is 30% of Basic pay). They have the deduction in the salary as PF which is 12% of Basic pay. Propose a computerized solution for the above said problem.

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.