URI Online Judge | 1009 Salary with Bonus (Solution)

Problem Link:
https://www.urionlinejudge.com.br/judge/en/problems/view/1009

URI Online Judge | 1009

Salary with Bonus

Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
You have to calculate the final salary for your employee, based on value sold by him. So you have to read his name, his fixed salary and the value sold by him. Your functionary wins 15% over all products sold. Write the final (total) salary of this functionary, rounded to two decimal places.
- Don’t forget to print end line after the result otherwise you will get “Presentation Error”.
- Don’t forget the blank spaces.

Input

The input file contains an string (employee first name), and two double values, that are the salary of this employee and the total value sold by him.

Output

Print the total salary of the employee, according to the given example.
Sample InputsSample Outputs
JOAO
500.00
1230.30
TOTAL = R$ 684.54
PEDRO
700.00
0.00
TOTAL = R$ 700.00
MANGOJATA
1700.00
1230.50
TOTAL = R$ 1884.58
Solution:
#include <stdio.h>
  
int main() {
  
char employee;
double salary,sold,total;
scanf("%s %lf %lf",&employee,&salary,&sold);
total=salary+(sold*15)/100;
printf("TOTAL = R$ %.2f\n",total);
  
    return 0;
}

Comments

Popular posts from this blog

URI Online Judge | 1036 Bhaskara's Formula (Solution)

URI Online Judge | 1043 Triangle (Solution)

URI Online Judge | 1042 Simple Sort (Solution)