Cursus Raku / Elementa / Fundamenta ordinis exsecutionis / Conditiones comprobationes / if sectiones

Quiz: if

Complete the following programs.

1

This program has to check if the age is 21 years or more.

.my $age = 24;
>= {si $age ␣␣ 21 ␣Both >= and can be used here.
.    dic 'Possumus id tibi vendere.';
}

2

In this program, you have to check if $x is between 10 and 15 (exclusive).

.my $x = 12.3;
< <si 10 ␣ $x ␣ 15 {
.    dic 'Valor $x acceptabilis est.';
.}

if sectiones   |   else sectiones