Question: hello can someone please explain this, thanks in C ++ Part A (79 points) Algorithm solution (in pseudocode): 1. Declare variable inFile to get the

hello can someone please explain this, thanks

in C ++

hello can someone please explain this, thanks in C ++ Part A

Part A (79 points) Algorithm solution (in pseudocode): 1. Declare variable inFile to get the data from an input file 2. Declare a named constant MAX 100 3. Declare an array of strings named name that holds up to MAX elements 4. Declare an array of whole numbers named grade that holds up to MAX elements 5. Declare variables quantity, x, avg, and sum (initialized to zero) that hold whole numbers 6. Open file indata3.txt 7. Check if the file was opened (if not opened, show an error message and stop the program) 8. Set x to 0 9. Read a name and a grade from the file and assign them to namex] and grade[x] respectively 10. While (not-end-of-file) 11. Increment x 12. Read a name and a grade from the file and assign them to name[x] and grade[x] respectively 13. Print "Enter quantity of grades to be processed (0-, x, "): " 14. Read a value from the keyboard and assign it to quantity 15. For (x-0 to quantity-1) 16. Acumulate grade[x] in sum 17. Assign to avg the value returned by average (sum, quantity) 18. Print "Average grade: ", avg 19. Print "Name", "GaComment 20 For (x 0 to quantity-1) 21. Print), name[x], grade[x] 22. If (grade[x]avg) 25 26. Else 27 28. Close the file Print" below average" Print" above average Print" average Function average() receives the values of sum and quantity, calculates the average, and rounds it to the nearest whole number (ones) before returning it. Use appropriate type casting to avoid loss of information when calculating the average. Note: if the value of quantity is zero, the function returns 0, otherwise it returns the average. Part B (21 points) Modify part A so that it uses the functions described below to get and print the data Function getData) receives the input file, array name, array grade, and retums the arrays with the data read from the file along the quantity of values read from file. Function printData) receives array name, array grade, quantity of values to print, and the value of the grade average. Run my sample solution to see the output it must generate

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!