Question: import java.io.*; import java.util.*; public class PalmerPenguinsM6 { static final String FILE_NAME = PalmerPenguins.csv; // Constants representing species and count public static final int NUM_SPECIES
import java.io.*; import java.util.*; public class PalmerPenguinsM6 { static final String FILE_NAME = "PalmerPenguins.csv"; // Constants representing species and count public static final int NUM_SPECIES = 3; public static final String SP_CHINSTRAP = "Chinstrap"; public static final String SP_GENTOO = "Gentoo"; public static final String SP_ADELIE = "Adelie"; public static void main(String args) { // TODO 1: Call the readSpeciesData method and store the result in a // String array named speciesData // TODO 2: Call the initializeSpeciesCount method and store the // result in an int array named speciesCount // TODO 3: Use the isDataEmpty method to check if speciesData is empty // TODO 4: Call the countSpecies method, passing speciesData and // speciesCount as arguments // TODO 5: Call the printSpeciesCount method, passing speciesCount // as an argument } /** * TODO 1: Create a method named readSpeciesData that calls CSVReader.readFile * to read column 1 from the CSV file and returns a String array. */ /** * TODO 2: Create a method named initializeSpeciesCount that returns * a new int array of size NUM_SPECIES. */ /** * TODO 3: Create a method named isDataEmpty that takes a String array * as a parameter and returns true if
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
