Question: Please read these instructions thoroughly, I will not tolerate any exception. (1) Submit a soft copy of your source code. (2) Submit your homework by

 Please read these instructions thoroughly, I will not tolerate any exception.(1) Submit a soft copy of your source code. (2) Submit yourhomework by replying to the message: 439-Proj2-F20. (3) Work individually, any sign

Please read these instructions thoroughly, I will not tolerate any exception. (1) Submit a soft copy of your source code. (2) Submit your homework by replying to the message: 439-Proj2-F20. (3) Work individually, any sign of cheating will bear a heavy penalty. (4) Your program will be examined with a random file. Given the grammar defined by the following Extended BNF set of production rules : program body s body lib-decl main() declarations block lib-decl( #include ; )* declarations const-decl var-decl const-dec ( const data-type name = value ; )* var-decl (var data-type name-list ; )* name-list name (, name )* data-type int float name "user-defined-name" = declarations const-decl var-decl const-decl +(const data-type name = value ; )* var-dec ( var data-type name-list ; )* name-list name (, name )* data-type int float name user-defined-name" block + { stmt-list } stmt-list statement ( statement )* statement ass-stmt | inout-stmt if-stmt | while-stmt block 2 ass-stmt name exp exp term ( add-oper term )* term factor ( mul-oper factor )* factor ( exp) | name I value value "float-number" | "int-number" add-sign + mul-sign * ||| % inout-stmt input >> | output name-value if-stmt if ( bool-exp) statement else-part endif else-part else statement 2 while-stmt while ( bool-exp) { stmt-list } bool-expname-value relational-oper name-vaue name-value name value name A sample program in this language: #include; #include; main() const float bi=3.14; var int num.count, var float x; {input>>num; if (num !=0) x=bi*2 else x=x*3 endif; output>>x; } $ Please read these instructions thoroughly, I will not tolerate any exception. (1) Submit a soft copy of your source code. (2) Submit your homework by replying to the message: 439-Proj2-F20. (3) Work individually, any sign of cheating will bear a heavy penalty. (4) Your program will be examined with a random file. Given the grammar defined by the following Extended BNF set of production rules : program body s body lib-decl main() declarations block lib-decl( #include ; )* declarations const-decl var-decl const-dec ( const data-type name = value ; )* var-decl (var data-type name-list ; )* name-list name (, name )* data-type int float name "user-defined-name" = declarations const-decl var-decl const-decl +(const data-type name = value ; )* var-dec ( var data-type name-list ; )* name-list name (, name )* data-type int float name user-defined-name" block + { stmt-list } stmt-list statement ( statement )* statement ass-stmt | inout-stmt if-stmt | while-stmt block 2 ass-stmt name exp exp term ( add-oper term )* term factor ( mul-oper factor )* factor ( exp) | name I value value "float-number" | "int-number" add-sign + mul-sign * ||| % inout-stmt input >> | output name-value if-stmt if ( bool-exp) statement else-part endif else-part else statement 2 while-stmt while ( bool-exp) { stmt-list } bool-expname-value relational-oper name-vaue name-value name value name A sample program in this language: #include; #include; main() const float bi=3.14; var int num.count, var float x; {input>>num; if (num !=0) x=bi*2 else x=x*3 endif; output>>x; } $

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!