Design a modular solution, using a structure chart , and then write a C program based on the structure chart solution that solves the following question. Show the flow of data on your structure chart; in the program, this is achieved by parameter passing and function return data.  Data for your program comes from an input file called infile.txt. Each line in the data file has a person’s first name (one word) and an age (separated by a space). There can be up to 10 lines in the data file, and there may be names that are the same (in this case, it can be assumed that the record is for that same person). An example of one line is:   Tony 30  Your program reads the data into a data structure, which consists of an array of records (i.e. array of C structs). Thus, the program would need to define a suitable struct, and create an array of these structs.   Once the data is read in and stored in the data structure the program closes the input file, and then determines if there are any repeated names in the data structure. If there are repeated names, the name and age of the repeated records should be displayed once per person to the screen (just as recorded in the input file above). If there are no repeated records, ‘no repeats’ is displayed to the screen.  Finally, the program will write the data stored in the data structure to a csv (Comma Separated Value) file; the output file should be named outfile.csv. Each record in the data structure will be written to the file on a separate line. A line format will be the same as was in the input file, with the exception that a comma (instead of a space) will separate the fields of each record. There must be NO records containing repeated names in outfile.csv.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Design a modular solution, using a structure chart , and then write a C program based on the structure chart solution that solves the following question. Show the flow of data on your structure chart; in the program, this is achieved by parameter passing and function return data. 

Data for your program comes from an input file called infile.txt. Each line in the data file has a person’s first name (one word) and an age (separated by a space). There can be up to 10 lines in the data file, and there may be names that are the same (in this case, it can be assumed that the record is for that same person). An example of one line is:  

Tony 30

 Your program reads the data into a data structure, which consists of an array of records (i.e. array of C structs). Thus, the program would need to define a suitable struct, and create an array of these structs.  

Once the data is read in and stored in the data structure the program closes the input file, and then determines if there are any repeated names in the data structure. If there are repeated names, the name and age of the repeated records should be displayed once per person to the screen (just as recorded in the input file above). If there are no repeated records, ‘no repeats’ is displayed to the screen.

 Finally, the program will write the data stored in the data structure to a csv (Comma Separated Value) file; the output file should be named outfile.csv. Each record in the data structure will be written to the file on a separate line. A line format will be the same as was in the input file, with the exception that a comma (instead of a space) will separate the fields of each record. There must be NO records containing repeated names in outfile.csv

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
ADT and Class
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education