Question: Please modify per instructions: start / / Declarations num SIZE = 1 0 string names [ SIZE ] num properties [ SIZE ] num values
Please modify per instructions:
start
Declarations
num SIZE
string namesSIZE
num propertiesSIZE
num values
num count
num NUMTODISPLAY
num comps
num x
num y
num tempProp
num tempVal
string tempName
string QUIT ZZZZ
string choice
num numEntered
call getReady
call display
call finish
stop
getReady
count
output "Enter salesperson name
output tempName
while tempName QUIT OR count SIZE
namescount tempname
output "Enter number of properties sold
input propertiestempname
output "Enter total value of those properties
input valuestempname
count count
if count SIZE then
output "Enter salesperson name or QUIT, to quit
output tempName
endif
numEntered count
end
return
display
choice X
while choice P OR choice V
output Do you want to see the top three salespeople by Value
output or by number of Properties sold?
output choice
endwhile
if choice V
valueSort
else
propertySort
endif
count
if numEntered then
numToDisplay numEntered
else
numToDisplay
endif
while count numToDisplay
output namescount propertiescount valuescount
count count
end
return
finish
output "End of display"
return
valueSort
comps numEntered
while y comps
x
while x comps
if valuesx valuesx then
swap
endif
x x
endwhile
y y
end
return
propertiesSort
comps numEntered
while y comps
x
while x comps
if propertiesx propertiesx then
swap
endif
x x
endwhile
y y
end
return
void swap
tempName namesx
namesx namesx
namesx tempName
tempProp propertiesx
propertiesx propertiesx
propertiesx tempProp
tempVal valuesx
valuesx valuesx
valuesx temp
return
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
