Design a program psudeocode that asks the user to enter a charge account number.
ID: 3558698 • Letter: D
Question
Design a program psudeocode that asks the user to enter a charge account number. The program should determine whether the number is valid by comparing it to the following list of valid charge account numbers
5658845, 4520125, 7895122,
8777541, 8451277, 1302850,
8080152, 4562555, 5552012,
5050552, 7825877, 1250255,
1005231, 6545231, 3852085,
7576651, 7881200, 4581002
The program psuedocode should possibly include words like Declare,Integer,Real,String,Display. The psudocode composed should be able to be translated to actual programming language without too much effort.
Explanation / Answer
// This program displays the charge account number is valid or not.
Declare Integer SIZE = 18
Declare Integer values [SIZE] = 5658845, 4520125, 7895122,8777541, 8451277, 1302850,8080152, 4562555, 5552012,
5050552, 7825877, 1250255,1005231, 6545231, 3852085,7576651, 7881200, 458100
Declare Integer index
Declare Integer charge account number
Read charge account number from keyBoard
For index = 0 To SIZE - 1
If values [index] == highest
Display charge account number," is Valid"
stop.
End If
End For
If index == SIZE-1
Display charge account number," is Invalid"
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.