辅导讲解UML图、辅导代作java UML 程序设计、辅导讲解UML diagram、辅导java程序设计
- 首页 >> Java编程COSC600 Project2
Page 1 of 2
Project2
This is an individual project and you are required to work on this project alone.
Specifications:
1. This project is asking you to create a
list of songs using an array and after
that you should be able to sort the
songs based on the different fields.
2. Design a class Song based on the
UML diagram. Song class contains a
list of fields to describe a song. The
duration field is a float number giving
the length of the song in minutes. The
Song constructor will create a song
with the fields set to default values
(String to “”, float to 0.0, int to 0).
The setSong method will assignment
the parameter values to the
corresponding fields if the parameter
value is a valid value. The toString
method will return a String
representation of the song information
(including all the fields) in a
formatted way.
3. Design a class SongList based on the UML diagram.
SongList contains a song array which can hold a MAX
(a static final field to specify the length of the songList
array to be created) number of songs. The size field is
used to keep track of how many songs have been added
into the songList so far. For the sorting method you can
either modify the sorting algorithm we have discussed
or you can implement your own.
4. Create a Project2 class with a static test method to test
your song list. First you add a bunch of songs (at least 6)
to your list, and then print out all the songs in your list.
After that you can call different sort methods and print
out the songs after each sort method call. Please also test
your findSong() method to make sure it does return the
right index of the song you are looking for.
SongList
- MAX: int
- songList: Song [ ]
- size: int
+SongList():
+addSong(Song): boolean
+findSong(String title): int
+swapSong(int, int):
+sortByWriter():
+sortByDuration():
+sortByGenre():
+sortByYear();
+toString(): String
+getSize(): int
Song
- title: String
- writer: String
- singer: String
- duration: float
- genre: String
- year: int
+Song()
+setSong(String, String, String, float, Sting, int)
+getTitle(): String
+getWriter(): String
+getSinger(): String
+getDuration(): float
+getGenre(): String
+getYear(): int
+toString():String
COSC600 Project2
Page 2 of 2
5. All three classes (Song, SongList, Project2) should be added into the project package we
have created previously. Changing the main() method in the Main class to call the test() of
the Project2 class.
6. Hints: Test your Song classes before integrating them into the SongList class.
Submissions:
1. Zip your project folder and you should get a file with this name:
COSC600_ <your FSU username>.zip
2. Be sure to unzip the above file and try the program out to make sure zip works correctly.
3. Then submit your zip file to Canvas corresponding submission folder.
Grading:
1. Grading of this program is based on:
a. Whether your program performs as it should be (60%);
b. Whether your program has the correct logical structure (30%);
c. Whether you program follows the recommended programming style (10%).
2. The total of this project is 100 points.