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, 4 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
Need help with these three questions please help, Ive done the other 3 associated with this but I just cant figure these out.Â
Â
Â
1.
The code below contains the While ... Do looping structure. Rewrite the code by
converting the While.. Do looping structure to the Do .. until looping structure.
BEGIN
Declare Integer x = 1
Declare integer sum = 0
While ( x <= 5 )
Set sum = sum + x
Set x = x+ 2
End While
END
2. The code below contains the Do .. Until looping structure. Rewrite the code by
converting the Do ... until looping structure into while .. Do looping structure.
BEGIN
Declare Integer x = 1
Declare real sum = 0.0
x = 10
Do
Set sum = sum + x Set x = x - 3
until ( x >= 5 )
END 3. Give the following ​pseudocode​, determine the output.
BEGIN
Declare Integer ​intx​ = 1
Declare Integer ​inty​ = 1
While ( intx <= 5 )
Set inty = 1
While (inty <= 3 )
Display "Intx = ", intx, " while inty = ", inty
Set inty = inty + 3
End While
Set intx = intx + 2
End While END