Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The Eversoft Eraser Company has a list of its customers\' names (not necessarily

ID: 3543376 • Letter: T

Question

The Eversoft Eraser Company has a list of its customers' names (not necessarily in alphabetical order) and telephone numbers in a file named "customer" with records of the following form:

last name, first name, phone number

a. Allow the user to input a last name; then search the file and display all names and phone numbers corresponding to that last name.

b. Load the file into parallel arrays and display the list of customers' names and phone numbers in alphabetical order.

I cannot stress it enough that I need this written in pseudo code. Thanks

I need to use command prompts such as; write, input, declare,. set, if, end if, while

Explanation / Answer

a)

Accept input (last name) from user
Do Until no more names in list = true
..... if user_last_name equals last_name_in_list then
.......... display names, phone number
.... end if
loop

(Since the names aren't necessarily in alphabetical order, each name in the entire list must be compared.)


b) This pseudocode will vary, depending upon the specific language you're using. For PowerBASIC, it's a simple as:

Dim Customer_LastName(1 to 1000)
Dim Customer_Dummy_Array(1 to 1000)
Dim Customer_FirstName(1 to 1000)
Dim Customer_Number(1 to 1000)

Do Until no more names in list = true
.... INCR x
.....Customer_LastName(x) = last_name_in_list
.....Dummy_Array(x) = last_name_in_list
.....Customer_FirstName(x) = first_name_in_list
.....Customer_Number(x) = number_in_list
LOOP

Array Sort Customer_LastName(), tagarray Customer_FirstName()
Array Sort Dummy_Array(), tagarray Customer_Number()

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote