Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objective To gain experience in the use of pointers, structures, and dynamic memory allocation, multiple file program, command line arguments, files. Assignment Modify lab 6

Objective
To gain experience in the use of pointers, structures, and dynamic memory allocation, multiple file program,
command line arguments, files.
Assignment
Modify lab 6B/7B by using command line arguments and files (no input/output redirection). Name of input
and output files are entered on the command line. The program should read address information from the
input file and output them to an output file.
Input
Same file as lab 6B/7B.
Output
The names and addresses in zip code order with same format in lab 6B/7B.
Run
Run the program with the input file assigned. Run the program on the command line:
Lab8.exe lab8_input.txt lab8_output.txt
Turn In
Turn in source code (header file, multiple .c files), input file and output file.
Programming In C
Lab 6B/7B
Objective
To gain experience in the use of pointers, structures, and dynamic memory allocation, multiple file program,
input/output redirection.
Assignment
Write a program to input names and addresses that are in alphabetic order and output the names and
addresses in zip code order. You could assume maximum of 50 names.
The program should be modalized and well documented. You must:
Use a structure for names and address information
Allocate storage dynamically for each structure (dynamic memory allocation)
Use input/output redirection
Use an array of pointers to structures; Do NOT use an array of structures
Use multiple file format; header file, multiple .c files
Sort the zip codes in ascending order
Use the data file assigned
You may use any functions in this lab. No global variables.
Input
Data file contains 4 records (lines) for each name and address as follows:
First line: , Lastname, Firstname
Second line: Street address
Third line: , City and State
Fourth line: Zipcode
Output
The names and addresses in zip code order with the above format.
Run
Run the program with the input file assigned. Run the program on the command line using input/output
redirection:
Lab6b7b.exe lab6b7b_input.txt > lab6b7b_output.txt
Lab 6B/7B
Objective
To gain experience in the use of pointers, structures, and dynamic memory allocation, multiple file program,
input/output redirection.
Assignment
Write a program to input names and addresses that are in alphabetic order and output the names and
addresses in zip code order. You could assume maximum of 50 names.
The program should be modalized and well documented. You must:
1. Use a structure for names and address information
2. Allocate storage dynamically for each structure (dynamic memory allocation)
3. Use input/output redirection
4. Use an array of pointers to structures; Do NOT use an array of structures
5. Use multiple file format; header file, multiple .c files
6. Sort the zip codes in ascending order
7. Use the data file assigned
You may use any functions in this lab. No global variables.
Input
Data file contains 4 records (lines) for each name and address as follows:
First line: Lastname, Firstname
Second line: Street address
Third line: City and State
Fourth line: Zipcode
Output
The names and addresses in zip code order with the above format.
Run
Run the program with the input file assigned. Run the program on the command line using input/output
redirection:
Lab6b7b.exe lab6b7b_input.txt > lab6b7b_output.txt
Turn In
Turn in source code (header file, multiple .c files), input file and output file.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions