hello i am a perl beginner and i need help. i dont know and
have no
idea on how to make a program for this,
the program should ask a user 5 questions. it should read
the answers
and shows the number of answers that were right.
example:
Please enter £ two times: ££
Correct!
Please enter $ four times: ***
Wrong!
*****
You got 4 correct answers.
I have already written a program for the 5 questions:
e.g.
print ("Please enter £ two times: ");
$pound = <STDIN>;
$correct = "Correct!";
if ($pound !~m/££/)
{
print("Wrong!n");
}
else
{
print("$correctn");
}
print("Please enter $ four times: ");
$dollar = <STDIN>;
if($dollar !~m/^($)$/)
(
print("Wrong!n");
}
else
{
print("$correctn");
}
my problem is i dont know on how it will read the answers
and shows the
number of answers that were right. i would really appreciate
any help.
thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Perl Programming" group.
To post to this group, send email to perl-programming googlegroups.com
To unsubscribe from this group, send email to
perl-programming-unsubscribe googlegroups.com
For more options, visit this group at
http://groups-beta.google.com/group/perl-programming
-~----------~----~----~----~------~----~------~--~---
|