Write a program that prompts the user to enter the number of students and each student’s score, then finally displays the highest score.
What will be an ideal response?
```
#include
using namespace std;
int main()
{
// Prompt the user to enter the number of students
cout << "Enter the number of students: ";
int numberOfStudents;
cin >> numberOfStudents;
double score = -1;
for (int i = 0; i < numberOfStudents; i++)
{
cout << "Enter a student score: ";
int score1;
cin >> score1;
if (score < score1)
{
score = score1;
}
}
cout << "Highest score is " << score;
return 0;
}
```
You might also like to view...
The preferred way to traverse a two-dimensional array is to use .
a. a do while statement. b. a for statement. c. two nested for statements. d. three nested for statements.
Which of the following is the correct sequence for the instruction cycle?
A) Execute, fetch, and update B) Fetch, execute, and update C) Execute, update, and fetch D) Update, fetch, and execute
Combining multiple table cells into a single, larger cell is called ________
Fill in the blank(s) with correct word
You can spell-check an entire presentation by pressing the _____ key.
A. F2 B. F7 C. F9 D. F11