URI - BEECROWD - BEE Online Judge Solution 1048-Salary Increase | URI - BEECROWD - BEE 1048 Solution in C,C++,Python
The company ABC decided to give a salary increase to its employees, according to the following table:
Salary | Readjustment Rate |
0 - 400.00 | 15% |
Read the employee's salary, calculate and print the new employee's salary, as well the money earned and the increase percentual obtained by the employee, with corresponding messages in Portuguese, as the below example.
Input
The input contains only a floating-point number, with 2 digits after the decimal point.
Output
Print 3 messages followed by the corresponding numbers (see example) informing the new salary, the among of money earned and the percentual obtained by the employee. Note:
Novo salario: means "New Salary"
Reajuste ganho: means "Money earned"
Em percentual: means "In percentage"
Input Sample | Output Sample |
400.00 | Novo salario: 460.00 |
800.01 | Novo salario: 880.01 |
2000.00 | Novo salario: 2140.00 |
URI Online Judge Solution 1048-Salary Increase | URI 1048 Solution in C,C++,Python:
It's a simple problem.You just have to count the total salary,and the benefit he can make.Then you have to print those values according to the problem's statement.
#include<stdio.h>
int main()
{
float s;
scanf("%f",&s);
if(s>0 && s<=400.0)
printf("Novo salario: %.2f\nReajuste ganho: %.2f\nEm percentual: 15 %%\n",(s+(s*.15)),(s*.15));
else if(s<=800.0)
printf("Novo salario: %.2f\nReajuste ganho: %.2f\nEm percentual: 12 %%\n",(s+(s*.12)),(s*.12));
else if(s<=1200.0)
printf("Novo salario: %.2f\nReajuste ganho: %.2f\nEm percentual: 10 %%\n",(s+(s*.10)),(s*.10));
else if(s<=2000.0)
printf("Novo salario: %.2f\nReajuste ganho: %.2f\nEm percentual: 7 %%\n",(s+(s*.07)),(s*.07));
else
printf("Novo salario: %.2f\nReajuste ganho: %.2f\nEm percentual: 4 %%\n",(s+(s*.04)),(s*.04));
return 0;
}
0 Response to URI - BEECROWD - BEE 1048 Solution in C,C++,Python | URI - BEECROWD - BEE 1048
Post a Comment