


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



I. Add your name, surname, and student number as a comment line at the top of each of your programs. II. Use sensible comments to explain your program logic where necessary. III. Save your C++ project, and upload only the main.cpp to CodeGrade
You are required to develop a menu-driven program for managing a classroom quiz tournament. The program must allow the user to input student names and scores, manipulate the list, identify top scores, and award bonus points. The program must use arrays to store both names and scores and run inside a loop until the user chooses to exit. You must implement the following functionalities: Prompt the user to enter the number of students participating in the tournament. This number must be between 1 and 100 (inclusive). Validate the input: if the number entered is outside the allowed range, display an error message and prompt again until a valid number is entered. Store the student names in a string array and their scores in an int array. Prompt for each student's name and their score (integer). If the number is invalid: After all the names and scores have been entered, randomize the order of students and their corresponding scores using the rand() function. Ensure that names and scores remain correctly paired after shuffling. Example (order before shuffle): Example (order after shuffle): Display a menu in the following format every time the user return to the main menu: ====== Menu ======
Use a do-while loop to repeatedly display this menu until the user chooses to exit by selecting option 5. Menu Option Functionalities: Option 1 - Display all students and their scores in a numbered list. Use formatted output with setw() to align names and scores as follows: Option 2 - Determine the highest score in the list. If only one student has this score, display their name and score. If there is a tie (multiple students have the highest score), list all tied students. From the tied students, randomly select one for a bonus question. Ask the user if the selected student answered correctly (y or n). If yes, award 10 points to their score. Example (Single Top Scorer): Example (Tie and Bonus Awarded): Option 3 - Display the current list with position numbers. Prompt the user to select two positions to swap (value between 1 and size). Swap both names and scores for the selected students. Display the updated list after swapping. Validate the position entered and display an error if out of range. Option 4 - Prompt the user for the name of the student to receive a bonus. Search for the student in the array (case-sensitive exact match). If found, prompt for the number of bonus points to add and update their score. If not found, display an error message: "Student not found. Please make sure you typed the correct name." Student List with Scores: