-
-
Save zoffixznet/6bab930e2d91481908d0966294d9fe35 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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