Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PREPARATION Be sure you've developed a BNF grammar that describes the language of phone numbers according to the Practice BNF item. Let's call this the

image text in transcribed
PREPARATION Be sure you've developed a BNF grammar that describes the language of phone numbers according to the Practice BNF item. Let's call this the US phone number grammar One variation in how we write down US phone numbers is that we sometimes leave off the parentheses around the area code and instead use a dash after it: 757-555-0000 for example Many businesses have adopted the practice of using (period) instead of (dash) between the number groups 757.555.0000 for example. By convention, international telephone numbers begin with a plus sign (+) followed by a 1, 2, or 3-digit country code The US country code is "1 So the example US phone number would be written as 1757.555.0000 in this international 1. (5 pts) Write down a BNF grammar for US phone numbers that use the dash ater the area code instead of parentheses around i 2. (5 pts) Write down a BNF grammar for US phone number witten in the international style (that is, the one from the Practice BNF item). Your program should output that string,followed by YES i the string is acceptable and ows the user to input a character string from the keyboard, and tell the user if that string complies with the US phone number grammar s not So, an output from this program could (757) 555-1234 YES 4. (5 pts) Your program must give the correct (Yes/No) answer when presented with the following phone numbers 757-555-0025 (757)555-1234 75-555-0000 757.555.1234 757-043-1234 057-555-1234 057-MH5-1234 842 PM

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions

Question

2. List your top 10 film villains.

Answered: 1 week ago