Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2 . / / This application reads sales data for a real estate broker. The user / / enters a record for each of 1

2.// This application reads sales data for a real estate broker. The user
// enters a record for each of 10 salespeople containing the salesperson's
// name, the number of properties sold by that person during the month,
// and the total value of those properties. The data records are sorted by // value so the data for the top three salespeople can be displayed.
// Modify the program to:
//(1) enter data for any number of salespeople up to 60
//(2) allow the user to choose whether to see
//(a) the data for the top three salespeople
//(or fewer if 3 are not entered) by value
//(b) the data for the top three salespeople
//(or fewer if 3 are not entered) by
// number of properties sold
start
// Declarations
num SIZE =10
string names[SIZE]
num properties[SIZE]
num values[]
num count
num NUM_TO_DISPLAY =3
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 =0
output "Enter salesperson name
output tempName
while tempName != QUIT OR count <= SIZE
names[count]= tempname
output "Enter number of properties sold "
input properties[tempname]
output "Enter total value of those properties "
input values[tempname]
count = count +1
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 (V)alue"
output "or by number of (P)roperties sold? "
output choice
endwhile
if choice ="V"
valueSort()
else
propertySort()
endif
count =0
if numEntered <=3 then
numToDisplay = numEntered
else

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

Master The Art Of Data Storytelling With Visualizations

Authors: Alexander N Donovan

1st Edition

B0CNMD9QRD, 979-8867864248

More Books

Students also viewed these Databases questions

Question

What lessons in OD contracting does this case represent?

Answered: 1 week ago

Question

Does the code suggest how long data is kept and who has access?

Answered: 1 week ago