Topic
Algorithm Modification
Instructions
Modify the following algorithm to include the repetition structure. Review the algorithm, identify the inaccuracies, insert the corrections, save the document.
walk forward 1 step,
walk forward 1 step,
if a flower is present, do this:
pick up the flower
end if
turn left 45 degrees
turn left 45 degrees
Study the algorithm below and then modify the algorithm to print the sales amount for all ten salespersons. Review the algorithm, identify the inaccuracies, insert the corrections, save the document.
repeat 5 times:
get the salesperson’s name and sales amount
calculate the bonus amount by multiplying the sales amount by 3%
print the salesperson’s name and bonus amount
end repeat
Answer preview
repeat (10 times)
get the salesperson’s name and sales amount
calculate the bonus amount by multiplying the sales amount by 3%
print the salesperson’s name, sales amount, and bonus amount
end repeat
Word count: 142