Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Every line of pseudo code can be tricky. Do not remove the questions or text from the Template. Mark any additions to the pseudocode by

Every line of pseudo code can be tricky. Do not remove the questions or text from the Template. Mark any additions to the pseudocode by adding lines and showing them in red. Strikeout any deletions using the strikeout tool. Assume that the pseudocode below for each question is a separate working program in your organization and that it needs modifications as described in the comments (lines that begin with two slashes)at the beginning of the code. Your job is to alter the pseudocode to meet the new specifications as noted above. Please follow directions as specified in the homework assignment instructions file. NOTE: If a function has no changes to be made to it,then it will be in blue font.
-----------------------------------------------------------------------------------------
Find the Bugs
// This application reads 10 numbers and sorts them, then displays the
// three highest numbers
start
// Declarations
num SIZE =3
num number
num numbers[SIZE]
num count =0
getReady()
while count <= SIZE
detailLoop()
end
finish()
stop
getReady()
output "Enter a number
output number
return
detailLoop()
numbers[count]= number
count = count -1
output "Enter a number
output number
return
finish()
sort()
output "The highest three are ", numbers[1], numbers[2], numbers[3]
return
sort()
num x =0
num y =0
num COMPS = count +1
while y <= COMPS
x =0
while x <= COMPS
if numbers[x]< numbers[x -1] then
swap()
endif
x = x +1
endwhile
y = y +1
end
return
swap()
num temp
temp = numbers[x]
numbers[x]= numbers[x +1]
numbers[x +1]= temp
return

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

Summarize the findings of psychotherapy efficacy studies.

Answered: 1 week ago