Organ Programming Langs

User Generated

N360

Programming

Description

Please make sure everything is correct, Don't copy the question from the website ,on-time work, word file

Unformatted Attachment Preview

Assignment 7 First Name: Last Name: SIN: Grade: Each question has 10 points Q1. Describe three situations where a combined counting and logical looping statement is needed Answer Q1 - Q2. Rewrite the following pseudo code segment using a loop structure in the specified languages: k = (j + 13) / 27 loop: if k > 10 then goto out k=k+1 i=3*k-1 goto loop out: . . . a. Fortran 95 b. Ada c. C, C++, Java, or C# Assume all variables are integer type. Discuss which language, for this code, has the best writ ability, the best readability, and the best combination of the two. Answer Q2. Q3: Describe a situation in which the add operator in a programming language would not be associative Answer Q 3: Q4: Assume the following rules of associativity and precedence for expressions: Precedence Highest Lowest *, /, not +, –, &, mod – (unary) =, /=, < , =, > and or, xor Associativity Left to right Show the order of evaluation of the following expressions by parenthesizing all sub expressions and placing a superscript on the right parenthesis to indicate order. For example, for the expression a + b * c + d the order of evaluation would be represented as ((a + (b * c)1 )2 + d)3 You show it for a * b - 1 + c Answer Q4. Q 5: Write a BNF description of the precedence and associativity rules defined for the expressions in Problem 4. Assume the only operands are the names a, b, c, d, and e. Answer 5 . Q6. Using the grammar of Problem 5, draw parse trees for the expressions of Problem 4. Answer Q 6.
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

kindly...

Related Tags