Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Pascal Programming Program 3: President records The president file contains records in the form of text lines, one per U.S. president. Each president record contains:

Pascal Programming

image text in transcribed

Program 3: President records The president file contains records in the form of text lines, one per U.S. president. Each president record contains: The president's 3-digit ID The president's first name The president's last name One or more blanks separate the ID and the last and first names. There are no blanks inside the names The records are already sorted by ID. You do not know in advance how many president records there are. The last president record is followed by a dummy record that has 0 in place of the ID Read and store each president's ID, first name, and last name in a Pascal record. Store all the records in an array of records that's large enough to hold 20 records Following the dummy record, there is a list ID numbers. For each ID, search and find the matching president. Input data 23 John Kennedy 172 Lyndon Johnson 265 Richard Nixon 306 Gerald Ford 497 Jimmy Carter 500 Ronald Reagan 668 George Bush 701 Bill clinton 888 Barack Obama 939 Donald Trump 497 123 666 888 Output After reading in the presidents and storing them in an array of records, print the array. Then for each ID, search the array for the matching president and print that president's first and last name. If there is no match, print no match

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_2

Step: 3

blur-text-image_3

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

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 1 Lncs 8055

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013 Edition

3642402844, 978-3642402845

More Books

Students also viewed these Databases questions

Question

2. Compare the sales and service departments at Auto World.

Answered: 1 week ago