Perl Assignment #2 - Formatted Mutiplication!
#!/usr/bin/perl
print “\n”;
print “################################################\n”;
print “## ##\n”;
print “## Multiplication by ##\n”;
print “## By Brett Lee-Price ##\n”;
print “## ##\n”;
print “## The following should present an aligned ##\n”;
print “## Multiplication table. Well hopefully… ##\n”;
print “## ##\n”;
print “################################################\n”;
print “\n”;
print “\n”;
for ( $a = 1; $a < 13; $a++ ) #Initial Multiplication of * x Range 1-12.
{
for ( $b = 6; $b < 11; $b++ ) #Range of 6-10 to times against above range.
{
printf "| %2d * %2d=%3d ", $b, $a, $a*$b ; #Formatting
}
print "\n";
}
print "\n";
print "\n";
The PERL file is located here. Again, formatting looks shocking here.