Submission and Grading: All programs are to be submitted in eLearning. The pseudocode should be submitted as a Word or PDF document. Please submit the program as a .cpp file only. Projects submitted after the due date are subject to the late penalties described in the syllabus. Programs must compile and run in Code::Blocks. Each submitted program will be graded with the rubric provided in eLearning as well as a set of test cases. These test cases will be posted in eLearning after the due date. Each student is responsible for developing sample test cases to ensure the program works as expected.
Objective: Implement loops into a modular program. Use basic file I/O to retrieve and record data.
The file I/O concepts necessary for this assignment will not be introduced in class until a week prior to the due date. I encourage you to have the basic logic for calculations programmed within the first week so that you can add in the file I/O concepts in the second week. You may also want to read ahead about file I/O (see the syllabus for reading assignments on the topic).
This project (and its pseudocode) will be used as the basis for project 5. Make sure that all of the logical decisions you make are useful and can easily be modified if necessary.
Problem: Now that the Mushroom Kingdom League has ended and crowned a new champion, it is time to determine the league leaders in several different baseball categories. Being the only person in the MushroomKingdom that knows how to write a computer program, you have been asked by Princess Peach herself to write a program that will determine the league leaders. There will be no user interface for this program since all input will be read from a file.
Input: All input will be read from a file. Each player’s data will be listed on separate lines in the file and will follow the same format. All data in the file will be valid.
The input file will be named stats.txt
Format: <name><space><batting record>
o Mario HOOKWSHHKOHPWWHO
The name will be a single word.
The batting record will be a series of capital letters representing various results during a baseball
o H – hit
Output: All output will be written to a file named leaders.txt. Each person’s individual stats should be written to the file before proceeding to the next line of input. After each person has been processed, write the league leaders for each category to the file. Review the sample file posted in eLearning.