CST1620 C# / C++
Programming
Lab Week 11
Notes |
Regular expressions can
simplify extracting data from a string if used properly. Regular Expression Library. Regular Expression online tester. |
Exercises |
Exercise 16.10
Phone Parse (10 points) Write a program that accepts a 10 digit phone number. 3 digits for the area code, 3 digits for the exchange, and 4 digits for the local. Parse the phone number in such a way that the user has flexibility for entering the number in many of the common forms in use today. Examples: Hint: Write a main Windows GUI program (Ex16_10) to test your parsing.
Result (Save to
your local machine and run) |
Exercise 16.6
Number String (10 points) Write a program which allows input of the form:
can be handled. Assume that the user will make no error in entering the string of numbers and operators. The operators are limited to be only addition and subtraction. Hint: The patter of such input is an initial number, followed by any number of operator/number pairs. Your program should handle the initial number, then loop to handle the following pairs of operators and numbers. Write a main Windows GUI program (Ex16_6) to produce the result.
Result (Save to
your local machine and run) |
Exercise 15.3 Poker
Hand EC (Extra Credit 20 points) Modify the program in Figure 15.18 of the C# How to Program textbook (Deitel ) so that the card dealing method deals a five card poker hand. Then write the following additional methods:
Write a main Windows GUI program (Ex15_3) to
test your hands. |