<p>I will send description file and other files to solve this</p> <p>plz. help m
ID: 3621941 • Letter: #
Question
<p>I will send description file and other files to solve this</p><p>plz. help me up</p>
<p>description(formula is wrong in there)</p>
<p>The possible grades for this project are 30, 25, 20, 15, 10 or 0 points.<br />Grading based on instructor analysis of your program.<br />Your program must input 0 to 20 integers from a user-specified input file and store those integers in a onedimensional<br />array. When opening the input file, the user must continue to enter a file name until they<br />enter a file name correctly or type ctrl-c to exit. If more than 20 integers exist in the input file, the first 20<br />only are read. After reading in the values, the program prints out the number of values read and those<br />values. Your program then should sort the integers into descending order (largest to smallest) – a<br />possible sorting algorithm (from smallest to largest) is described on the next page. Once sorted, the<br />integers should be printed to standard output. Finally, your program must compute the sum, average,<br />variance, and standard deviation of the values as shown in the sample solution. Use the equations below to<br />compute the required statistics. The program needs to handle the case where there are no values in the<br />input file (empty input file). You will need to type cast to double data types to avoid integer division.<br />Output statistic values to 2 decimal places. Assume all values in the files are integers.</p>
<p>Arithmetic Sum: the formula <br />1 Arithmetic Mean:     n<br />i i<br />sum<br />avg x<br />n n<br />x<br />x<br />1<br />1<br />Variance:   <br /><br /> n<br />i i avg x x<br />n 1<br />( )2<br />1<br />1<br />var Standard Deviation:   var<br />Note:  <br />n<br />i i x<br />1 is a summation symbol that indicates to sum all X values. If the values of X are stored in<br />an array, then i x corresponds to the array element x[i 1] . In the above equations, n represents the<br />number of integers read from the input file.<br />Your program’s output (all messages output) must match that produced by the provided<br />sample solution. All messages output starting with ####> are optional. If your program can<br />produce that output correctly, you will receive +5 additional points. To get the additional<br />points, the program must correctly handle all input files contained in P12_in.zip. You may<br />run the sample solution Project_12_solution by typing the following at a command prompt<br />in a terminal window:<br />/home/work/cpe112/Executables/Project_12/Project_12_solution<br />Provided sample input files: are zipped in the file P12_in.zip<br />be sure to read the README.txt file included in the zip file<br /><Project 12 Directions><br />On Project 12, you may only use concepts presented in Chapters 1 - 12 of your textbook!!<br />Using your favorite text editor, type your solution and save it as a file named Program_12.cpp within your<br />CPE112_FALL10/Project_12 directory. If there are syntax errors, correct them and compile again. Once<br />your program successfully compiles, run it and verify that the output for your modified program matches the<br />output from the solution executable – Project_12_solution.<br /><br />< Project 12 Design Requirements ><br />Your solution must include at least 4 functions in addition to the function main().<br />The following is one possible method that will sort a list of numbers<br />Ascending Sort Algorithm - similar to the sorting algorithm required in the program<br />(Elements highlighted in gray have not been sorted yet.)<br />Example: 18 16 4 23 2<br />A[0] A[1] A[2] A[3] A[4]<br />Step 1: Of the unsorted elements in array A, find the index of the smallest element.<br />In this example, the value 2 is stored in A[4]<br />Step 2: Swap the element currently in position 0 with the element in position 4<br />2 16 4 23 18<br />A[0] A[1] A[2] A[3] A[4]<br />Step 3: Of the unsorted elements in array A, find the index of the smallest element.<br />In this example, the value 4 is stored in A[2]<br />Step 4: Swap the element currently in position 1 with the element in position 2<br />2 4 16 23 18<br />A[0] A[1] A[2] A[3] A[4]<br />Step 5: Of the unsorted elements in array A, find the index of the smallest element.<br />In this example, the value 16 is stored in A[2]<br />Step 6: Swap the element currently in position 2 with the element in position 2<br />2 4 16 23 18<br />A[0] A[1] A[2] A[3] A[4]<br />Step 7: Of the unsorted elements in array A, find the index of the smallest element.<br />In this example, the value 18 is stored in A[4]<br />Step 8: Swap the element currently in position 3 with the element in position 4<br />2 4 16 18 23<br />A[0] A[1] A[2] A[3] A[4]<br />Step 7: Of the unsorted elements in array A, find the index of the smallest element.<br />In this example, the value 23 is stored in A[4]<br />Step 8: Swap the element currently in position 4 with the element in position 4<br />2 4 16 18 23<br />A[0] A[1] A[2] A[3] A[4]<br />Note that there are two basic operations that are repeated until all the elements are sorted:<br />- Locating the “smallest” of the unsorted elements<br />- Swapping the position of smallest unsorted element with that of the first unsorted element<br />Each of these operations can be implemented as a separate function.<br />Descending Sort Algorithm – what is required in the program<br />Instead of locating the smallest unsorted element and moving it to the lead position, locate the largest<br />unsorted element and move it to the lead position using a swap function. The code that finds the “largest”<br />unsorted element is easily implemented as a function.</p>
Explanation / Answer
Dear, Please post remaining questions on another post #include #include using namespace std; int main() { int num[20],temp; ifstream instream; instream.open("input.txt",ios::in); if(!instream) { coutnumber; num[i]=number; while(instream != NULL) { i++; instream>>number; // read data from file num[i]=number; } int size=i; for ( int i = 0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.