联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> Java编程Java编程

日期:2019-03-06 09:31

CSE-3342 Programming Languages: Perl

Assignment_5: Guess using Regular Expressions

100 pts

Due Date: 05 March, Tuesday, 2019


Write a program called guess (guess.pl) using regular expressions that try to guess what you entered. You may use your own choice of method(s) based on your approach (optional). The skeleton of the program is straight forward which is as follows:

It consists of an infinite loop that iterates until the last function is called.

If the user enters quit, then the program will exit otherwise your program applies several regular expressions to the user’s input to try to determine entered data.

If the input does not match any of the regular expressions, then program display a message indicating that “no match was found.”    

Regular expressions should match input data which are listed below:

first name and last name: John Quincy Adams

The regular expression should determine the input data is male or female:

The regular expression should check the input data is street address: 5454 Amesbury Dr

The regular expression matches the city, state and zip code: Dallas, TX 75206

The regular expression should match the email address

The regular expression should match the phone number

The regular expression for currency

The regular expression for Monetary Input: $55.00 or $0.75, etc

The regular expression for debit or credit card number

The regular expression for date

The regular expression for time  

The regular expression for URL

The regular expression for IP Address


You should follow the naming convention that is used for Perl programming. Program should include comments that explain each block of code or important statement.


Turn in to Canvas

1)Write the program in Perl, execute your program, capture output and submit a pdf file to Canvas

2)Execute all possible test cases and document your results in pdf against each regular expression for example, your regular expression should cover all possible date format or time format: 12 hr or 24 hr am, pm etc. same for different cards.  

3)Submit: guess.pl file to Canvas

We will discuss this and few other assignments in this lecture session

References

[1] Wikipedia, IP address [available online] https://en.wikipedia.org/wiki/IP_address [accessed 09/24/2018]

[2] Wikipedia, Calendar date [available online] https://en.wikipedia.org/wiki/Calendar_date [accessed 09/24/2018].

[3] Wikipedia, payment card number [available online] https://en.wikipedia.org/wiki/Payment_card_number [accessed 09/24/2018].


版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp