Perl

Menu

In-Class Assignment #3

This assignment will test your understanding of basic regular expressions as discussed in today's class.

Repeatedly prompt the user for a line of input. For every input the user gives you, decide if the input contains:

  1. A phone number, including area code, with an optional "1-" prefix (518-276-6000 or 1-518-276-6566)
  2. An RCS id (up to six letters, possibly followed by some digits)
  3. A floating point number (a decimal, followed by one or more digits, possibly with a whole number before it. Ex: .05, 229.3, 0.81)

The program should be ended when the user enters 'done'

Sample Input and Output

Please enter a string:
lallip - 1-518-276-8392
Phone number
RCS Id
871.3
Floating point number
981
518-276-0001, hongj32, 98
Phone number
RCS Id
wun1 Station: 93.1
RCS Id
Floating point number
done, okay?
RCS Id
done

Submission

Your program must run on rcs-sun4.rpi.edu using Perl 5.8. When you are ready to submit, execute the program ~lallip/public/ic_submit.pl and follow the prompts.

This program must be submitted by 6:00pm today, Wednesday September 21

Perl Quotes
Perl Quotes