Hello everyone. its my first post here but i have been monitoring this forum closely about any troubles i faced in programming.
Out teacher gave a program about functions, struct and arrays. I a bit weak in functions so need a little help. I need a example program just to see how functions work and will create my own one after that. So here is the exact question our teacher gave to us.
Write a program that reads students name followed by their test scores. The program then should output each student's name followed by the test scores and the relevant grade. It should also find and print the highest test score and the name of the students having the highest test score. Students data should be stored in a struct variable of type StudentType, which has four components: studentsFName and studentLName of type string, testscore of type int (test score is between 0 and 100), and grade of type char. Suppose that the class has 3 students. Use an Array of 3 components of type StudentType.
Your program must contain at least the following functions.
A. A function to read the students data into the array.
B. A function to assign the relevant grade to each student.
C. A function to find highest test score.
D. A function to print the names of the students having the highest test score.
thats it. I know this program requires many things but i only need a heads up about functions.
Just read a fundamentals of c++ tutorial, like the tutorial on this website.
Write the program without functions, then put the chunks of code into individual functions, then put the variables that the functions need into the parameters.
If you have any problems, show your code and make sure you format the code with code tags.