Algorithm 1:
Review the below algorithm, identify the inaccuracies, and insert the corrections:
Modify the following algorithm to include the repetition structure. Review the algorithm, identify the inaccuracies, insert the corrections, save the document, and submit the document for grading.
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
Algorithm 2:
Review the below algorithm, identify the inaccuracies, and insert the corrections:
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, and submit the document for grading.
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
Writing an Algorithm:
Your next step will be to write an algorithm that includes the three control structures (sequence, selection, and repetition). First, explain the purpose of the algorithm by providing a brief description for the task being performed. Then, list the details of the algorithm. Remember to include all three control structures (sequence, selection, and repetition).
Select ONE of the following tasks as the basis for completing your algorithm:
· Changing a television channel by using a remote control
· Using a sponge to wash a car
· Walking up a set of stairs
2