Question: Write a C++ program using object-oriented principles that will display the National Champion of NCAA College Football for the year the user enters. The valid
Write a C++ program using object-oriented principles that will display the National Champion of NCAA College Football for the year the user enters. The valid years that may be entered are from 1998 - 2022. An input file - named NationalChampionship.txt - has been created that contains: the year and the school team that won the National Championship. It should be located in the current directory. To begin, the program should declare two arrays: one array to hold the year and another array to hold the school and team name. Populate the arrays with the values read in from the input file. Close the input file. Next, the program should prompt the user to enter a year. Validate the user's input value. If the user enters an invalid year, display an error message and let the user retry as many times as needed. When a good input year is entered, the program must find the corresponding year in the first array. Then, the program must look in the second array to find the name of the team that won the national championship for that year. Display that value. Continue to prompt the user for another year until the user wishes to stop. Make it clear how you would like for the user to stop.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
