Challenge: Adjusting Salary with a Bonus
Opgave
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).
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 2. Kapitel 10