Please check to see if I have atleast two loops, and atleast two decision points
ID: 3626480 • Letter: P
Question
Please check to see if I have atleast two loops, and atleast two decision points in my psuedocode, I really
need a peer review on these psuedocodes which I wrote myself and I am just a lil unsure about some of it.
Start
wake up
while incoherent
turn on radio
endwhile
if you smell bad then
take shower
else
get dressed
endif
if you put on deodorant then
decide to go to work
else
apply deodorant
endif
if you want to work then
get in car
else
call in sick
endif
if car broke then
call taxi
endwhile
stop
Start
get home
while you are tired
turn on tv
endwhile
if you are hungry then
eat food
else
drink glass of wine
endif
if you did exercise then
do exercise
endif
if you need a shower then
take shower
else
drink glass of wine
endif
if you have work tomorrow then
go to bed
endwhile
stop
Explanation / Answer
"Please check to see if I have atleast two loops, and atleast two decision points in my psuedocode."
Ok, sure.
Start
wake up
while incoherent loop 1
turn on radio
endwhile
if you smell bad then decision point 1
take shower
else
get dressed
endif
if you put on deodorant then this is valid syntax, but doesn't really make sense
decide to go to work
else
apply deodorant
endif
if you want to work then decision point 2
get in car
else
call in sick
endif
if car broke then
call taxi
endif
stop
Start
get home
while you are tired loop 2
turn on watch tv don't turn on the tv while you are tired, that doesn't make sense
endwhile
if you are hungry then
eat food
else
drink glass of wine
endif
if you didn't exercise then
do exercise
endif
if you need a shower then
take shower
else
drink glass of wine
endif
if you have work tomorrow then
go to bed
endif
stop