The task is to write a C++ program that reads exam scores and displays the average score and the high score. I'm able to make the code do everything but display the highest score, and I'm just not sure how to approach it. Any help would be much appreciated!
#include<iostream>
#include<math.h>
using namespace std;
int main( )
{
int number_of_tests, number_of_scores, scores, number_of_tests_2, total_scores;
double average_score;
cout << "Enter number of tests.\n";
cin >> number_of_tests;
number_of_tests_2 = number_of_tests;
cout << "Enter all test scores.\n";
while (number_of_tests_2 > 0)
{
number_of_tests_2 = number_of_tests_2 -1;
Add a variable maxScore = 0 and compare its value with each entry.
If it is less than the current entry then give it the value of that now highest entry.