The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Chapter 5: "Looping (Part 1)"
Design the logic by drawing a flowchart and writing pseudocode for a program that outputs every number from 1 through 20.
Chapter 5: "Looping (Part 2)"
Examine the pseudocode that follows the introductory comments, then find and correct all the bugs. Correct all bugs in the file and be sure to clearly highlight the corrections.
1. Debugging
This program should display every fifth year starting with 2015, e.g., 2015, 2020, 2025, and so on for 30 years.
_____________________________________________________________________________________
start
Declarations
num year
num START_YEAR = 2015
num FACTOR = 5
num END_YEAR = 30
year = START_YEAR
while year <= END_YEAR
output year
endwhile
stop
2. Debugging
This program displays every combination of three-digits.
_____________________________________________________________________________________
start
Declarations
num digit1 = 0
num digit2 = 0
num digit3 = 0
while digit1 <= 9
while digit2 <= 9
while digit3 <= 9
output digit1, digit2, digit3
digit1 = digit1 + 1
endwhile
digit2 = digit2 + 1
endwhile
digit3 = digit3 + 1
endwhile
stop