Problem Descriptions: The purpose of this assignment is to reinforce the lecture material on variable definition /usage
Posted: Thu Jul 14, 2022 2:13 pm
Problem Descriptions: The purpose of this assignment is to reinforce the lecture material on variable definition /usage and DU path. For each of the source code fragments below: 1) Construct a table listing all the line numbers where a variable is defined or used. You must list all the variables in each source code fragment. 2) Construct a DU Path table showing all paths from any definition to usage of every variable. A sample is given below: 1. Int nain() ( 2. Char operator; 3. double first Number, secondiamber; 4. print f( "Enten an operator (+,∗,+):"); 5. seanf(2×c′′+5 operator); 6. Printf("Enter two operands: ") : 7. Seanf(*)f xIf", a firsthumber, 8 secondevinber); B. If (operator: = " ∗ ) f 1e. Jelse if (operator =w∗+∗ ) ( 12. ) else 1f (operator *. "**) \{ 14. 3 else If ( operatar ==∗f∗) ) \{ 16. telse t 17. peintf("Errorl operaton is not correct"); 18. ? 19. return 9 ; 26. ] DEF-USE Table:
DU Path Table:
DU Path Table: