Overview
The project will display a variety of different subsets of data retrieved from a CSV file. The CSV file contains data about television shows. A TVShow object will be created to store the information for the individual show data being read in. An array will be used to store the TVShow objects. The program will sort the data in a variety of ways. The output will display the results of both sort routines and search routines based on the specifications.
Specifications
The project utilize the three sorting and two searching algorithms covered in this module. The program must use the standard algorithms presented rather than programmer developed algorithms. The program may not use Array class methods such as sort or any searching options. As part of the project, a data file in CSV format will be read into the program and used to populate an array of objects. The CSV file will be provided as part of the project.
The program will utilize an object type, TVShow, to store the data being read into the program. The object will represent the data for one TV show. An array must be used to store the TVShow objects. The program will perform the following sorts and searching. It will display the specified information.
Insertion Sorts
- Sort the list by TV show name in ascending order using an insertion sort. The output should include the sorted contents of the array including show name, year it premiered, the male lead and the female lead.
- Sort the list by number of seasons in descending order using an insertion sort. The output should include the sorted contents of the array including show name, the year it premiered and the number of seasons.
Selection Sorts
- Sort the list by the year the show premiered in ascending order using a selection sort. The output should include the sorted contents of the array including show name, year it premiered and how many seasons.
- Sort the list by genre in descending order using a selection sort. The output should include the sorted contents of the array including show name, number of episodes and the genre.
Merge Sorts
- Sort the list by network in descending order using a merge sort. The output should include the sorted contents of the array including show name, year it premiered, how many seasons and the network.
- Sort the list by number of episodes in ascending order using a merge sort. The output should include the sorted contents of the array including show name, year it premiered, number of episodes and the network.
Sequential Searches
- Using a sequential search, find all shows in the array that lasted for 2 years or more. The output should include the show names, year it premiered, how many seasons and the network.
- Using a sequential search, find all shows in the array that had more than 100 episodes. The output should include the show names, how many seasons and the number of episodes.
Binary Searches
For the searches, use each sort one time. The order in which the searches are used are up to you.
- Using a binary search, find and count all shows in the array that aired on CBS. The output should include the show names and the total number of shows counted as well as inform the user that the shows were aired on CBS.
- Using a binary search, find and count all shows in the array in the fantasy category. The output should include the show names and the total number of shows counted as well as inform the user that the shows are in the fantasy category.
- Using a binary search, find and count all shows in the array in the drama category. The output should include the show names and the total number of shows counted as well as inform the user that the shows are in the drama category.
Bonus
- Using the sort of your choice, sort and print the show information in order by last name of male lead in ascending order. The output should include the sorted contents of the array including show name, year it premiered, the male lead and the female lead.
- Using the sort of your choice, sort and print the show information in order by last name of female lead in descending order. The output should include the sorted contents of the array including show name, year it premiered, the male lead and the female lead.
Java Requirements
This project is designed to practice using sorts and searches, including the use of arrays and recursion to solve problems:
- Read in data from the provided CSV file
- Use an object called TVShow to store the information read in for a single TVShow
- An array will be used to store objects of type TVShow
- Use an insertion sort, completed correctly, in ascending order by TV show name
- Use an insertion sort, completed correctly, in descending order by number of seasons
- Use a selection sort, completed correctly, in ascending order by year the show premiered
- Use a selection sort, completed correctly, in descending order by genre
- Use a merge sort, completed correctly, in descending order by network
- Use a merge sort, completed correctly, in ascending order by number of episodes
- Use a sequential search, completed correctly, to find all shows in the array that lasted for 2 years
- Use a sequential search, completed correctly to find all shows in the array that had more than 100 episodes
- Each of the three sorts – insertion, selection and merge sort – are used in the binary searches
- Use a binary search, completed correctly, to find and count all shows in the array that aired on CBS.
- Use a binary search, completed correctly, to find and count all shows in the array in the fantasy category
- Use a binary search, completed correctly, to find and count all shows in the array in the drama category
- Code compiles and runs without errors
- Code is properly commented
- Program is properly designed and uses whitespace effectively
Bonus
- Using the sort of your choice, sort and print the show information in order by last name of male lead in ascending order. (10 extra points)
- Using the sort of your choice, sort and print the show information in order by last name of female lead in descending order. (10 extra points)
Once you have it working as expected upload the .java file to this assignment drop box. You must also submit a Word doc or text file containing the Java code. Assignments not containing both the Java code and the text or Word file will be assigned a 0 for a grade.
Rubric
| Criteria | Ratings | Pts | |||
|---|---|---|---|---|---|
|
This criterion is linked to a Learning OutcomeInsertion sort 1 completed correctly |
|
6 pts |
|||
|
This criterion is linked to a Learning OutcomeInsertion sort 2 completed correctly |
|
6 pts |
|||
|
This criterion is linked to a Learning OutcomeSelection sort 1 completed correctly |
|
6 pts |
|||
|
This criterion is linked to a Learning OutcomeSelection sort 2 completed correctly |
|
6 pts |
|||
|
This criterion is linked to a Learning OutcomeMerge sort 1 completed correctly |
|
6 pts |
|||
|
This criterion is linked to a Learning OutcomeMerge sort 2 completed correctly |
|
6 pts |
|||
|
This criterion is linked to a Learning OutcomeSequential search 1 completed correctly |
|
6 pts |
|||
|
This criterion is linked to a Learning OutcomeSequential search 2 completed correctly |
|
6 pts |
|||
|
This criterion is linked to a Learning OutcomeEach of the three sorts – insertion, selection and merge sort – are used in the binary searches |
|
5 pts |
|||
|
This criterion is linked to a Learning OutcomeBinary search 1 completed correctly |
|
6 pts |
|||
|
This criterion is linked to a Learning OutcomeBinary search 2 completed correctly |
|
6 pts |
|||
|
This criterion is linked to a Learning OutcomeBinary search 3 completed correctly |
|
6 pts |
|||
|
This criterion is linked to a Learning OutcomeCode compiles and runs without errors |
|
5 pts |
|||
|
This criterion is linked to a Learning OutcomeCode is properly commented |
|
10 pts |
|||
|
This criterion is linked to a Learning OutcomeProgram is properly designed and uses whitespace effectively |
|
14 pts |
|||
|
Total Points: 100 |
|||||


0 comments