Challenge: Adjusting Salary with a Bonus
Task
Swipe to start coding
Your company has decided to reward employees with a performance bonus of 250%. You need to update the salary calculator to include this bonus in the final salary calculation.
Extend the program by doing the following:
- Declare a new constant called
bonus
with a value of2.5
. - Before showing the output, multiply the value of
totalPay
withbonus
and store the result back intotalPay
. (Use the shorter syntax for this arithmetic operation).
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 2. ChapterΒ 10
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 1.33
Challenge: Adjusting Salary with a Bonus
Swipe to show menu
Task
Swipe to start coding
Your company has decided to reward employees with a performance bonus of 250%. You need to update the salary calculator to include this bonus in the final salary calculation.
Extend the program by doing the following:
- Declare a new constant called
bonus
with a value of2.5
. - Before showing the output, multiply the value of
totalPay
withbonus
and store the result back intotalPay
. (Use the shorter syntax for this arithmetic operation).
Solution
Everything was clear?
Thanks for your feedback!
Awesome!
Completion rate improved to 1.33SectionΒ 2. ChapterΒ 10
single