Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Regular Expressions The COBOL Programming Language has fallen out of favor, but,

ID: 3768304 • Letter: R

Question

Regular Expressions

The COBOL Programming Language has fallen out of favor, but, for a long time, it was the language used for business applications. COBOL has a very interesting identifier format. COBOL identifiers must start with a letter and then can be followed by a series of letters, numbers or dashes (minus sign). There is one restriction: dashes cannot appear next to each other. Create a regular expression for COBOL identifiers. Here are some examples: • First-Name • Tax-Amount • Average-Test-Score • Annoying-Homework • Aliens

Explanation / Answer

Net-Amt=Gross-amt + Basic-Salary

Total-Marks=Math-Marks+Science-Marks

Average-Test-Score=Total-Marks/3;