Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Below you will see psuedocode, please debug the code (find the errors) and make the correct changes to psuedocode. // This application reads 10 numbers

Below you will see psuedocode, please debug the code (find the errors) and make the correct changes to psuedocode.

// This application reads 10 numbers and sorts them, // then displays the three highest numbers

start Declarations num SIZE = 10 num number num numbers[SIZE] num count = 0 getReady() while count <= SIZE detailLoop() endwhile finish() stop

getReady() output "Enter a number " input number return

detailLoop() numbers[count] = number output "Enter a number " input 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 while x < COMPS if numbers[x] < numbers[x] then swap() endif x = x + 1 endwhile y = y + 1 endwhile return

swap() num temp temp = numbers[x + 1] numbers[x + 1] = numbers[x] numbers[x] = 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

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions

Question

Prepare a constructive performance appraisal.

Answered: 1 week ago

Question

List the advantages of correct report formatting.

Answered: 1 week ago