
Salary Increase
By Neilor Tonin, URI Brazil
The company ABC decided to give a salary increase to its employees, according to the following table:
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 - BEECROWD Online Judge 1048 Solve in C:
//Solved by Intesar#include <stdio.h>
int main() {
float salary; scanf("%f",&salary);
if(salary > 0 && salary <= 400) printf("Novo salario: %.2f\nReajuste ganho: %.2f\nEm percentual: 15 %%\n",(salary+(salary*15/100)),(salary*15/100)); else if(salary <= 800) printf("Novo salario: %.2f\nReajuste ganho: %.2f\nEm percentual: 12 %%\n",(salary+(salary*12/100)),(salary*12/100)); else if(salary <= 1200) printf("Novo salario: %.2f\nReajuste ganho: %.2f\nEm percentual: 10 %%\n",(salary+(salary*10/100)),(salary*10/100)); else if(salary <= 2000) printf("Novo salario: %.2f\nReajuste ganho: %.2f\nEm percentual: 7 %%\n",(salary+(salary*7/100)),(salary*7/100)); else printf("Novo salario: %.2f\nReajuste ganho: %.2f\nEm percentual: 4 %%\n",(salary+(salary*4/100)),(salary*4/100));
return 0;}
0 Comments