URI ONLINE JUDGE SOLUTION - 1009 Salary with Bonus

Problem:


Make a program that reads a seller's name, his/her fixed salary and the sale's total made by himself/herself in the month (in money). Considering that this seller receives 15% over all products sold, write the final salary (total) of this seller at the end of the month , with two decimal places.
- Don’t forget to print the line's end after the result, otherwise you will receive “Presentation Error”.
- Don’t forget the blank spaces.

Input

The input file contains a text (employee's first name), and two double precision values, that are the seller's salary and the total value sold by him/her.

Output


Print the seller's total salary, according to the given example.

sample input output

Solution:

#include<stdio.h>
int main()
{
    char name[50];
    double a,b,total;
    gets(name);
    scanf("%lf%lf",&a,&b);
    total=b*0.15+a;
    printf("TOTAL = R$ %0.2lf\n",total);
    return 0;
}

Comments

Popular posts from this blog

URI ONLINE JUDGE SOLUTION 1021 - Banknotes and Coins

URI ONLINE JUDGE SOLUTION 1040 - Average 3

URI ONLINE JUDGE SOLUTION 1036 - Bhaskara's Formula