Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone help me find the bugs. Thank you // This application reads sales data for an automobile dealership. // Up to 100 sale amounts

Can someone help me find the bugs. Thank you

// This application reads sales data for an automobile dealership. // Up to 100 sale amounts can be entered. The entered sale amounts // are sorted so that 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 <> QUIT and count < SIZE detailLoop() endwhile finish() stop

getReady() output "Enter sale amount " input saleAmount return

detailLoop() count = count + 1 output "Enter sale amount " input saleAmount return

finish() sort() middlePosition = SIZE / 2 output "The median sale amount is ", sales[middlePosition] return

sort() comps = count - 1 while y < comps x = 0 while x < comps if sales[x] > sales[x + 1] then swap() endif endwhile endwhile return

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

In your own words, summarize the primary objectives of unions.

Answered: 1 week ago

Question

An accountable plan allow S corporation to:

Answered: 1 week ago