Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++program, I want the output look like the example in picture. Create a program that performs the following Prompts the user for a file name

C++program, I want the output look like the example in picture.image text in transcribed

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 (e.g. the first value in the original will be 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.txt Store the reversed array in a file called "reversed.txt Assume the user types in 'input.txt" as the file name and the file contains the following: 10.0 40.0 20.0 30.0 50.0 Example normalized.txt. Original array: [10.0, 40.0, 20.0, 30.0, 50.0] Normalized array: [0, .75, .25, .5, 1] Example of reserved.txt Original array: [10.0, 40.0, 20.0, 30.0, 50.0] Reversed array: [50.0, 30.0, 20.0, 40.0, 10.0] WARNING: We will test your program with different files that may have different contents. Test your program by changing the contents of your file and run your program again You shouldn't need to recompile your code even if the input file changes changes You can assume the file will be properly formatted and contain good data

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

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions