Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java debugging // This application reads student typing test data // including number of errors on the test, and the number // of words typed

Java debugging

// This application reads student typing test data // including number of errors on the test, and the number // of words typed per minute. Grades are assigned based // on the following table: // Errors // Speed 0 1 2 or more // 030 C D F // 3150 C C F // 5180 B C D // 81100 A B C // 101 and up A A B start Declarations num MAX_ERRORS = 2 num errors num wordsPerMinute num grades[5][3] = {"C", "D", "F"}, {"C", "C", "F"}, {"B", "C", "D"}, {"A", "B", "C"}, {"A", "A", "B"} num LIMITS = 5 num speedLimits[LIMITS] = 0, 31, 51, 81, 101 num row output "Enter number of errors on the test " input errors if errors > MAX_ERRORS then errors = 0 endif output "Enter the speed in words per minute " input speed row = 0 while row < LIMITS AND wordsPerMinute >= speedLimits[errors] row = row + 1 endwhile row = row - 1 output "Your grade is ", grades[wordsPerMinute][row] stop

output "Enter a number " input number return

detailLoop() numbers[count] = number output "Enter a 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_2

Step: 3

blur-text-image_3

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

Statistical And Scientific Database Management International Working Conference Ssdbm Rome Italy June 21 23 1988 Proceedings Lncs 339

Authors: Maurizio Rafanelli ,John C. Klensin ,Per Svensson

1st Edition

354050575X, 978-3540505754

More Books

Students also viewed these Databases questions