Course of Raku / Essentials / 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: 3150

Solution

See the solution

Next exercise

💪 Seen before?

Course navigation

Positional data types / Subscripting ranges   |   Creating and calling functions