Sha256: fc1eb4dceef71d34fd0521fd08dadf2c59b78289b5d224c34e2252a270aea499

Contents?: true

Size: 369 Bytes

Versions: 165

Compression:

Stored size: 369 Bytes

Contents

unit module GradeSchool:ver<1>;

class Roster is export {
  has %!roster;

  method add-student (Str:D :$name!, Int:D :$grade!) {
    %!roster.append($grade, $name);
  }

  method list-grade (Int:D $grade --> Seq:D) {
    %!roster{$grade}.sort;
  }

  method list-all {
    my @list.append("Grade $_", %!roster{$_}.sort) for %!roster.keys.sort;
    return @list;
  }
}

Version data entries

165 entries across 165 versions & 1 rubygems

Version Path
trackler-2.2.1.28 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.27 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.26 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.25 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.24 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.23 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.22 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.21 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.20 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.19 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.18 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.17 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.16 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.15 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.14 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.13 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.12 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.11 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.10 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.9 tracks/perl6/exercises/grade-school/Example.pm6