Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Assignment 1 (and Prerequisite Test) In this program, you are required to read in from a text file a list of persons, display their

image text in transcribed
Programming Assignment 1 (and Prerequisite Test) In this program, you are required to read in from a text file a list of persons, display their information, add new persons, and do a search for certain persons. The information of each person consists of: Last_Name First_Name (30 chars, max) Social Security Number (long) Age (int) Address (70 chars, max) Your program will open a file al.txt and read one person's info at a time, and you may assume the entries in the file are all in correct forms. Each person's information is collected, in sequence, as name, SSN, age, address. You can assume the maximum number of people in al.txt is 25 1. Your program prints the information of all people according the social security numbers in ascending order. The information (name, SSN, age, address) should be identical to the information your program read from al.txt (see sample al.txt as in the same folder of this assignment; your program needs to follow the same formatting as defined in al.txt) 2. Your program then asks the user if there is additional person to add. If so, the fields of information about this new person are the same format as in al.txt, in sequence of name, SSN, age, address, and your program asks the user to enter one entry at a time. Your program should continue to ask if additional person is to be added, and the user decides whether or not to add a new one. 3. After 2, your program asks the user to search for a person by last name. The user will enter the name and your program should print out the information: name, SSN, age, address, in sequence and one line per field (e.g. name takes one line) if found. Your program should continuously ask the user if to search a person, and stop only if the user chooses so. If there are two or more people with identical last name, each of them should be listed. Your program prints out the information immediately after the person is found. 4. After 3, your program should have a function to print out all people who are "searched and found", in the order of first searched and first printed. The standard printed on screen) information consists: name, SSN, age, address, in sequence and one line per field. Check the sample file for conforming the format, and test if your program works, NOTE: You need to read the requirement carefully, and write your program accordingly. Programming Assignment 1 (and Prerequisite Test) In this program, you are required to read in from a text file a list of persons, display their information, add new persons, and do a search for certain persons. The information of each person consists of: Last_Name First_Name (30 chars, max) Social Security Number (long) Age (int) Address (70 chars, max) Your program will open a file al.txt and read one person's info at a time, and you may assume the entries in the file are all in correct forms. Each person's information is collected, in sequence, as name, SSN, age, address. You can assume the maximum number of people in al.txt is 25 1. Your program prints the information of all people according the social security numbers in ascending order. The information (name, SSN, age, address) should be identical to the information your program read from al.txt (see sample al.txt as in the same folder of this assignment; your program needs to follow the same formatting as defined in al.txt) 2. Your program then asks the user if there is additional person to add. If so, the fields of information about this new person are the same format as in al.txt, in sequence of name, SSN, age, address, and your program asks the user to enter one entry at a time. Your program should continue to ask if additional person is to be added, and the user decides whether or not to add a new one. 3. After 2, your program asks the user to search for a person by last name. The user will enter the name and your program should print out the information: name, SSN, age, address, in sequence and one line per field (e.g. name takes one line) if found. Your program should continuously ask the user if to search a person, and stop only if the user chooses so. If there are two or more people with identical last name, each of them should be listed. Your program prints out the information immediately after the person is found. 4. After 3, your program should have a function to print out all people who are "searched and found", in the order of first searched and first printed. The standard printed on screen) information consists: name, SSN, age, address, in sequence and one line per field. Check the sample file for conforming the format, and test if your program works, NOTE: You need to read the requirement carefully, and write your program accordingly

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

Step: 3

blur-text-image

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

Transactions On Large Scale Data And Knowledge Centered Systems Xxviii Special Issue On Database And Expert Systems Applications Lncs 9940

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Qimin Chen

1st Edition

3662534541, 978-3662534540

More Books

Students also viewed these Databases questions

Question

Q.1. Taxonomic classification of peafowl, Tiger and cow ?

Answered: 1 week ago

Question

Q .1. Different ways of testing the present adulterants ?

Answered: 1 week ago

Question

Q.1. Health issues caused by adulteration data ?

Answered: 1 week ago

Question

1. Traditional and modern methods of preserving food Articles ?

Answered: 1 week ago