# Programming exercises chap 8&9_cyoung.docx - Pseudocode Ch8...

• 3

This preview shows page 1 - 3 out of 3 pages.

Pseudocode: Ch8: 1...Design an application that accepts 10 numbers and displays them in descending order. Start Declarations num SIZE = 10 num numbers [SIZE] num x num y num temp num COMPS = SIZE – 1 fillArray () sortArray () displayArray () stop fillArray () x = 0 while x < SIZE output “Enter a number” input numbers[x]x = x + 1 endwhile return sortArray () x = 0 y = 0 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 () temp = numbers[x+1] numbers[x+1] = numbers[x] numbers[x] = temp return displayArray () x = SIZE – 1 while x >= 0 output numbers[x] x = x – 1 endwhile return Chap 9 Create an IPO chart for each of the following methods: a. The method that calculates the amount owed on a restaurant check, including tip. b. The method that calculates your yearly education- related expenses c. The method that calculates your annual housing expenses, including rent or mortgage payment and utilities. A. Input Processing Output Bill total Tax rate Amount of tip Calculate amount owed by
• • • 