Lab6

Download Category:

Lab6.zip - (593.93 KB)
[
Lab6/Debug/
Lab6/Debug/cl.command.1.tlog
Lab6/Debug/CL.read.1.tlog
Lab6/Debug/CL.write.1.tlog
Lab6/Debug/Lab6.exe
Lab6/Debug/Lab6.exe.embed.manifest
Lab6/Debug/Lab6.exe.embed.manifest.res
Lab6/Debug/Lab6.exe.intermediate.manifest
Lab6/Debug/Lab6.ilk
Lab6/Debug/Lab6.lastbuildstate
Lab6/Debug/Lab6.log
Lab6/Debug/Lab6.obj
Lab6/Debug/Lab6.pdb
Lab6/Debug/Lab6.vcxprojResolveAssemblyReference.cache
Lab6/Debug/Lab6.write.1.tlog
Lab6/Debug/Lab6_manifest.rc
Lab6/Debug/link.8792.read.1.tlog
Lab6/Debug/link.8792.write.1.tlog
Lab6/Debug/link.8792-cvtres.read.1.tlog
Lab6/Debug/link.8792-cvtres.write.1.tlog
Lab6/Debug/link.command.1.tlog
Lab6/Debug/link.read.1.tlog
Lab6/Debug/link.write.1.tlog
Lab6/Debug/link-cvtres.read.1.tlog
Lab6/Debug/link-cvtres.write.1.tlog
Lab6/Debug/mt.command.1.tlog
Lab6/Debug/mt.read.1.tlog
Lab6/Debug/mt.write.1.tlog
Lab6/Debug/rc.command.1.tlog
Lab6/Debug/rc.read.1.tlog
Lab6/Debug/rc.write.1.tlog
Lab6/Debug/vc100.idb
Lab6/Debug/vc100.pdb
Lab6/Lab6.cpp
Lab6/Lab6.sln
Lab6/Lab6.suo
Lab6/lab6.txt
Lab6/Lab6.vcxproj
Lab6/Lab6.vcxproj.filters
Lab6/Lab6.vcxproj.user
Lab6/Question.txt
Lab6/Screenshot_1.jpg
]

Write a program that reads a text file containing a number of test scores into an array and calculates the average and median of the scores. Define a constant to hold the array size and use it to declare the array that holds the scores.const int MAX_SCORES = 40;You will need to implement the following functions:int getScores (int scores[], int array_size, int& num_scores);This function should open the file lab6.txt and read the scores into an array. The function will return SUCCESS if it opens the file successfully and ERROR if the file cannot be open. Define SUCCESS and ERROR as global constants in your program.array_size is the maximum number of scores that you can read from the file. You need it to make sure you don’t overstep the array boundaries. Even if the file has more than array_size scores, you can’t read them all. The limit is array_size.num_scores will have the actual number of scores read from the file. You need it in case the actual number of scores found in the input file is less than the array size.double calcAverage (int scores[], int num_scores);This function should calculate and return the average of the scores passed as parameters.double calcMedian (int scores[], int num_scores);This function should return the median value in the array. To get the median, the array must be sorted first.Implement the SelectionSort function taught in class.Test your program with different input files.

Write a Review

Get a fresh solution of this question. Ask it now to our experts.
doubt

Ask Your Question

We have verified professionals who are ready to answer your question.

time

Save Time and Money

We choose experts who can quickly answer your question and that suit your budget.

download

Get Your Answer

Your satisfaction is 100% guaranteed. You can keep on asking questions until you get the answer you need.