Table of Contents

Salary with Bonus

Adapted by Neilor Tonin, URI  Brazil | Timelimit: 1

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 name[10];
double a,b,s=0.0;
scanf("%s",name);
scanf("%lf",&a);
scanf("%lf",&b);
b=(b*15)/100;
s=a+b;
printf("TOTAL = R$ %.2lf\n",s);

    return 0;
}
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on pinterest
Pinterest
Share on whatsapp
WhatsApp
Share on email
Email
Md. Nurnobi Hosen
Md. Nurnobi Hosen

Student of Computer Science and Engineering at Daffodil International University,Main Campus ,Dhanmondi.
Web and App Developer also expart of wordpress customization

All Blog Posts »
Subscribe
Notify of
guest
2 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
oprol evorter
oprol evorter
December 6, 2019 1:13 AM

Do you have a spam problem on this blog; I also am a blogger, and I was wanting to know your situation; many of us have created some nice practices and we are looking to trade strategies with others, why not shoot me an e-mail if interested.

oprolevorter
oprolevorter
December 11, 2019 3:53 AM

I’ll right away grab your rss as I can’t find your e-mail subscription link or e-newsletter service. Do you’ve any? Kindly let me know in order that I could subscribe. Thanks.

2
0
Would love your thoughts, please comment.x
()
x