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

I just need help in writing the algorith for thisprogram. do not need the progra

ID: 3615842 • Letter: I

Question

I just need help in writing the algorith for thisprogram. do not need the program. Al i need is the algorithm.Here is the program Design, then write a computer C++ program to output testscores for a class. The design must include the algorith formain and for each of the functions you define; forthe function you define, also identify the function parameters andwhether they are passed by value or by reference. input: The first 10 floating point values ina data file h:test4.txt are the correct answers to a math test.Next the file contains data for each of the students in the classwho took the test: the student ID followed by student's 10 answers.The number of students is not specified, since the sample datacould be 20.3 41.7 9.5 -3.0 78.0 -78.22 -5.0 4.8 68.1 14.3 HU123     20.3 12.2 -8.0 -3.0 75.2 -78.2 -3.0 4.8 68.1 14.3 SM456     19.0 42.7 9.5 -3.0 70.0 -78.2 -5.0 4.8 68.1 14.3 Processing: Do not use global variables. Input and output usefiles, which are opened in main. Two functions arerequired; more may be used. The function readValues is to read 10input values from an input file and store them in an array. Inmain, a call to readValues is used to obtain ananswer key array; later a call to readValues isused to obtain an array of students answers. Define a function computerScore, which hasboth the answer key array and a student answer array as parameters;it computes the number correct (0 to 10) and makes this valueavailable in main. Output: Each line of the output file containsa student ID and the student's score. For example Student       Score HU123        6 SM456        8 I just need help in writing the algorith for thisprogram. do not need the program. Al i need is the algorithm.Here is the program Design, then write a computer C++ program to output testscores for a class. The design must include the algorith formain and for each of the functions you define; forthe function you define, also identify the function parameters andwhether they are passed by value or by reference. input: The first 10 floating point values ina data file h:test4.txt are the correct answers to a math test.Next the file contains data for each of the students in the classwho took the test: the student ID followed by student's 10 answers.The number of students is not specified, since the sample datacould be 20.3 41.7 9.5 -3.0 78.0 -78.22 -5.0 4.8 68.1 14.3 HU123     20.3 12.2 -8.0 -3.0 75.2 -78.2 -3.0 4.8 68.1 14.3 SM456     19.0 42.7 9.5 -3.0 70.0 -78.2 -5.0 4.8 68.1 14.3 Processing: Do not use global variables. Input and output usefiles, which are opened in main. Two functions arerequired; more may be used. The function readValues is to read 10input values from an input file and store them in an array. Inmain, a call to readValues is used to obtain ananswer key array; later a call to readValues isused to obtain an array of students answers. Define a function computerScore, which hasboth the answer key array and a student answer array as parameters;it computes the number correct (0 to 10) and makes this valueavailable in main. Output: Each line of the output file containsa student ID and the student's score. For example Student       Score HU123        6 SM456        8 Design, then write a computer C++ program to output testscores for a class. The design must include the algorith formain and for each of the functions you define; forthe function you define, also identify the function parameters andwhether they are passed by value or by reference. input: The first 10 floating point values ina data file h:test4.txt are the correct answers to a math test.Next the file contains data for each of the students in the classwho took the test: the student ID followed by student's 10 answers.The number of students is not specified, since the sample datacould be 20.3 41.7 9.5 -3.0 78.0 -78.22 -5.0 4.8 68.1 14.3 HU123     20.3 12.2 -8.0 -3.0 75.2 -78.2 -3.0 4.8 68.1 14.3 SM456     19.0 42.7 9.5 -3.0 70.0 -78.2 -5.0 4.8 68.1 14.3 Processing: Do not use global variables. Input and output usefiles, which are opened in main. Two functions arerequired; more may be used. The function readValues is to read 10input values from an input file and store them in an array. Inmain, a call to readValues is used to obtain ananswer key array; later a call to readValues isused to obtain an array of students answers. Define a function computerScore, which hasboth the answer key array and a student answer array as parameters;it computes the number correct (0 to 10) and makes this valueavailable in main. Output: Each line of the output file containsa student ID and the student's score. For example Student       Score HU123        6 SM456        8 Output: Each line of the output file containsa student ID and the student's score. For example Student       Score HU123        6 SM456        8

Explanation / Answer

please rate - thanks I don't know in what form you need the algorithm so hope thisworks main     define variables         key doublearray 10         answersdouble array 10         string id         int code,count         boolean valid open input file open output file     print heading to output file    valid=readValues(0,key)     valid=readValues(1,id,answers)     while valid is true                            valid being 1 says there was dataread            count=computerScore(key,answers)             output to file id, count             valid=readValues(1,id,answers) close input & output files FunctionreadValues       receives 3 parameters returns 1 boolean                                         the boolean returned is a code to say if eof was encounterd                                         returns true if data read, returns false if no data (eofencountered)                                     1st parameter, integer call by value, is a code 0 means don't readid just read 10 doubles                                                                                                        1 means read id and 10 doubles                                     2nd parameter, integer, reference parameter, returns the idif 1 exists, has 0 otherwise                                      3rd parameter, double array, arrays are reference parameters bydefinition if code =1 read id eof encountered return false read first number eof encountered return false for loop 1-9 read array return true functioncomputerScore      receives 2parameters both by value,   --1st string id, 2nd integernumber       output id, score