a) Perform a DRY RUN on the algorithm below using the data provided. Lay out the results of the dry run in
TABLE FORMAT with a column for each variable.
Input A
C = 0
D = A
Repeat
Input B
If B > D
D = B
endif
C = C + 1
Until B = 0
Print D, B, C
DATA: 4, 6, 3, 7, 8, 5, 3, 9, 2, 0, 5, 1
The table headers should show each variable and the condition(s) being tested. Show the value of each
variable as it changes.
b) Describe the purpose of the program.
c) Would the final output be different if the first data input was changed to 7 instead of 4?
d) What would be the final value of D if the 9 in the list was replaced with 0?
Ivzirnalsradeys 0 Newbie Poster
JasonHippy 739 Practically a Master Poster
Ivzirnalsradeys 0 Newbie Poster
JasonHippy 739 Practically a Master Poster
Ahsan ilyas 0 Newbie Poster
tinstaafl 1,176 Posting Maven
aanyadsouza 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.