#C11040. Calculate Annual Bonus
Calculate Annual Bonus
Calculate Annual Bonus
You are given an employee's annual salary and a performance rating. Your task is to calculate the bonus based on the following formula:
\( Bonus = Salary \times r \)
where the ratio \( r \) is determined by the performance rating as follows:
- excellent: \( r = 0.20 \)
- good: \( r = 0.10 \)
- average: \( r = 0.05 \)
- Otherwise, \( Bonus = 0 \)
Read the salary and the rating from the standard input and output the calculated bonus to the standard output.
inputFormat
The input consists of two items provided via stdin: an integer representing the annual salary (guaranteed to be positive), and a string representing the performance rating. These will be separated by whitespace.
outputFormat
Output a single integer which is the calculated bonus based on the given salary and performance rating.## sample
50000 excellent
10000