Be sure to notice that the supplied program already handles


This involves completing the C program formatter written in Java contained in the module 1 case study. That program terminates when it encountersif,for,while, ordostatements. It must be modified to include the code to format the following statements in the fashion shown below:

if_statement ::= if (expression) statement [else statement]for_statement ::= for ([expression]; [expression]; [expression]) statementwhile_statement ::= while (expression) statementdo_statement ::= do statement while (expression);

Be sure to notice that the supplied program already handles compound statements, which are delimited by braces, so the code that you add should not treat compound statements as a special case.

You should only have to make changes to the Format class. You will need to add four new methods to that class, one for each of the additional statements that requires formatting. In addition, you must modify the method statement so that it will call those four methods when a statement begins with the appropriate keyword.

None of the other classes should require modification.

 

Solution Preview :

Prepared by a verified Expert
Software Engineering: Be sure to notice that the supplied program already handles
Reference No:- TGS0666944

Now Priced at $40 (50% Discount)

Recommended (92%)

Rated (4.4/5)