Question: Write a program, maxmin.c, which uses two functions readvalues() and range() to find the maximum and minimum of a set of floats stored in the file samplesin.txt. You can assume that the number of values in the input file is less than 100. Your main must use the following steps: • open the two files samplesin.txt and maxminout.txt. • call the function readvalues() which read the values from samplesin.txt into the array x and returns 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.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section8.3: Random File Access
Problem 6E
icon
Related questions
Question

in C++ please

Question: Write a program, maxmin.c, which uses two functions readvalues() and range() to find
the maximum and minimum of a set of floats stored in the file samplesin.txt. You can assume that
the number of values in the input file is less than 100.
Your main must use the following steps:
• open the two files samplesin.txt and maxminout.txt.
• call the function readvalues () which read the values from samplesin.txt into the array x and
returns 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.
• write the maximum and minimum values to the file maxminout.txt.
Your output file should look like:
There are 80 values in the array
The maximum value in the array is 63.605999
The minimum value in the array is 4.808900
Copy and paste your program into the box below.
Transcribed Image Text:Question: Write a program, maxmin.c, which uses two functions readvalues() and range() to find the maximum and minimum of a set of floats stored in the file samplesin.txt. You can assume that the number of values in the input file is less than 100. Your main must use the following steps: • open the two files samplesin.txt and maxminout.txt. • call the function readvalues () which read the values from samplesin.txt into the array x and returns 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. • write the maximum and minimum values to the file maxminout.txt. Your output file should look like: There are 80 values in the array The maximum value in the array is 63.605999 The minimum value in the array is 4.808900 Copy and paste your program into the box below.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr