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. I This program must be done with an array of pointers to structures. Do not use an array ol strucures. This program MUST use multiple file format. You may use string handling functions for this lab. Input: Create a data file of names and addresses in alphabetic order (by name) as follows: last name, first name street address first line: second line: third line: city and state zip 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.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter10: Pointers
Section10.1: Addresses And Pointers
Problem 3E
icon
Related questions
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
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.
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 6 images

Blurred answer
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
SEE SOLUTION
Knowledge Booster
Header Files
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,