Chapter 8 Exercise 1. Design an application that accepts 10 numbers and displays them in descending order. 4. The village of Ringwood conducted a census and created records that contain household data, including income. Ringwood has exactly 75 households. Write a program into which a village statistician can enter each of the 75 household income values, and determine the mean and median house-hold income. 13. Your student disk contains fi les named DEBUG08- 01. txt, DEBUG08- 02. txt, and DEBUG08- 03. txt. Each fi le starts with some comments that describe the problem. Comments are lines that begin with two slashes (//). Following the comments, each fi le contains pseudocode that has one or more bugs you must fi nd and correct. 08-01 // This application reads 10 numbers // and sorts them, and displays the three highest numbers start Declarations num SIZE = 10 num number num numbers[SIZE] num count getReady() while count < SIZE detailLoop() endwhile finish() stop getReady() output "Enter a number " input number return detailLoop() numbers[SIZE] = number count = count + 1 output "Enter a number " input number return finish() sort() output "The highest three are ", numbers[0], numbers[0], numbers[0] 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 endwhile return swap() num temp temp = numbers[x + 1] numbers[x + 1] = numbers[x] numbers[x] = temp return 08-02 // 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 > MAX_ERRORS endif output “Enter the speed in words per minute ” input wordsPerMinute while row < LIMITS AND wordsPerMinute >= speedLimits[row] row = row + 1 endwhile row = row – 1 output “Your grade is “, grades[errors][row] stop 08-03 This application reads sales data for an automobile dealership. // Up to 100 sale amounts can be entered. The entered sale amounts // are sorted so the median sale can be displayed. start Declarations num SIZE = 100 num QUIT = 99999 num saleAmount num sales[SIZE] num count = 0 num middlePosition num x num y num temp num comps getReady() while saleAmount count < SIZE detailLoop() endwhile finish() stop getReady() output "Enter sale amount " input saleAmount return detailLoop() sales[x] = saleAmount count = count + 10 output "Enter sale amount " input saleAmount return finish() sort() middlePosition = count * 2 output "The median sale amount is ", sales[middlePosition] return sort() comps = count - 1 while y < comps x = 0 while x < y if sales[x] > sales[x + 1] then swap() endif x = x + 1 endwhile y = y + 1 endwhile return void swap() temp = sales[x] sales[x + 1] = sales[x] sales[x] = temp return Complete Chapter 10: Exercise 1, 2, 3, 6, 11 Exercises 1,2,3,6 1. Identify three objects that might belong to each of the following classes: a. Automobile b. Novel Author c. College Course 2. Identify three different classes that might contain each of these objects: a. Wolfgang Amadeus Mozart b. My pet cat named Socks c. Apartment 14 at 101 Main Street 3. Design a class named Customer Record that holds a customer number, name, and address. Include methods to set the values for each data field and display the values for each data field. Create the class diagram and write the pseudocode that defines the class. 6. Complete the following tasks: a. Design a class named Book that holds a stock number, a…
Looking for a solution written from scratch with No plagiarism and No AI?
WHY CHOOSE US?
We deliver quality original papers |
Our experts write quality original papers using academic databases.We dont use AI in our work. We refund your money if AI is detected |
Free revisions |
We offer our clients multiple free revisions just to ensure you get what you want. |
Discounted prices |
All our prices are discounted which makes it affordable to you. Use code FIRST15 to get your discount |
100% originality |
We deliver papers that are written from scratch to deliver 100% originality. Our papers are free from plagiarism and NO similarity.We have ZERO TOLERANCE TO USE OF AI |
On-time delivery |
We will deliver your paper on time even on short notice or short deadline, overnight essay or even an urgent essay |