Write the pseudocode and Flow Chart. The Spread-a-Smile Greetings Card Store mai
ID: 3623991 • Letter: W
Question
Write the pseudocode and Flow Chart.
The Spread-a-Smile Greetings Card Store maintains customer records with data fields for first name, last name, address, and annual purchases in dollars. At the end of the year, the store manager invites the 100 customers with the highest annual purchases to an exclusive sales event. Develop the flowchart or pseudocode that allows the user to enter customer records (up to 1,000 of them) and sorts the customer records by annual purchase amount. The application prints the names and addresses fot the top 100 customers (or fewer if less than 100 are entered).
Explanation / Answer
customer contains: String firstName, String lastName, String address, double purchaseAmt
if customer purchases && is not in the list of customers && totalCusts < 1000
then add to list, setting all the variables (including the amount of first purchase)
else
find the customer in the list, add the total to the corresponding purchaseAmt
*write sorting algorithm here*
int i = 1;
do
temp = customer[i];
print firstName, lastName, address;
i++;
while(i < 100)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.