public class LastnameFirstname17
and class HawaiianTheme
.
class HawaiianTheme
does NOT have the public modifier. **
class HawaiianTheme
is NOT nested inside public class LastnameFirstname17
. **
class HawaiianTheme
is a class definition,
which contains the variables (data fields) and methods to define objects, which store data. **
class HawaiianTheme
is the type of data that you stored in your input file.
For example, I am using "Marine Mammals of Hawai'i", so my class is: class MarineMammalsOfHawaii
class HawaiianTheme
.
See example file LinkedListDriver.java for examples of declaring a linked list of objects.
class HawaiianTheme
.
This was done in Assignment #8. Also see instructions below.
public class LastnameFirstname08
class,
create data fields, a constructor, and toString() method for class HawaiianTheme
.
class HawaiianTheme
.
For example, for my class MarineMammalsOfHawaii
, I have these data fields: name, population, and length.
class HawaiianTheme
. You should have a three parameters, which initialize your three data fields.
For example, I have three parameters of type String, Integer, and Double in my constructor.
toString()
method for your class HawaiianTheme
.
The return value should return a String with the three data fields, so they can be displayed.
You output will be similar, but not the same, as my output.
The formatting doesn't have to be exactly the same, but make sure it is neat and easy to read.
Here are details on the format() method, if you so wish to use it:
https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html
Or, in your CSV file, just make sure you leave extra spaces to evenly space the words.
Or, maybe you have your own unique way to do the formatting!
** Make sure you submit your CSV file with your assignment. **
Below is example output for using this input file as the first commandline argument: mammals.csv
Read from input file: mammals.csv Display MarineMammalsOfHawaii linked list after adding objects from the input file into a linked list: # name population length 1, Hawaiian monk seal 1100 2.40 2, humpback whale 10000 16.00 3, spinner dolphin 3351 2.35 4, common bottlenose dolphin 235 3.50 5, Risso's dolphin 85000 4.00 6, rough-toothed dolphin 150000 2.83 7, striped dolphin 2000000 2.60 8, pygmy killer whale 817 20.50 9, false killer whale 150 2.80 10, melon-headed whale 2950 3.00 11, short-finned pilot whale 8850 3.70 12, sperm whale 7082 17.30 13, dwarf sperm whale 19000 3.00 14, pygmy sperm whale 50 3.50 15, orca 50 10.70 16, Blainville's beaked whale 2200 5.00 17, Cuvier's beaked Whale 13000 8.30 18, pantropical spotted dolphin 3000000 2.50 Enter the row number of the object to be deleted: 0 ERROR: 0 is NOT a row number! Enter the row number of the object to be deleted: 19 ERROR: 19 is NOT a row number! Enter the row number of the object to be deleted: -99 ERROR: -99 is NOT a row number! Enter the row number of the object to be deleted: 99 ERROR: 99 is NOT a row number! Enter the row number of the object to be deleted: five ERROR: five is NOT a whole number! Enter the row number of the object to be deleted: 5 Deleting: Risso's dolphin 85000 4.00 Display MarineMammalsOfHawaii linked list after deleting an object from the linked list: # name population length 1, Hawaiian monk seal 1100 2.40 2, humpback whale 10000 16.00 3, spinner dolphin 3351 2.35 4, common bottlenose dolphin 235 3.50 5, rough-toothed dolphin 150000 2.83 6, striped dolphin 2000000 2.60 7, pygmy killer whale 817 20.50 8, false killer whale 150 2.80 9, melon-headed whale 2950 3.00 10, short-finned pilot whale 8850 3.70 11, sperm whale 7082 17.30 12, dwarf sperm whale 19000 3.00 13, pygmy sperm whale 50 3.50 14, orca 50 10.70 15, Blainville's beaked whale 2200 5.00 16, Cuvier's beaked Whale 13000 8.30 17, pantropical spotted dolphin 3000000 2.50