To gain experience in the use of pointers, structures, and dynamic memory allocation. blem 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. ut: Create a data file of names and addresses in alphabetic order by name as follows: first line: last name, first name www second line: street address third line: city and state

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter3: Input/output
Section: Chapter Questions
Problem 1PE: 1. Consider the following incomplete C++ program: #include <iostream> int main() { … } a. Write a...
icon
Related questions
Question
100%

Please help with C program USING FILE HANDLING FUNCTIONS 

READ THE INSTRUCTIONS IN THE IMAGE BELOW, THANK YOU

YOU CAN ALSO TEST THE PROGRAM WITH THE FOLLOWING INFORMATION IN A .TXT FILE.

input.txt

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

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.
Input:
Create a data file of names and addresses in alphabetic order by name as follows:
first line:
last name, first name
second line:
street address
third line:
city and state
fourth line:
zip
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 FILE HANDLING FUNCTIONS, USE POINTERS TO STRUCTURES NOT ARRAY OF
STRUCTURES, USE MALLOC. NO GLOBAL VARIABLES.
YOU MUST USE A STRUCURE FOR THE NAMES AND ADDRESS INFORMATION. ALLOCATE STORAGE
DYNAMICALLY FOR EACH STRUCTURE.
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. Input: Create a data file of names and addresses in alphabetic order by name as follows: first line: last name, first name second line: street address third line: city and state fourth line: zip 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 FILE HANDLING FUNCTIONS, USE POINTERS TO STRUCTURES NOT ARRAY OF STRUCTURES, USE MALLOC. NO GLOBAL VARIABLES. YOU MUST USE A STRUCURE FOR THE NAMES AND ADDRESS INFORMATION. ALLOCATE STORAGE DYNAMICALLY FOR EACH STRUCTURE.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 6 images

Blurred answer
Knowledge Booster
File Input and Output Operations
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++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr