Qn 1. Write a complete C program Create a text file that contains four columns and ten rows. First column contains strings values, second and third column contains integer values, and fourth column contains double values (you are free to use your own values). Declare a structure that contains 4 elements (you are free to use your own variables). First element should be a char array – to read first column values from the text file. Second element should be an int value – to read second column values from the text file. Third element should be an int value – to read second column values from the text file. Fourth element should be a double value – to read third column values from the text file. Declare an array of this structure with size 10 and read the contents of the text file into this array. Then prompt the user with the following instructions: 1: Display the details of the array – call a function to display the contents of the array on screen. 2: To sort the array (you should call sort function - output of the sorting function should be written onto a text file and terminal) You should give the user the chance to sort in ascending or descending order with respect to string value. Then you should give the user the option to select from different sorting techniques (you should write minimum two sorting algorithm functions, call the functions according to the choice the user enters – call the sorting function only after the user selects the above-mentioned options). 3: To search for a string element (Write the output on terminal) You should give the user to select the searching technique (linear or binary – must use recursive version of the searching functions) if binary is selected call a sort function first. 4: To insert these array elements into a linked list in the order of string values. Display the contents on the terminal. 5: Quit Your complete program should have multiple files (minimum two .c files and two .h files). Give your file name as heading and then paste your code. You must include your text files as well in the submission.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Qn 1. Write a complete C program
Create a text file that contains four columns and ten rows. First column contains strings values,
second and third column contains integer values, and fourth column contains double values (you
are free to use your own values).
Declare a structure that contains 4 elements (you are free to use your own variables).
First element should be a char array – to read first column values from the text file.
Second element should be an int value – to read second column values from the text file.
Third element should be an int value – to read second column values from the text file.
Fourth element should be a double value – to read third column values from the text file.
Declare an array of this structure with size 10 and read the contents of the text file into this array.
Then prompt the user with the following instructions:
1: Display the details of the array – call a function to display the contents of the array on screen.
2: To sort the array (you should call sort function - output of the sorting function should be
written onto a text file and terminal)
You should give the user the chance to sort in ascending or descending order with respect
to string value.
Then you should give the user the option to select from different sorting
techniques (you should write minimum two sorting algorithm functions, call the
functions according to the choice the user enters – call the sorting function only
after the user selects the above-mentioned options).
3: To search for a string element (Write the output on terminal)
You should give the user to select the searching technique (linear or binary – must use
recursive version of the searching functions)
if binary is selected call a sort function first.
4: To insert these array elements into a linked list in the order of string values. Display the
contents on the terminal.
5: Quit
Your complete program should have multiple files (minimum two .c files and two .h files).
Give your file name as heading and then paste your code. You must include your text files as well
in the submission.
Transcribed Image Text:Qn 1. Write a complete C program Create a text file that contains four columns and ten rows. First column contains strings values, second and third column contains integer values, and fourth column contains double values (you are free to use your own values). Declare a structure that contains 4 elements (you are free to use your own variables). First element should be a char array – to read first column values from the text file. Second element should be an int value – to read second column values from the text file. Third element should be an int value – to read second column values from the text file. Fourth element should be a double value – to read third column values from the text file. Declare an array of this structure with size 10 and read the contents of the text file into this array. Then prompt the user with the following instructions: 1: Display the details of the array – call a function to display the contents of the array on screen. 2: To sort the array (you should call sort function - output of the sorting function should be written onto a text file and terminal) You should give the user the chance to sort in ascending or descending order with respect to string value. Then you should give the user the option to select from different sorting techniques (you should write minimum two sorting algorithm functions, call the functions according to the choice the user enters – call the sorting function only after the user selects the above-mentioned options). 3: To search for a string element (Write the output on terminal) You should give the user to select the searching technique (linear or binary – must use recursive version of the searching functions) if binary is selected call a sort function first. 4: To insert these array elements into a linked list in the order of string values. Display the contents on the terminal. 5: Quit Your complete program should have multiple files (minimum two .c files and two .h files). Give your file name as heading and then paste your code. You must include your text files as well in the submission.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 10 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY