Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

shop maintains customer records with data fields for the first name, last name,

ID: 3626938 • Letter: S

Question

shop maintains customer records with data fields for the first name, last name, address and total purchases in dollars. At the end of each month, the store manager invites the five customers with the greatest value of purchases to an exclusive sales event.

Develop the logic and flow chart for a program that reads in 100 customer records and stores the first and last names and purchases in three parallel arrays so that records are in descending order by purchase amount for the month. The output lists the names of the top five customers.

start
Declarations
num SIZE = 100
num QUIT = 99999
string lastName
string firstName
num purchase = 0
num sales[SIZE]
num x
num y
num temp
num comps
getReady()
while purchase < SIZE
detailLoop()
endwhile
finish()
stop

getReady()
output "Enter purchase "
input purchase
return

detailLoop()
purchase[x] = purchase
count = count + 10
output "Enter purchase "
input purchase
return

finish()
sort()
customer = count * 2
output "The top five is ", purchase[SIZE]
return

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

Explanation / Answer

Answered through PM at the request of the OP.