Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need this in less than 3 hours! Please someone help and I willgive you highest

ID: 3614113 • Letter: I

Question

I need this in less than 3 hours! Please someone help and I willgive you highest possible points.
Write a program that lets the user enter 10 values into anarray. The program should then display the largest and smallestvalues stored in the array. Must follow these guidelines: Use a 10 element array of type float ? Use a file to read to read in the values. Prompt the userfor the filename to open and read the data from. There can be lessor more than 10 data items in the file. Remember to close thefile after reading the elements! ? Two loops should be used for this program: i. Indeterminate while loop to read data from file untilthe maximum number of data items have been read (i.e. 10) OR the end of the file has been reached, whichever comesfirst ii. Single counter controlled for loop to determine thelargest and smallest elements in the array
I have this code but its not reading the file for somereason!
#include <iostream> #include <fstream> using namespace std;
int main() { const int SIZE = 10; float input[SIZE]; fstream dataFile; cout << "What is the name of the data file? (File mustbe stored in drive C.) "; //cin >> fileName; dataFile.open("C:\data.txt"); if (!dataFile) { cout << "Error in opening file."; return 0; } while (!dataFile.eof()) { dataFile.read(reinterpret_cast<char *>(input),sizeof(input)); } for (int count = 0; count < SIZE; count++) cout << input[count]; cout << endl;
dataFile.close(); }
Write a program that lets the user enter 10 values into anarray. The program should then display the largest and smallestvalues stored in the array. Must follow these guidelines: Use a 10 element array of type float ? Use a file to read to read in the values. Prompt the userfor the filename to open and read the data from. There can be lessor more than 10 data items in the file. Remember to close thefile after reading the elements! ? Two loops should be used for this program: i. Indeterminate while loop to read data from file untilthe maximum number of data items have been read (i.e. 10) OR the end of the file has been reached, whichever comesfirst ii. Single counter controlled for loop to determine thelargest and smallest elements in the array
I have this code but its not reading the file for somereason!
#include <iostream> #include <fstream> using namespace std;
int main() { const int SIZE = 10; float input[SIZE]; fstream dataFile; cout << "What is the name of the data file? (File mustbe stored in drive C.) "; //cin >> fileName; dataFile.open("C:\data.txt"); if (!dataFile) { cout << "Error in opening file."; return 0; } while (!dataFile.eof()) { dataFile.read(reinterpret_cast<char *>(input),sizeof(input)); } for (int count = 0; count < SIZE; count++) cout << input[count]; cout << endl;
dataFile.close(); } Use a 10 element array of type float ? Use a file to read to read in the values. Prompt the userfor the filename to open and read the data from. There can be lessor more than 10 data items in the file. Remember to close thefile after reading the elements! ? Two loops should be used for this program: i. Indeterminate while loop to read data from file untilthe maximum number of data items have been read (i.e. 10) OR the end of the file has been reached, whichever comesfirst ii. Single counter controlled for loop to determine thelargest and smallest elements in the array
I have this code but its not reading the file for somereason!
#include <iostream> #include <fstream> using namespace std;
int main() { const int SIZE = 10; float input[SIZE]; fstream dataFile; cout << "What is the name of the data file? (File mustbe stored in drive C.) "; //cin >> fileName; dataFile.open("C:\data.txt"); if (!dataFile) { cout << "Error in opening file."; return 0; } while (!dataFile.eof()) { dataFile.read(reinterpret_cast<char *>(input),sizeof(input)); } for (int count = 0; count < SIZE; count++) cout << input[count]; cout << endl;
dataFile.close(); } #include <iostream> #include <fstream> using namespace std;
int main() { const int SIZE = 10; float input[SIZE]; fstream dataFile; cout << "What is the name of the data file? (File mustbe stored in drive C.) "; //cin >> fileName; dataFile.open("C:\data.txt"); if (!dataFile) { cout << "Error in opening file."; return 0; } while (!dataFile.eof()) { dataFile.read(reinterpret_cast<char *>(input),sizeof(input)); } for (int count = 0; count < SIZE; count++) cout << input[count]; cout << endl;
dataFile.close(); }

Explanation / Answer

please rate - thanks #include #include using namespace std; int main() { const int SIZE = 10; int i,j; float input[SIZE],max,min; fstream dataFile; char filename[20]; cout > filename; dataFile.open(filename); //dataFile.open("C:\data.txt"); if (!dataFile) { cout input[i]; i++; //dataFile.read(reinterpret_cast(input),sizeof(input)); } min=input[0]; max=input[0]; for(j=1;jmax)         max=input[j];     else if(input[j]
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote