Microsoft Word - INFO1214 W2021 Project Contest Scoreboard Ver 1.0.docx 1 INFO1214 W2021 Course: INFO1214 Winter 2021 Project Professor: Stacey Kazmir Project: Programming Contest Scoreboard Ver 1.0...

i attach the pdf file


Microsoft Word - INFO1214 W2021 Project Contest Scoreboard Ver 1.0.docx 1 INFO1214 W2021 Course: INFO1214 Winter 2021 Project Professor: Stacey Kazmir Project: Programming Contest Scoreboard Ver 1.0 Due Date: Friday, April 9, 2021 by 11:59 (2359) EST Description: Students from Fanshawe College have competed in the International Collegiate Programming Contest (ICPC) almost every year since 2002. While this competition draws teams from around the world, Fanshawe College competes directly in a regional face-off that includes universities and colleges from Ontario, Michigan, Illinois, Pennsylvania and Ohio. This regional contest is known as the ECNA (East Central North America) regional programming contest. In recent years our teams have travelled to Windsor, Ontario to participate. Due to the COVID-19 pandemic, the fall 2020 contest was cancelled, so the data used in this project comes from the 2019 contest. A total 24 Canadian university and college teams met in Windsor. However, there were actually 115 teams in total since the U.S. teams congregated at three other ECNA-designated sites that are in the United States. The students from each school work in teams to solve a set of problems. In 2019 there were eleven problems in the problem set. Each problem could be solved by writing a console program in either Java, C/C++ or Python. Each team submitted a solution to a problem in the form of a source code file. The solutions were submitted to the judge using a Web-based application known as Kattis. The judge tested each submission for correctness and replied to the submitting team with either a “yes” meaning correct or a “no” meaning incorrect. When a team submitted an incorrect solution, they could attempt to correct their solution and resubmit. The winning team was the one that solved the most problems. However, in some cases there were multiple teams that solved the same number of problems. To break any ties or draws, the teams were then also ranked by the total accumulated time they used to submit their correct solutions. An additional penalty of 20 minutes was then added for each incorrect solution submitted along the way. For example, two teams solved six problems each, but “UofT Deep Blue” with 901 accumulated minutes was ranked higher than “McMaster Zetta” with 1,390 minutes. This ranking system is also explained here on the ECNA website under the heading “Scoring”. Throughout the five hours (300 minutes) of the contest, Kattis generated a log of all submissions made by every team along with the “yes” or “no” judgement for each submission. This log was used to generate a scoreboard summarizing the results for each team. Here is a partial scoreboard from this year: ECNA Contest 2019 (Windsor Only) Team Slv/Time P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11 Brock Badgers 4/691 Y/4 N/0 N/0 N/0 Y/4 Y/1 Y/1 N/0 N/0 N/0 N/0 Brock Generals 1/112 N/0 N/0 N/0 N/0 N/0 Y/1 N/1 N/0 N/0 N/0 N/0 Fanshawe Black 2/176 N/3 N/0 N/0 N/0 N/19 Y/1 Y/1 N/0 N/0 N/0 N/0 Fanshawe Red 2/270 N/2 N/0 N/0 N/0 N/0 Y/2 Y/1 N/0 N/0 N/0 N/0 McMaster Giga 3/542 N/0 Y/2 N/0 N/0 N/0 Y/1 Y/1 N/3 N/0 N/0 N/0 Each row in the scoreboard represents a specific team. The columns contain the following information, from left to right:  Team - the name of the team  Slv/Time - the total number of problems solved / the total time used to solve the problems  Pn – for problem n, Y (solved) or N (unsolved) / the number of attempts submitted to the judge For this project you will code a Java program that obtains data for each submission from the log file then generates and displays a contest scoreboard including a title and column labels (shown above). The output will also report the number of submissions, which is not seen above because only the top few rows of the scoreboard are shown. However, the full scoreboard is shown on page 4. 2 INFO1214 W2021 Basic requirements: Create a main class called Your_Initials_Scoreboard containing your program’s main method, but your replace Your_Initials with your initials. Also create a helper class called Your_Initials_ScoreboardMethods to contain any helper methods you code for your solution. All helper methods you create should go in this second class file. Note that the section “Use of Methods” later in this document details some methods that you must include in your solution. Make sure to read this before you begin writing your code! The input files Note that your program will not require any keyboard inputs from the user. Instead, your program will obtain input data from two tab-delimited text files as follows: submissions.txt Contains the data for all solutions submitted during the contest as follows:  The first line of the file contains a title or description of the contest which should be displayed at the top of your scoreboard. This can include spaces.  The second line contains the following four fields which are positive integers that can be stored using the int data type: 1. The number of teams 2. The number of problems in the problem set 3. The duration of the contest in minutes 4. The number of minutes to be added to a team’s total time for each incorrect submission  Each remaining line in the file represents one team submission and contains the following four fields: 1. The id (number) of the team that made the submission, from 1 to the number of teams 2. The time (number of minutes from the start of the contest) when the submission was made, from 1 to the contest duration 3. The id (number) of the problem, from 1 to the number of problems 4. An uppercase letter, either ‘Y’ (meaning solved) or ‘N’ (meaning not solved) The first three fields are positive integers that can be stored using the int data type. teams.txt Contains data for each team entered in the contest. Each row represents one team with the following two fields: 1. A positive integer (an int) that is a team id (number), from 1 to the number of teams 2. A team name as a string which may contain spaces and could be any length Reading the data You will need to read the data from the two files (submissions.txt and teams.txt) into one or more data structures in your program to be processed. You are required to validate each line of input in the submissions file, which contains information about a single submission to the judge. You will need to verify that the team ID, the time of the submission, the problem ID, and the judgement all have reasonable values. You can use the information in the above section “The Input Files” to determine what values are valid for these fields. You should do this first before you use the data in your program. If any field of a submission is invalid you should not process it. However, you should keep track of how many valid submissions and how many invalid submissions were read by your program. This information will appear in your program’s output later. 3 INFO1214 W2021 You may organize the data read-in from the files in your own way, however you will need to use a data structure to store the scoreboard data and this could involve some combination of arrays. One approach is to use three arrays to store all the data required to build the scoreboard. This approach is outlined in the following paragraphs. A submissions array would hold the number of submissions (an integer) for each problem and for each team. This would be a two-dimensional array with one row for each team and one column for each problem. The second line of the submissions file contains the information you need to determine the size of this array. The row and column indexes would correspond to the team id and the problem id respectively. You would be able to populate this array by reading each line of the submissions file, field-by-field, using a loop and then incrementing the element in the submissions array at the corresponding row and column. Keep in mind that the team ids and the problem ids start at 1 while the row and column indexes start at 0. A two-dimensional times array would be needed to store the time (an integer) for each problem solved by each team. Again, there would be one row for each team and one column for each problem so it would have the same dimensions as the submissions array. This array would also be populated while reading through the data in the submissions file. In fact, in could be done using the same file-reading loop! The array would only need to be updated if the last field of a line in the submissions file contains a ‘Y’ indicating that the problem was correctly solved with that submission. This would involve assigning the time of the submission to the array element at the corresponding row (team id) and column (problem id). Note that the time field for any submission that was incorrect (last field is ‘N’) does not have any effect on a team’s total time. The teams array would be a regular one-dimensional array of Strings with one element per team. This would be populated by reading the teams file and assigning one team name to each element
Mar 31, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here