The program will accept the final marks of a group of students in a class.

The lecturer can choose '1' to finds the highest and lowest marks in the class. The lecturer choose '2' to find the average marks of that class.
If user enter other number, message "wrong choice" will be display.
Write a pseudocode and complete C++ program.

Pseudocode:

1. Initialize an empty array to store the marks of the students.
2. Prompt the lecturer to enter the number of students in the class.
3. Create a loop to accept the marks of each student and store them in the array.
4. Prompt the lecturer to choose an option: 1 for highest and lowest marks, 2 for average marks.
5. Based on the choice, calculate and display the highest and lowest marks or the average marks.
6. If the choice is not 1 or 2, display an error message.
7. End the program.

C++ program:

#include <iostream>
using namespace std;

int main() {
int marks[100], numStudents, choice;
int highestMark, lowestMark;
double sum = 0, average;

cout << "Enter the number of students: ";
cin >> numStudents;

cout << "Enter the marks of the students: " << endl;
for(int i=0; i<numStudents; i++) {
cout << "Enter mark for student " << (i+1) << ": ";
cin >> marks[i];
}

cout << "Choose an option:" << endl;
cout << "1. Find highest and lowest marks" << endl;
cout << "2. Find average marks" << endl;
cin >> choice;

if(choice == 1) {
highestMark = marks[0];
lowestMark = marks[0];

for(int i=1; i<numStudents; i++) {
if(marks[i] > highestMark)
highestMark = marks[i];
if(marks[i] < lowestMark)
lowestMark = marks[i];
}

cout << "Highest mark: " << highestMark << endl;
cout << "Lowest mark: " << lowestMark << endl;
}
else if(choice == 2) {
for(int i=0; i<numStudents; i++) {
sum += marks[i];
}

average = sum / numStudents;

cout << "Average mark: " << average << endl;
}
else {
cout << "Wrong choice!" << endl;
}

return 0;
}