Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question

Help with c program using FILE HANDLING (fopen, fputs, fgets, etc.)

You can also test the program with the following input.txt file 
 
A1, A2
20294 Lorenzana Dr
Woodland Hills, CA
91364
B1, B2
19831 Henshaw St
Culver City, CA
94023
C1, C2
5142 Dumont Pl
Azusa, CA
91112
D1, D2
20636 De Forest St
Woodland Hills, CA
91364
A1, A2
20294 Lorenzana Dr
Woodland Hills, CA
91364
E1, E2
4851 Poe Ave
Woodland Hills, CA
91364
F1, F2
20225 Lorenzana Dr
Los Angeles, CA
91111
G1, G2
20253 Lorenzana Dr
Los Angeles, CA
90005
H1, H2
5241 Del Moreno Dr
Los Angeles, CA
91110
I1, I2
5332 Felice Pl
Stevenson Ranch, CA
94135
J1, J2
5135 Quakertown Ave
Thousand Oaks, CA
91362
K1, K2
720 Eucalyptus Ave 105
Inglewood, CA
89030
L1, L2
5021 Dumont Pl
Woodland Hills, CA
91364
M1, M2
4819 Quedo Pl
Westlake Village, CA
91362
I1, I2
5332 Felice Pl
Stevenson Ranch, CA
94135
I1, I2
5332 Felice Pl
Stevenson Ranch, CA
94135
N1, N2
20044 Wells Dr
Beverly Hills, CA
90210
O1, O2
7659 Mckinley Ave
Los Angeles, CA
90001
 
Please also adhere to the following rules
1. Use file handling functions
2. Use command line parameters
3. Dynamic memory allocation
4. Array of pointer to structures (no array of
structures)
5. Multiple file format
6. sort in ascending order
7. Don't delete duplicates
8. Use input file address.txt
9. Turn in .h file, multiple .c files, input file,
output file
expand button
Transcribed Image Text:1. Use file handling functions 2. Use command line parameters 3. Dynamic memory allocation 4. Array of pointer to structures (no array of structures) 5. Multiple file format 6. sort in ascending order 7. Don't delete duplicates 8. Use input file address.txt 9. Turn in .h file, multiple .c files, input file, output file
Objective:
To gain experience in the use of pointers, structures, and dynamic memory allocation.
Problem definition:
You are to code and execute a C program to input names and addresses that are in alphabetic order and
output the names and addresses to a new file in zip code order. Maximum of 50 names.
The program should be modularized and well documented. You must use a structure for the names and
address information. Allocate storage dynamically for each structure.
This program must be done with an array of pointers to structures. Do not use an
array ol siruciares. This program MUST use muliple file format. You may use string handling functions
for this lab.
Input: Create a data file of names and addresses in alphabetic order (by nane) as follows:
first line:
last name, first name
second line:
street address
city and state
zip
third line:
fourth line:
Assume no errors (which means that you have to type carefully.)
Output:
The program is to create a new file of names and addresses in zip code order with the above format. If
duplicate records (2 or more) occur in the input file, only include one copy in the output file.
YOU MUST USE POINTERS TO STRUCTURES AND MALLOC. NO GLOBAL VARIABLES.
Hand in:
A copy of the input file, the output file, a listing of the program, and a disk containing your executable file.
expand button
Transcribed Image Text:Objective: To gain experience in the use of pointers, structures, and dynamic memory allocation. Problem definition: You are to code and execute a C program to input names and addresses that are in alphabetic order and output the names and addresses to a new file in zip code order. Maximum of 50 names. The program should be modularized and well documented. You must use a structure for the names and address information. Allocate storage dynamically for each structure. This program must be done with an array of pointers to structures. Do not use an array ol siruciares. This program MUST use muliple file format. You may use string handling functions for this lab. Input: Create a data file of names and addresses in alphabetic order (by nane) as follows: first line: last name, first name second line: street address city and state zip third line: fourth line: Assume no errors (which means that you have to type carefully.) Output: The program is to create a new file of names and addresses in zip code order with the above format. If duplicate records (2 or more) occur in the input file, only include one copy in the output file. YOU MUST USE POINTERS TO STRUCTURES AND MALLOC. NO GLOBAL VARIABLES. Hand in: A copy of the input file, the output file, a listing of the program, and a disk containing your executable file.
Expert Solution
Check Mark
Still need help?
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Can you please do the code in a multiple files one header file , and two c files . Must run the program on a command line. Thank you 

Solution
Bartleby Expert
by Bartleby Expert
SEE SOLUTION
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Can you please do the code in a multiple files one header file , and two c files . Must run the program on a command line. Thank you 

Solution
Bartleby Expert
by Bartleby Expert
SEE SOLUTION
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education