Problem

At the start of a program (written in pseudocode) the integer variable n is assigned the v...

At the start of a program (written in pseudocode) the integer variable n is assigned the value 7. Determine the value of n after each of the following successive statements is encountered during the execution of this program. [Here the value of n following the execution of the statement in part (a) becomes the value of n for the statement in part (b), and so on, through the statement in part (d). For positive integers a, b,a/b⌋ returns the integer part of the quotient—for example, ⌊6/2⌋ = 3, ⌊7/2⌋ = 3, ⌊2/5⌋ = 0, and ⌊8/3⌋ = 2.]

a) if n > 5 then n : = n + 2


b) if ((n + 2 = 8) or (n – 3 = 6)) then n : = 2* n + 1


c)if ((n – 3 = 16) and (⌊n/6⌋ = 1)) then n : = n + 3


d) if ((n ≠ 21) and (n -7 = 15) ) then n : = n – 4

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 2.1