Skip to content

Instantly share code, notes, and snippets.

@zoffixznet

zoffixznet/p6.p6 Secret

Last active April 1, 2018 09:34
Show Gist options
  • Save zoffixznet/6bab930e2d91481908d0966294d9fe35 to your computer and use it in GitHub Desktop.
Save zoffixznet/6bab930e2d91481908d0966294d9fe35 to your computer and use it in GitHub Desktop.
class grafik-batang {
has Int @.nilai-batang;
method plot {
say @.nilai-batang;
}
}
class grafik-garis {
has Int @.nilai-garis;
method plot {
say @.nilai-garis;
}
}
class grafik-gabungan is grafik-batang is grafik-garis {
method new {
my $o := self.bless: |%_;
$o.grafik-garis::BUILDALL: Empty, %_;
$o
}
method plot {
say @.nilai-batang;
say @.nilai-garis;
}
}
my $penjualan-aktual = grafik-batang.new(nilai-batang => [10,9,11,8,7,10]);
my $perkiraan-penjualan = grafik-garis.new(nilai-garis => [9,8,10,7,6,9]);
my $aktual-vs-perkiraan = grafik-gabungan.new(
nilai-batang => [10,9,11,8,7,10],
nilai-garis => [9,8,10,7,6,9],
);
say "Penjualan aktual:";
$penjualan-aktual.plot;
say "Perkiraan penjualan:";
$perkiraan-penjualan.plot;
say "Aktual vs Perkiraan:";
$aktual-vs-perkiraan.plot;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment