Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl6
- use v6;
- class TemperatureConversion {
- has $.total is rw;
- has $.cel is rw;
- has $.fah is rw;
- has $.kel is rw;
- has $.ran is rw;
- method CelToFah {
- say "Celcius to Fahrenheit";
- $.cel = prompt "Insert value: ";
- $.total = $.cel * 9/5 + 32;
- printf "Total temperature is: %.2f\n", $.total
- }
- }
- my $test = TemperatureConversion.new();
- $test.CelToFah();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement