In: Computer Science
Design a program using a flowchart or pseudocode that accepts a person’s loyalty card number and amount spent in the store last month. Display the data only if the customer is a high spender – a person who spent more than $1000 in the store.
A program that accepts customer info continuously until a sentinel value is entered and displays a list of high spenders.
PseudoCode:
while(1) {
exitProgam = false
print("Do you want to check if a person is high
spender? (y/n)")
List listOfHighSpenders; //list of high spenders
input = read()
switch(input) {
case "y": print("Enter the person’s
loyalty card number")
card_num = read()
print("Enter the amount spent in the store last
month")
amount_spent = read()
//check if the person spent more than 1000
if(amount_spent > 1000)
listOfHighSpenders.add(card_num)
break;
case "n": exitProgam = true
break;
//wrong input
default: print("Please enter y or
n")
}
//To stop taking input from the user if thte input is "n"
if(exitProgam)
break;
}
//Displaying the high spenders
for(spender_card_num in listOfHighSpenders) {
print(spender_card_num)
}