Question: #37 Code in C++ Highlight your code from HW36, and copy it using Ctrl-c. Then close your project, create a new project called HW37. Then

#37 Code in C++

 #37 Code in C++ Highlight your code from HW36, and copy

Highlight your code from HW36, and copy it using Ctrl-c. Then close your project, create a new project called HW37. Then hit Ctrl-V to copy the old source code into main.cpp. Edit the first line of main.cpp so that it is/*Homework 37/ Modify your program so that all of your numbers are stored in an array x [] of size N; a function called maximum) is used to calculate the maximum of the array; and a function called print ) is used to print the results to the either the screen or the file Specifications: Use the following function prototypes int maximum (int x[], int n); // Returns the maximum of the array x[ of size n void print (ostream &out, int x[, int n)i // Prints values in xn to the screen or to a file You must use the following constants and variable names for your main function N constant integer set to 5 (the number of values to be read in) fout output file stream object for writing data to the file x Array x] of size N to store the 5 numbers. The max variable from the previous problem can be used inside of your maximum needed in your main function function, but is no longer The program should use a for loop to enter the values into the array, call the print) function to print the results to the screen, and call the printO function once again to print the results to the file. Print a space between each value If you execute the program with the following underlined input, the results will be ~> main.o Enter a number: 5 Enter a number 3 Enter a number: 7 Enter a number: 9 Enter a number 2 Values: 5 3 7 9 2 Max: 9 more results.txt Values: 5 3 7 9 2 Max 9

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!