Course of Raku / Essentials / More about types / Associative data types / Exercises
Salary raise
Problem
Given a hash with the data of an employee:
my %employee =
full-name => 'Eliza Vents',
department => 'Sales',
salary => 3000;Increase the salary by 5 % and print it together with the employee’s
name. Make sure the %employee hash keeps correct values
after the raise.
Example
Here is the expected output of the program:
$ raku salary-raise.raku
New salary of Eliza Vents: 3150Solution
Course navigation
← Quiz — Interpolating hashes | Solution: Salary raise →
Translations of this page: English • Deutsch • Español • Italiano • Latviešu • Nederlands • Български • Русский • Українська