Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

help

Name: Anonymous 2011-04-04 7:42

print "please enter the retail price ";
$retailPrice=<STDIN>;
print "Please enter the transaction code ";
$transCode=<STDIN>;
chomp $transCode;
print "Please enter employee number ";
$empNum=<STDIN>;
if ($transCode eq "S")
{
$comm=$retailPrice*.05
}
else
{
if ($transCode eq "M")
{
$comm=$retailPrice*.07
}
else
{
if (transCode eq "L")
{
$comm=$retailPrice*.10
} #end if ($transCode eq "M")
} #end if ($transCode eq "M")
} #end if ($transCode eq "S")
print "Retail price is ". $retailPrice;
print "Commision is ". $comm;
print "Employee number is ". $empNum;

Name: Anonymous 2011-04-04 22:02

It was not a client it was my teacher, she knows there is a better way and asked us to concentrait on writting the script this way as we had only just started using perl the pervious week. The 2 weeks before that we were learning about diffrent types of logic and the diffrence between programing and maths

Umm im a student not a code monkey.

Use strict; makes it fail on almost every line and i really have no idea why. I'm going to try and figure that one out soon. I'll try and find the faq that im pretty sure i should've read before posting.

WTF Is forced indenting anyway?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List