Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- De-bug exercise
- The following pseudocode has ONLY ONE error. Find the error, and suggest how to re-write it so that the program displays the correct output. 2.5 points for correctly identifying the error and explaining why; 2.5 points for correctly revising (total of 5 points).
- .
- // This program is supposed to display every fifth year
- // starting with 2015; that is, 2015, 2020, 2025,
- // and so on, for 30 years.
- start
- Declarations
- num year
- num START_YEAR = 2000
- num FACTOR = 4
- num END_YEAR = START_YEAR + 30
- year = START_YEAR
- while year < END_YEAR
- output year
- year = START_YEAR
- endwhile
- stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement