[SOLVED] CSC7081 Assessment -World Cup Stats analyser application

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Assessment-World-Cup-ku91yx.zip (768.6 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (2 votes)

World Cup Stats analyser application

You have been given a data file (WorldCupMatches.csv) that contains various details for each FIFA World Cup match from 1930 until 2014. You are tasked with writing an OOP based Java application that will enable the reading and searching of the data.

Create a project solution (named PGCert<your student id> e.g. PGCert2048201). Create a package named wc. Add WorldCupMatches.csv to the project. Ensure your name and student number are placed in the Javadoc comments of all the classes you write to support the application.

Part 1 – 50%

Using your knowledge of OOP:

1. Create a class Match.java that will represent each match detail. The class should have all the properties for each data point (attribute) of the match. Each attribute with appropriate validation rule is detailed below.

Attribute

Allowable values

Year

1930 (inclusive) onwards

Host

At least 1 character but less than 30

Stage

At least 1 character but less than 50

Stadium

At least 1 character but less than 80

City

At least 1 character but less than 40

Attendance

0 – 200000 (inclusive)

Home Team Name

At least 1 character but less than 35

Home Team Goals

0 – 15 (inclusive)

Away Team Goals

0 – 15 (inclusive)

Away Team Name

At least 1 character but less than 35

Win conditions

ET (extra time)
HWP (Home Win Penalties) AWP (Away Win Penalties)

Half-time Home Goals

0 – 15 (inclusive)

Half-time Away Goals

0 – 15 (inclusive)

Home Team Initials

Three characters

Away Team Initials

Three characters

Return an appropriate exception with an appropriate exception message e.g. “Invalid Home Goals”, “Invalid team name format” etc. if an attempt is made to set outside a range or allowable values.

2. You should fully unit test this class.

1

PG Cert Programming Summer 2020

Part 2 – Searches – 50%

Create a Stats.java class is designed to support the system for searching. It should have the application’s main method and then a series of methods calls.

Methods required:

  1. Read each match detail from the csv, creating an instance of the Match class (from Part 1) for each match and populate this arraylist : (which should be created with the Stats class.)

    public static ArrayList<Match> matches = new ArrayList<Match>(); Acting on this populated ArrayList then perform the following operations matching the format of the

    example outputs…

  2. Output to screen all details of all matches e.g.

    Match [year=2002, host=South Korea/Japan, stage=Group F, stadium=Saitama Stadium 2002, city=Saitama , attendance=52721, homeTeamName=England, homeTeamGoals=1, awayTeamGoals=1, awayTeamName=Sweden, winConditions= , halfTimeHomeGoals=1, halfTimeAwayGoals=0, homeTeamInitials=ENG, awayTeamInitials=SWE]

  3. Output to screen the total attendances of all matches and the average attendance (to two decimal points) for WC matches.

    Total attendances in all WCs : Average attendances:

  4. Output to screen the results of any searched for WC year. Eg. Searching for 1998 would output :

    All matches in WC France 1998 Brazil 2 : Scotland 1
    Morocco 2 : Norway 2
    Italy 2 : Chile 2

    Etc…

  5. Output to screen the results of any searched for country that has played in the WC e.g. Searching for Spain would output :

    Matches Spain have played in the WC Spain 3 : Brazil 1
    Italy 1 : Spain 1
    Italy 1 : Spain 0

    Spain 3 : USA 1 Etc…

2

PG Cert Programming Summer 2020

  1. Output to screen the following details for all WC final matches

    1930 Uruguay
    Uruguay 4 : Argentina 2

    1934 Italy
    Italy 2 : Czechoslovakia 1

    1938 France
    Italy 4 : Hungary 2

    Etc…

  2. Output to screen the total number of goals scored in all WC matches and the average goals per game (to

    two decimal places).

    Total goals in all WCs : Average goals per game :

  3. Output the details for the matches with the smallest attendance and also the largest attendance.

    Attendances
    Smallest attendance 2000
    Uruguay 1930 Estadio Centenario Uruguay CHI vs FRA

    Largest attendance etc…

  4. Output to screen the details of each match that went to extra time (i.e. Win Condition being set as ET) e.g.

    ET games
    1934 Italy Preliminary round Austria 3 : France 2

    1934 Italy Final
    Italy 2 : Czechoslovakia 1 Etc…

  5. Output to screen the details of each match that went to penalties. Win conditions either HWP or AWP e.g.

    Games that went to penalties 1990 Italy Semi-finals
    ITA 1 : ARG 1
    Winner : ARG

    Etc…

3

PG Cert Programming Summer 2020
11. Output to screen the percentage of games won by the team that were leading at half time.

When complete compress (zip) the Eclipse solution and upload to Assignments on CANVAS Now : check the upload to ensure you have submitted the correct files.

[END]

4

  • Assessment-World-Cup-ku91yx.zip