Discuss Simple Integer Average in the Perl Programming forum on Dev Shed. Simple Integer Average Perl Programming forum discussing coding in Perl, utilizing Perl modules, and other Perl-related topics. Perl, the Practical Extraction and Reporting Language, is the choice for many for parsing textual information.
write a pearl script with a "quit" loop . On each line of input,the user may
enter 1 or 2 integer tokens which may be signed. Compute the average of
integers from the correctly entered lines. Use the same input rules as
problem #1. Present the average on the screen .. if there is one to be
Dont worry about the number of digits displayed in the averaqge.
Hint:can use perl function defined().
a) it will allow lines to be entered until the user enters "quit"
If user enters an empty line ,simply repromt with no error message.
c)If the user enters an invalid line reprompt after giving error msg.
d)Valid lines will have the one or two tokens described and may have any
amount of whitespace before/between/after the two tokens.
e) After the user quits out of the loop, present all of the valid first
tokens from valid lines (one per line), then all of the valid second tokens
from the valid lines (one per line), and the number of valid lines.
Time spent in forums: 4 Months 2 Weeks 1 Day 23 h 1 m 25 sec
Reputation Power: 6443
OK, this is homework, and you couldn't be bothered to tell us where you think the problem is, or how you'd like to go about solving it ... c'mon, you would have had a better chance getting help if you made an effort ...
The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones
09 F9 11 02
9D 74 E3 5B
D8 41 56 C5
63 56 88 C0
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems. -- Jamie Zawinski
Detavil - the devil is in the detail, allegedly, and I use the term advisedly, allegedly ... oh, no, wait I did ... BIT COINS ANYONE