ITC201: Data Structures and Algorithms Group Programming Project

Download Solution Order New Solution

Assessment 2

Instructions

  • Students are required to cover all stated requirements.
  • Your submission must be uploaded to Moodle in zip file including all source codes and documentation/manual/report.
  • Include a title/cover page containing the subject title and code and the name, student id numbers.

Requirements

  • The assignment is a group programming project, which is to implement a prototype of a simple music library.
  • You need to carefully follow the input format and generate sensible output. If the program crashed during testing, you may lose the corresponding marks in specific tests.
  • Any submission after the due date will be dealt with late submission penalties.

Assignment Details

Mimic a simple music library and exercise the data structures we have learned so far.

Students are given a sample code zip file, named Assessment 2 - Sample.zip, in Moodle, which contains all the files you will need for this assignment. You will be writing code in a number of files, including creating one class from the ground up. The goals of this assignment are:

  • to give you practice with the data structures we have seen this semester
  • to deal with a fairly unstructured problem specification
  • to build a complete solution from scratch leveraging the power of the Java API

This assignment is designed to mimic a simple music library and exercise the data structures we have seen so far in so doing. You are given a plain text file of songs, tunes.txt, (culled from a random professor's library). Each song entry in the file is formatted in the following manner:

  • artist
  • title
  • album
  • genre (1 word), followed by any playlists the song is contained in (could be 0), each separated by a semi-colon (;) (every song belongs to exactly one genre, but can belong to zero, one, or more playlists)
  • a blank line to separate entries (warning: there is no blank line after the last entry!)

Students could be creative to add new functions. Students should use functional programming as much as they can in the program, and clear point them out. The job is to read the data file into a collection of your choosing (e.g., an ArrayList) and provide the following commands/funtionality in the MusicLibrary.java file:

  • display all songs (this should include all the information for each song: its title, album, artist, and genre)
  • display all artists (this should display a list of unique artists)
  • given an artist, display all the songs (title & album) by that artist
  • display all genres
  • given a genre, display all the songs (title & artist) in that genre
  • display all playlists
  • given a playlist, display all the songs (title & artist) in that playlist
  • add a new song with all relevant information (artist, title, album, genre, playlist(s)), or an appropriate "already exists" error message
  • create a new playlist (or an appropriate "already exists" error message)
  • add a song to a particular playlist (with appropriate "not found" messages)
  • write an updated version of the file, tunes.txt, preserving any additions or changes made during the execution of the program (the file must be written such that it can be read back in a subsequent execution of the program!)

After performing any action, the program should print out reasonable output to guide user or display further information. It should also handle any exceptional input to avoid crashing and guiding users for next action.

You will need to build an initial data structure to store all the songs. This collection will be instantiated and built in the MusicLibrary constructor. I suggest storing each song in the collection data structure and building the appropriate initial map(s) as you read in each song. If it isn't obvious, you will need to create a simple Song class (name it what you will) and provide an appropriate constructor and getter methods.

Style

Please make sure that you have a good, clean, modular design to your program. Your main method (really any method) should not run on for pages! Each command should dispatch a separate method to handle the implementation of that command (at minimum!).

The UI

I suggest that you take a look at the files from the GradeBook homework to get an idea of how to start to segment the work and provide the user with a menu of choices and then dispatch those choices to the appropriate methods.

The Data Structures

You may choose any data structure you wish to store the data from the file. However, you must use a Map (either a TreeMap or HashMap) to capture the association between genres and songs. You may also find other maps (like a playListMap) useful, but you only have to use the one for genres.

Summary of Assessment Requirements

Assessment Type: Group programming project
Objective: Implement a prototype of a simple music library using Java, applying learned data structures and functional programming concepts.

Key Pointers to Cover:

  • File Handling: Read a given tunes.txt file containing songs with artist, title, album, genre, and playlists. Preserve changes for future program runs.
  • Data Structures:
    • Use a collection (e.g., ArrayList) to store songs.
    • Use at least one Map (TreeMap or HashMap) to associate genres with songs. Optional additional Maps for playlists or other features.
  • Functionality: Implement the following commands:
    • Display all songs, artists, genres, and playlists
    • Display all songs by a specific artist or genre
    • Display all songs in a specific playlist
    • Add new songs or playlists with validation for duplicates
    • Add songs to existing playlists
    • Update and write back to tunes.txt
  • User Interface: Menu-driven interface guiding users through commands.
  • Code Quality: Modular design, clean code, clear methods for each command, and proper exception handling.
  • Optional Enhancements: Add creative functions and apply functional programming practices.

Approach by Academic Mentor

Step 1: Understanding the Problem

  • Mentor guided the students to break down the assignment into manageable parts: file reading, song storage, commands implementation, and writing back to file.
  • Emphasis on identifying key entities (Song, Playlist, Genre) and relationships for data modeling.

Step 2: Designing the Data Structures

  • Suggested creating a Song class with fields: artist, title, album, genre, and playlist(s).
  • Recommended initializing a main collection (ArrayList) for storing all songs.
  • Guided on creating aMap>for genres, and optionally for playlists, to allow efficient access.

Step 3: Implementing Core Functionalities

  • Mentor advised implementing one command at a time:
    1. Display all songs, artists, genres, playlists
    2. Search functions by artist, genre, or playlist
    3. Adding new songs or playlists with checks
    4. Updating tunes.txt after changes
  • Each command implemented as a separate method to maintain modularity.

Step 4: User Interface Design

  • Mentor emphasized using a menu-driven interface, allowing users to choose commands.
  • Incorporated prompts and feedback messages for clarity and guiding user actions.

Step 5: Testing and Exception Handling

  • Mentor guided students to simulate multiple scenarios: adding duplicates, searching for non-existent items, and handling incorrect inputs.
  • Ensured the program did not crash and handled exceptions gracefully.

Outcome Achieved

  • Functional Prototype: Students successfully built a fully functional music library prototype.
  • Data Management: Songs stored in collections with proper mappings for genres and optional playlist handling.
  • User Interaction: Menu-driven interface provided clear instructions, output, and feedback for each command.
  • File Persistence: Changes to songs and playlists correctly written back  tunes.txt for future runs.
  • Optional Enhancements: Students added extra features such as sorting songs, functional programming for filtering, and playlist management improvements.

Learning Objectives Covered: 

  1. Practical application of Java data structures (ArrayList, HashMap, TreeMap).
  2. Implementing modular and object-oriented programming with classes and methods.
  3. File I/O operations: reading, processing, and writing data.
  4. Applying functional programming concepts in Java.
  5. Developing a user-friendly interface with clear feedback and error handling.
  6. Collaboration in a group project with an organized code structure and responsibilities.

Access Your Sample Assignment Solution Today

Boost your understanding and get a head start on your project with our comprehensive sample solution. This resource is designed to guide you step-by-step, helping you see how key concepts are applied in practice.

Important: The sample is for reference only submitting it as your own work can lead to plagiarism issues.

Looking for a completely fresh, plagiarism-free solution tailored to your exact requirements? Our team of professional academic writers can create a fully customized assignment that is unique, well-researched, and ready to submit with confidence.

Benefits of Ordering a Fresh Solution:

  • 100% original and plagiarism-free content
  • Custom-written to match your assignment brief
  • Expertly structured and clearly presented
  • Saves time and ensures full compliance with academic standards

Take control of your academic success:

Download Sample Solution           Order Fresh Assignment

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.