(Solved) : Uupul Llame 15 Y Pius1 Dl Uul 5 Programs Would Like Able Determine Input Output Filenames Q42737017 . . .

UUPUL llame 15 y. PIUS1 dl. UUL 5. In some programs we would like to be able to determine the input and output filenames at t

UUPUL llame 15 y. PIUS1 dl. UUL 5. In some programs we would like to be able to determine the input and output filenames at the time that the program is executed. Modify your maxmin.c program from Assignment 8 so that the main program prompts the user for the two filenames and passes the input filename to the readvalues() function. The function readvalues() now opens the input file to read the data and closes it when done. This program uses a second function, range(), to find the maximum and minimum of a set of floats stored in the input file. Your main must use the following steps: • prompt user for the input and output file names. • call the function readvalues() to open the input file, read the values from the intput file into the array x, and return the value of n (number of values in the file). call the function range() which computes the maximum and minimum values found in the array x. • open the output file to write out the results of the run (the maximum and minimum values). The program should interact with the user as follows: Enter the input filename: samplesin.txt Enter the output filename: samplesout.txt Use the same input file, samplesin.txt, as in Assignment 8. Then your output file should be the same as for Assignment 8, maxminout.txt. 2/2 Show transcribed image text UUPUL llame 15 y. PIUS1 dl. UUL 5. In some programs we would like to be able to determine the input and output filenames at the time that the program is executed. Modify your maxmin.c program from Assignment 8 so that the main program prompts the user for the two filenames and passes the input filename to the readvalues() function. The function readvalues() now opens the input file to read the data and closes it when done. This program uses a second function, range(), to find the maximum and minimum of a set of floats stored in the input file. Your main must use the following steps: • prompt user for the input and output file names. • call the function readvalues() to open the input file, read the values from the intput file into the array x, and return the value of n (number of values in the file). call the function range() which computes the maximum and minimum values found in the array x. • open the output file to write out the results of the run (the maximum and minimum values). The program should interact with the user as follows: Enter the input filename: samplesin.txt Enter the output filename: samplesout.txt Use the same input file, samplesin.txt, as in Assignment 8. Then your output file should be the same as for Assignment 8, maxminout.txt. 2/2

Expert Answer


Answer to UUPUL llame 15 y. PIUS1 dl. UUL 5. In some programs we would like to be able to determine the input and output filenames…

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us

× How can I help you?