programming language

An email address identifies an email box to which messages are delivered. Every emailaddress consists of 3 elements: local-part, @ symbol (pronounced as “at”), and domain
name. The local-part is placed before the @ symbol, and the domain name is placed
after the @ symbol. For example, in the email johndoe@company.com, “johndoe” is the
local-part, and “company.com” is the domain. Emails are invalid without these
elements. The local-part or username contains:
a. uppercase and lowercase Latin letters (A-Z, a-z);
b. numeric values (from 0 to 9);
c. special characters, such as # ! % $ ‘ & + * – / = ? ^ _`. { | } ~
i. The period character (.) is valid for the local-part unless it is placed at the
beginning or end of an email address. There also can’t be two or more
periods in a row
A domain name consists of one or more parts separated by a dot and can contain:
a. uppercase and lowercase Latin letters (A-Z, a-z);
b. numeric values (from 0 to 9);
c. a hyphen (-), on condition that it is not placed at the beginning or end of the
domain
1. (9 points) Create a regular expression, DFA, and Regular Grammar for the local-part
of the email address.
2. (9 points) Create a regular expression, DFA, and Regular Grammar for the domain of
the email address.
3. (2 points) Create a NFA for an email address.
Single-precision floating-point format (sometimes called FP32 or float32) is a computer number
format, usually occupying 32 bits in computer memory; it represents a wide dynamic range of
numeric values by using a floating radix point.
A floating-point variable can represent a wider range of numbers than a fixed-point variable of
the same bit width at the cost of precision. A signed 32-bit integer variable has a maximum
value of 231 − 1 = 2,147,483,647, whereas an IEEE 754 32-bit base-2 floating-point variable has
a maximum value of (2 − 2−23) × 2127 ≈ 3.4028235 × 1038. All integers with 7 or fewer decimal
digits, and any 2n for a whole number −149 ≤ n ≤ 127, can be converted exactly into an IEEE 754
single-precision floating-point value.
The representation of a signed real number includes an integer portion, a fractional portion,
and an exponent. Use floating-point constants to represent floating-point values that can’t be
changed. You can omit either the digits before the decimal point (the integer portion of the
value) or the digits after the decimal point (the fractional portion), but not both. You may leave
out the decimal point only if you include an exponent (e|E). No white-space characters can
separate the digits or characters of the constant. A floating-point constant without an f, F, l, or L
suffix has type double. If the letter f or F is the suffix, the constant has type float. If suffixed by
the letter l or L, it has type long double.
The following examples illustrate some forms of floating-point constants and expressions:
Copy
15.75L
1.575E1 /* = 15.75 */
1575e-2 /* = 15.75 */
-2.5e-3F /* = -0.0025 */
25E-4 /* = 0.0025 */
4. (15 points) Create a regular expression, DFA, and Regular Grammar for the floating
point constant.
5. (5 points) Analyze the above problem for the 4 language criteria.
An integer constant is a decimal (base 10), octal (base 8), or hexadecimal (base 16) number that
represents an integral value. Use integer constants to represent integer values that can’t be
changed. If an integer constant begins with 0x or 0X, it’s hexadecimal. If it begins with the digit
0, it’s octal. Otherwise, it’s assumed to be decimal.
No white-space characters can separate the digits of an integer constant. These examples show
some valid decimal, octal, and hexadecimal constants.
/* Decimal Constants */
int
dec_int = 28;
unsigned
dec_uint = 4000000024u;
long
dec_long = 2000000022l;
/* Octal Constants */
int
oct_int = 024;
unsigned
oct_uint = 04000000024u;
long
oct_long = 02000000022l;
/* Hexadecimal Constants */
int
hex_int = 0x2a;
__int64
hex_i64 = 0x4a44000000000020I64;
unsigned __int64 hex_ui64 = 0x8a44000000000040Ui64;
6. (15 points) Create a regular expression, DFA, and Regular Grammar for the integer
constant.
7. (5 points) Analyze the above problem for the 4 language criteria.
8. (10 points) Write code that that lets you know if a string is an email address or not.
Based on the definition from problem 1.
9. (15 points) Write code that that lets you know if a string is an floating point literal or
not. Based on the definition from problem 4.
10. (15 points) Write code that that lets you know if a string is an integer literal or not.
Based on the definition from problem 6.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER