Welcome

>>>Welcome to my "CODE BAZAR"
Code marshal
URI online judge
Others
Code marshal
URI online judge
Others
Code marshal
URI online judge
Others

Update ✔✔✔ Upcoming programming book (.pdf) "Programming Contest (data structures and algorithms) by Md. Mahbub Hasan & "Graph Algorithms" by Safayat Asraf "****** Date: 20 March, 2019****Hazrat Ali****

Thursday 10 November 2016

URI-1009

URI Online Judge | 1009

Salary with Bonus

Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Problem link Click here
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.
Input SamplesOutput Samples
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;
}

No comments:

Post a Comment