So my teacher gets mad at me when I ask questions so I'm coming here for your help cause you guys a life savers :)
So what I understand about this project is we have a file with numbers and we have to make an array to read it. I really dont know where to start with this. I made a txt file.
Any tips would be really appriciated. Thanks Guys and Gals!!
These are his direction they are sooo helpful :|
Below is a simple form. Place your email address in the box, and press the submit button. This will produce the name of an array, the name of an input file, the name of an output file, and a list of integer numbers of which the first one will be an exact count of the remaining numbers in the list. So if the first number in the list is 500, there will be 500 additional numbers in the list.
Copy and paste the number data, including the count into a plain text file with the name of the input file given. Your mission, if you choose to accept it, is to write a console program ( NO GUI ). Open and read the first line of this input file and create an integer array with the name of the array given and a size to match the first line of the file. So if the first line of the file contains 500, the array will have 500 slots. Read the remaining numbers into the array. Write a method named sort, which takes the array as a parameter, and sorts it from low to high. When the sort is complete, open and write a file with the name of the output file, the count will be first, followed by the sorted list of numbers (one per line). Finally, write a simple loop to compute the average of the numbers in the list (not including the count). Output this average as the last line of the output file. Be sure to use a double data type for the sum and average variables.