Ad Code

Responsive Advertisement

Uri - Beecrowd | 1048 | Salary Increase

beecrowd | 1048

Salary Increase

By Neilor Tonin, URI Brazil


The company ABC decided to give a salary increase to its employees, according to the following table:

Salary Increase uri 1048


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
Reajuste ganho: 60.00
Em percentual: 15 %

800.01

Novo salario: 880.01
Reajuste ganho: 80.00
Em percentual: 10 %

2000.00

Novo salario: 2140.00
Reajuste ganho: 140.00
Em percentual: 7 %

N.B.: It's better if you solve this by your own. Thank you!

  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;
}

Post a Comment

0 Comments

Ad Code

Responsive Advertisement