[URI Online Judge] – 1048 – Salary Increase

The enterprise ABC had decided to give a salary increase to his employees, according de following table:

Read de employee salary, calculate and print the new employee 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”

Sample Input Sample Output
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 %

Solution:

#include <cstdio>
int main(){
 float n;
 scanf("%f", &n);
 if (n <= 400.0)
 printf("Novo salario: %.2f\nReajuste ganho: %.2f\nEm percentual: 15 %%\n", n * 1.15, n * 1.15 - n);
 else if (n <= 800.0)
 printf("Novo salario: %.2f\nReajuste ganho: %.2f\nEm percentual: 12 %%\n", n * 1.12, n * 1.12 - n);
 else if (n <= 1200.0)
 printf("Novo salario: %.2f\nReajuste ganho: %.2f\nEm percentual: 10 %%\n", n * 1.10, n * 1.10 - n);
 else if (n <= 2000.0)
 printf("Novo salario: %.2f\nReajuste ganho: %.2f\nEm percentual: 7 %%\n", n * 1.07, n * 1.07 - n);
 else
 printf("Novo salario: %.2f\nReajuste ganho: %.2f\nEm percentual: 4 %%\n", n * 1.04, n * 1.04 - n);
 return 0;
}
Advertisements

One thought on “[URI Online Judge] – 1048 – Salary Increase

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s