Question: Write program for this using C++ code Exercise 4: Arrays, Reading from File, and Writing to File Create a program that performs the following Prompts
Exercise 4: Arrays, Reading from File, and Writing to File Create a program that performs the following Prompts the user for a file name and stores it Prompt the user until they give the name of a file that can be opened Read in and store the double in the file then Create a copy of the values in another array of the same size Then, normalize the values in the copy (yes this will change values) The largest value is always normalized to 1.0 and the smallest to 0.0 The values in between are adjusted to be between 0 and 1 but represent their former ratios to the original number Hint (value - min)/ (max-min) Create a copy of the original array then reverse the order of value (@ g the first value in the original vill bo the last value in the new array) Once you have the normalized and reversed arrays, store them in two seperate files along with the original values Store the normalized array in a file called "normalized.tot Store the reversed array in a file called "reversed txt" Assume the user types in "input but'" as the file name and the fle contains the following 10.0 40.0 20.0 30.0 50.0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
