Homework 5 - AthleteList

Caution: The AthleteListInterface file was updated on Wednesday, March 14th.

Please redownload it and ensure that the version you are compiling against has @version 14.4.2 in the interface javadoc.

Introduction

In this assignment, you’ll practice

Problem Description

The 2018 Winter Olympics have come and gone! Unsatisfied with their 4th place finish, Team USA has hired you, a young, ambitious Georgia Tech CS grad, to revamp their system for managing their athletes! You’ve decided to utilize your vast knowledge of Java collections and use a custom ArrayList implementation.

Background Information

Up to this point in the course, we’ve used arrays as our primary data structure. It’s time to learn about another one, ArrayLists!

Our main gripe with arrays is that they are fixed size. ArrayLists solve that problem – they resize as elements are added to them. Behind the scenes, an ArrayList stores the elements added to it in a backing array. You’ll similarly use an array in your implementation of AthleteList as your backing data structure. If the array is at capacity and an element needs to be added, then the contents of the backing array are copied into a new, larger array. This new array becomes the backing array.

Something else to be noted in our discussion of ArrayLists is the distinction we make between capacity and size. Capacity is the maximum number of elements the backing array can hold. This is an implementation detail that’s hidden from the user. Size is the number of elements that have been added to an ArrayList, and is known to the user through a size() method. Size is typically tracked by the ArrayList. You’ll encounter both of these terms in your implementation.

Solution Description

You will be provided the following files. You may only modify train() in Athlete! The file names are clickable, and take you to the Java files.

You will need to write the following classes:

Solution Constraints

Tips and Considerations

Grading

Checkstyle

For each of your homwork assignments we will run checkstyle and deduct one point for every checkstyle error.

For this homework there is no checkstyle cap, meaning you can lose all points on this assignment due to style errors.

Collaboration

When completing homeworks for CS1331 you may talk with other students about:

Examples of approved/disapproved collaboration:

OKAY: “Hey, I’m really confused on how we are supposed to implement this part of the homework. What strategies/resources did you use to solve it?”

BY NO MEANS OKAY: “Hey… the homework is due in like 20 minutes… Can I see your code? I promise won’t copy it directly!”

In addition to the above rules, note that it is not allowed to upload your code to any sort of public repository. This could be considered an Honor Code violation, even if it is after the homework is due.

Turn-in Procedure

Verify the Success of Your Submission to Canvas

Practice safe submission! Verify that your HW files were truly submitted correctly, the upload was successful, and that your program runs with no syntax or runtime errors. It is solely your responsibility to turn in your homework and practice this safe submission safeguard.