Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in C++ 3 and 4, 5 with a reference of question 3 please 3. Complete the program minmax.cpp which uses two functions

Write a program in C++ 3 and 4, 5 with a reference of question 3 please

image text in transcribedimage text in transcribed

image text in transcribed

3. Complete the program minmax.cpp which uses two functions readdata() and minmax() to find the maximum and minimum of a set of floats stored in the file minmaxin.txt. You can assume that the number of values in the file is less than 100. The first number in this file is an int indicating the number of floats which follow. The function readdata) opens the input file minmaxin.txt, reads the first number, n, and then reads the following n floats into an array. The file is then closed by the function. The function minmax() computes the minimum and maximum values found in the array. The main program prints the maximum and minimum. The content of the output file minmaxout.txt will be: The array has 80 elements The maximum value in the array is 63.606 The minimum value in the array is 4.8089 /* File: minmar.cpp Programmer: Date: #include #include using namespace std; const int MXN = 100; // maximum array size /* function prototype */ void readdata(/you fill in here */); void minmax (/* you fill in here */); int main(void) { ofstream out file ("minmaxout.txt"); float x [MXN); // the array int n; // the actual array size float max; // the marimum float min; // the minimum /read the data into the array */ readdata (/* you fill in here */); /* compute the marimum and minimum */ minmax /* you fill in here */); outfile

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions

Question

Solve the systems xi-05, ti nilo 2 = -22-0.522; () =

Answered: 1 week ago

Question

what are the provisions in the absence of Partnership Deed?

Answered: 1 week ago

Question

1. What is called precipitation?

Answered: 1 week ago

Question

1.what is dew ?

Answered: 1 week ago

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago