Williams, Justin à Player name (last name, first name) CAR

Similar documents
CS 112 Introduction to Programming

Assignment A7 BREAKOUT CS1110 Fall 2011 Due Sat 3 December 1

Database of Winds and Waves. -internet version-

CS Lecture 5. Vidroha debroy. Material adapted courtesy of Prof. Xiangnan Kong and Prof. Carolina Ruiz at Worcester Polytechnic Institute

2014 Hockey Arbitration Competition of Canada

NCSS Statistical Software

2013 HOCKEY ARBITRATION COMPETITION OF CANADA. Carl Gunnarsson v. Toronto Maple Leafs. Submission on Behalf of the Player. Midpoint: $3.

IN THE MATTER OF SALARY ARBITRATION BETWEEN: CODY FRANSON -AND- THE TORONTO MAPLE LEAFS SUBMISSION OF BEHALF OF THE TORONTO MAPLE LEAFS TEAM 28

Tecniche di Progettazione: Design Patterns

2013 Hockey Arbitration Competition of Canada. Carl Gunnarsson v Toronto Maple Leafs Submission on Behalf of Carl Gunnarsson Submission by Team 24

2014 Hockey Arbitration Competition of Canada. Lars Eller v. The Montreal Canadiens. Team 10. Submission on Behalf of Lars Eller

How to use the waypoint module

Tecniche di Progettazione: Design Patterns

List of Figures Introduction The PDF Document The Skater Spreadsheet The Goalie Spreadsheet...

Unchained Malady A Tangle of Times

The Game of Yinsh (Phase II)

2013 HOCKEY ARBITRATION COMPETITION OF CANADA. Chris Stewart v St. Louis Blues (NHL) SUBMISSION ON BEHALF OF CHRIS STEWART TEAM #14

Leaguestat Daily Report for the SJHL

NHL SALARY ARBITRATION CHRIS STEWART AND THE ST. LOUIS BLUES BRIEF IN SUPPORT OF CHRIS STEWART

Section 5.1 Randomness, Probability, and Simulation

The Dream Team An Office Simulation for the Sports Minded Student 2 nd Quarter

NHL Statistics Feeds

Navigate to the golf data folder and make it your working directory. Load the data by typing

Black Box testing Exercises. Lecturer: Giuseppe Santucci

The system design must obey these constraints. The system is to have the minimum cost (capital plus operating) while meeting the constraints.

- 2 - Companion Web Site. Back Cover. Synopsis

2013 Hockey Arbitration Competition of Canada

Background Information. Project Instructions. Problem Statement. EXAM REVIEW PROJECT Microsoft Excel Review Baseball Hall of Fame Problem

Lab 2: Probability. Hot Hands. Template for lab report. Saving your code

2013 Hockey Arbitration Competition of Canada

Lars Eller v. Montreal Canadiens

Registering Club players in Whole Game Club Official Training Guide

The PPD hosts an annual tournament named the Tournament of Champions (TOC) in Kansas City each October.

System Administration Tasks

OKLAHOMA MATH DAY. Instructions for the SOONER MATH BOWL

ARCCOS 360 NEW USER GUIDE

BFH/HTA Biel/DUE/Course 355/ Software Engineering 2. Suppose you ll write an application that displays a large number of icons:

Microsoft Windows Software Manual for FITstep Stream Version 4

Iteration: while, for, do while, Reading Input with Sentinels and User-defined Functions

BIOL 101L: Principles of Biology Laboratory

HOCKEY ARBITRATION COMPETITION OF CANADA

How to Use My MS Access Hockey Statkeeper

Solutionbank S1 Edexcel AS and A Level Modular Mathematics

What Does It Mean to Draft Perfectly in the NHL?

A red string is 40 cm longer than a green string. If the total length of the red string and the green string is 160 cm, how long is the green string?

Statistical Measures

ORF 201 Computer Methods in Problem Solving. Final Project: Dynamic Programming Optimal Sailing Strategies

A Novel Approach to Predicting the Results of NBA Matches

The ICC Duckworth-Lewis-Stern calculator. DLS Edition 2016

TRADING INSIGHTS- MISSED OPPORTUNITIES LATENCY GATEWAY

Working with Object- Orientation

Apple Device Instruction Guide- High School Game Center (HSGC) Football Statware

FOOTBALL WEST. Sports TG User Guide. Club Administrators

CT PET-2018 Part - B Phd COMPUTER APPLICATION Sample Question Paper

OGLA Guide to Lacrosse Statistics. February 17, 2016 Brett Monello OGLA Board Member

2014 HOCKEY ARBITRATION COMPETITION OF CANADA Derick Brassard vs. New York Rangers Submission on behalf of the New York Rangers Midpoint: $5 Million

Mapping a course for Pocket Caddy

Preparation for Salinity Control ME 121

CVEN Computer Applications in Engineering and Construction. Programming Assignment #4 Analysis of Wave Data Using Root-Finding Methods

Name: Class: Date: (First Page) Name: Class: Date: (Subsequent Pages) 1. {Exercise 5.07}

T H E R M O P T I M CALCULATION OF MOIST GAS FROM EXTERNAL CLASSES VERSION JAVA 1.5 R. GICQUEL MARCH 2007

2018 SOCCER STATISTICIANS MANUAL

The stats that I am using to project player stats are Hits (H), Runs (R), Homeruns (HR), Walks (BB), and Strikeouts (SO). I will look at each batter

DESIGN AND ANALYSIS OF ALGORITHMS (DAA 2017)

In this assignment, students will analyze statistics from the U.S. Department of Transportation to determine the safest means of travel.

download.file(" destfile = "kobe.rdata")

IN THE MATTER OF A SALARY ARBITRATION LARS ELLER -AND- MONTREAL CANADIENS NATIONAL ACADEMY OF ARBITRATORS

Introduction to Interprocess Communication. Introduction to Interprocess Communication

TennisLink Help Guide

Review questions CPSC 203 midterm 2

IN THE MATTER OF SALARY ARBITRATION CARL GUNNARSSON AND THE TORONTO MAPLE LEAFS

2012 Hockey Arbitration Competition of Canada

2013 HOCKEY ARBITRATION COMPETITION OF CANADA

Here is a summary of what you will learn in this section:

CARL GUNNARSSON THE TORONTO MAPLE LEAFS

Introducing the Stats Tracker Premium v6

NATIONAL PPP LEAGUE. Definitions The National PPP League will be structured into teams, division, seasons and games.

Week Twenty-One (March 6, 2017) LAST WEEK S GAMES

TOPIC 10: BASIC PROBABILITY AND THE HOT HAND

CSE 154: Web Programming Spring 2017 Homework Assignment 5: Pokedex. Overview. Due Date: Tuesday, May 9th

Excel Solver Case: Beach Town Lifeguard Scheduling

OGLA Guide to Lacrosse Statistics

APBA Baseball for Windows 5.75 Update 17

Full-Time People and Registrations Version 5.0

Overview. 2 Module 13: Advanced Data Processing

NCAA Soccer Denver Combined Team Statistics (as of Nov 22, 2015) All games

SANTA BARBARA COUNTY AIR POLLUTION CONTROL DISTRICT POLICIES AND PROCEDURES. Policy No Draft Div Pol Yr

NOTE: The password structure (& website structure) has been setup based on the policy of not sending out statistics to everybody.

Correlation and regression using the Lahman database for baseball Michael Lopez, Skidmore College

Golfshot: Golf GPS. ios VERSION 3.0+

In the Matter of Salary Arbitration Between: Lars Eller -AND- The Montreal Canadiens. Team 9. Submission of Lars Eller

1: MONEYBALL S ECTION ECTION 1: AP STATISTICS ASSIGNMENT: NAME: 1. In 1991, what was the total payroll for:

Projecting Three-Point Percentages for the NBA Draft

Predicting the Total Number of Points Scored in NFL Games

Table 1: Eastern Conference Final Standings (Sorted by Current Scoring System)

Working with Marker Maps Tutorial

DOWNLOAD OR READ : ROLLER HOCKEY SKILLS AND STRATEGIES FOR WINNING ON WHEELS PDF EBOOK EPUB MOBI

Assignment 2 Task 2: Application Design. By Dr Derek Peacock

The MLB Language. Figure 1.

Sports Analytics: Designing a Volleyball Game Analysis Decision- Support Tool Using Big Data

Transcription:

CSCI 2110 Data Structures and Algorithms Assignment No. 2 Date Given: Tuesday, October 9, 2018 Date Due: Wednesday, October 24, 2018, 11.55 p.m. (5 minutes to midnight) This assignment has two exercises, one on unordered lists and one on ordered lists. Download the zip file alongside the assignment link. It contains all the necessary files for you to proceed with this assignment. EXERCISE 1: (65 POINTS) This exercise is on the application of Unordered Lists. You will need the source codes for Node.java, LinkedList.java and List.java discussed in the lectures. You will also need the text file nhlstats.txt. Before you begin this assignment, it will be useful to study the Expense.java, ExpenseList.java and ExpenseListDemo.java programs that were discussed in the lectures. You may want to study Exercise 0 of Lab 4 for a quick review. The objective of this assignment is to perform analytics on NHL (National Hockey League) stats data and derive some interesting results. The nhlstats.txt file provided to you in the folder contains read a text file containing important statistics on each NHL player in the current 2018-19 hockey season. The text file is arranged as shown below. The meaning (legend) of each row is given below (not in the text file): Williams, Justin à Player name (last name, first name) CAR à Team (CAR is Carolina Hurricanes) 3 à GP (Games Played) 0 à G (Goals scored) 3 à A (Assists) 3 à P (Points) 3 à +/- Rating 0 à PPG (Power Play Goals) 0 à PPP (Power Play Points) 1.00 à PTSG (Points Per Game) 0 à SHG (Short handed goals) 0 à SHP (Short handed points) 0 à GWG (Game Winning Goals) 2 à PIM (Penalty Minutes) 10 à SOG (Shots on Goal) 0.0 à SHP (Shooting Percentage) 16:39 à ATOI (Average Time on Ice) The nhlstats.txt file contains the raw scores of 60 top NHL players arranged as shown above. Now, from these numbers, hockey statisticians calculate interesting information, and that is what you are required to do in this exercise. It essentially entails building an unordered list of the record of each player and searching for interesting data. Follow these steps.

1. First create a class called PlayerRecord.java that has all the 17 instance variables for one player (Name, Team, GP, G, A,, ATOI). public class PlayerRecord. 2. Next create a class PlayerStats holds an unordered list of PlayerRecord objects. public class PlayerStats private List<PlayerRecord> playerlist; In this class, include the following methods in addition to the constructor. You may add other methods if necessary. 1. Who is the player who scored the most GWG (game winning goals)? : This method displays the player s name and his team s name. Note: If more than one player has the largest GWG, display all the players and their teams. 2. Who is the player who spent the most time on ice (largest ATOI)?: This method displays the player s name and his team s name. Note: If more than one player has the largest ATOI, display all the players and their teams. 3. Who is the most aggressive player? : This method that displays the name of the player who had the maximum number of penalty minutes and his team s name. Same note as above applies. 4. Who is the most promising player? : Method that displays the name of the player who took the most number of shots on goal (SOG) and his team name. Same note as above applies. 5. Which player provided the most assists? : This method displays the name of the player who has the most number of assists and his team name. Same note as above applies. 3. Next create a class Team that holds the team name, total number of game winning goals and the total number of penalty minutes of players belonging to this team. Add appropriate constructor, get and set methods. public class Team private String name; private int totalgwg; private int totalpim; 4. Next create a class TeamStats that holds an unordered list of Team objects. public class TeamStats private List<Team> teamlist;

In this class, include the following methods in addition to the constructor. You may add other methods if necessary. 1. Which team has the most penalty minutes? : Method that displays the name of the team that had the most penalty minutes (sum of all penalty minutes of all players in that team). If more than one team has the same total penalty minutes, display the names of all such teams. 2. Which team has the most game winning goals? : Method that displays the name of the team that had the most number of game winning goals (sum of all GWGs for that team). Same note as above applies. 5. Write a client program NHLStatsDemo.java with a main method that reads the file nhlstats.txt and prints the following into another file nhlstatsoutput.txt. import java.io.*; import java.util.scanner; public class NHLStatsDemo public static void main(string[] args) throws IOException Note: When you read data from the file, each line is read as a String. To convert a String to an integer value, use Integer.parseInt(). Your output should be similar to the format given below: NHL Results Summary Players with the highest game winning goals and their teams: Players with the highest average time on ice and their teams: Teams that had the most number of penalty minutes:. Teams that had the most number of game winning goals:.

NOTE: You can use acronyms such as CAR, TOR for team names. If you want the full list of abbreviations for each team, consult https://en.wikipedia.org/wiki/template:nhl_team_abbreviations Submit a zip file containing the following: Node.java, LinkedList.java, List.java, PlayerRecord.java, PlayerStats.java, Team.java, TeamStats.java, NHLStatsDemo.java, nhlstats.txt and nhlstatsoutput.txt. EXERCISE 2: (35 POINTS) This exercise is on the two-finger walking algorithm for ordered lists. The zip file provided to you has the Ordered List class that was discussed in the lectures. Step 1: Write a program that reads a list of names from a file and constructs an ordered list. //appropriate imports public class MergeLists public static void main(string[] args) throws IOException For example, if the input text file is: Shai Tom Jim Aaron Barbara Beth Fred Jack Jarred Jill Amar Ralph Jill Hillary it should create the following ordered list and display the contents of the list: [Aaron, Amar, Barbara, Beth, Fred, Hillary, Jack, Jarred, Jill, Jim, Ralph, Shai, Tom] Note: Although Jill is repeated in the input list, the ordered list does not have repeated items. Step 2: Modify the above program so that it reads two text files each containing a list of names and constructs two ordered lists. Step 3: Add a method to the above program that takes as input two ordered lists and returns a third list that is a merger of the two ordered lists. Use the two-finger walking algorithm discussed in class. For example, if list1 is: Amar Boris Charlie Dan Fujian Inder Travis

and list2 is: Alex Ben Betty Charlie Dan Pei Travis Zola Zulu the method should create the following new ordered list and return it: Alex Amar Ben Betty Boris Charlie Dan Fujian Inder Pei Travis Zola Zulu Note: The header of the method should be written as follows: public static <T extends Comparable<T>> OrderedList<T> merge (OrderedList<T> list1, OrderedList<T> list2) //your code here Your final code should be one java class file that reads two files containing random names, creates two ordered lists from these names, merges them and displays the three lists. You can create two small files containing random names yourself. Submit MergeLists.java, the two input files and the result output in your zip file.