Question: Problem: Create a C program that does the following: reads real numbers stored as ASCII text, one number per line from a file o numbers

 Problem: Create a C program that does the following: reads real

numbers stored as ASCII text, one number per line from a file

o numbers may be positive or negative o number may or may

Problem: Create a C program that does the following: reads real numbers stored as ASCII text, one number per line from a file o numbers may be positive or negative o number may or may not have an embedded decimal point o numbers are not ordered in any way within the file dynamically allocates memory for a structure (linked list node) containing two variables o one of type float for the real number o one a structure pointer type that will point to the next node in the list inserts each node into a singly-linked list in ascending order o start at the list head and move towards the tail o link the new node into its proper place in the list traverse the linked list o start at the head and advance to the next node until the tail is reached o write the number in each node to output file Requirements 1. The program must ask the user for the input file name and continue to do so until a valid input file (i.e., one that actually exists) is entered. 2. The output file name must be constructed from the input file name. If a file extension is present, it must be removed by stripping off the "dot" extension. An extension of out.txt" must be added to the end of the base input file name. For example, if the input file name is "pgm1 data.txt", then the output file name should be "pgm1 ata out.txt". 3. An input /output report for each program execution must be printed. The following example is to serve as a template. Input numbers are in testfile.txt and numbers from the ordered linked list are in testfile out.txt. Nu should be counted as read in and counted as written out mbers Allowing for 999 numbers is more than sufficient. Program to read and insert a list of numbers into a singly linked list in ascending order Enter filename testfile.txt Input file testfile. txt contains 999 numbers output file testfile out.txt contains 999 numbers 4. f you need to use print statements for debugging you may comment these out using the C comment delimiter instead of deleting lines, otherwise remember this is a C program Problem: Create a C program that does the following: reads real numbers stored as ASCII text, one number per line from a file o numbers may be positive or negative o number may or may not have an embedded decimal point o numbers are not ordered in any way within the file dynamically allocates memory for a structure (linked list node) containing two variables o one of type float for the real number o one a structure pointer type that will point to the next node in the list inserts each node into a singly-linked list in ascending order o start at the list head and move towards the tail o link the new node into its proper place in the list traverse the linked list o start at the head and advance to the next node until the tail is reached o write the number in each node to output file Requirements 1. The program must ask the user for the input file name and continue to do so until a valid input file (i.e., one that actually exists) is entered. 2. The output file name must be constructed from the input file name. If a file extension is present, it must be removed by stripping off the "dot" extension. An extension of out.txt" must be added to the end of the base input file name. For example, if the input file name is "pgm1 data.txt", then the output file name should be "pgm1 ata out.txt". 3. An input /output report for each program execution must be printed. The following example is to serve as a template. Input numbers are in testfile.txt and numbers from the ordered linked list are in testfile out.txt. Nu should be counted as read in and counted as written out mbers Allowing for 999 numbers is more than sufficient. Program to read and insert a list of numbers into a singly linked list in ascending order Enter filename testfile.txt Input file testfile. txt contains 999 numbers output file testfile out.txt contains 999 numbers 4. f you need to use print statements for debugging you may comment these out using the C comment delimiter instead of deleting lines, otherwise remember this is a C program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!