Answered step by step
Verified Expert Solution
Question
1 Approved Answer
can someone help fix my main code in java I am trying to get this output Disaster Name Type Year Strength Rating Scale ------------------------------------------------------------------------------------- Tri-State
can someone help fix my main code in java I am trying to get this output Disaster Name Type Year Strength Rating Scale ------------------------------------------------------------------------------------- Tri-State Tornado 1925 5.0 Fujita Scale: F0 to F5 Good Friday Earthquake Earthquake 1964 9.2 Richter Scale: 1.0 to 9.0 or greater Katrina Hurricane 2005 5.0 Saffir-Simpson Wind Scale: 1 to 5 Mount St. Helens Volcano 1980 5.0 Volcanic Explosivity Index: 0 to 8 Joplin Missouri Tornado 2011 5.0 Fujita Scale: F0 to F5 Andrew Hurricane 1992 5.0 Saffir-Simpson Wind Scale: 1 to 5 Colorado Springs Tornado 1979 3.0 Fujita Scale: F0 to F5 El-Reno Oklahoma Tornado 2013 5.0 Fujita Scale: F0 to F5 Disasters that are Storms -------------------------------------------- Number of Tornados: 3 Number of Hurricanes: 2 Tri-State --- Tornado --- 5.0 Katrina --- Hurricane --- 5.0 Joplin Missouri --- Tornado --- 5.0 Andrew --- Hurricane --- 5.0 El-Reno Oklahoma --- Tornado --- 5.0 public static void main(String[] args) throws IOException{ //reading/ creating scanner for the text file final String FileName = "Assignment1.txt"; File fileName = new File(FileName); Scanner disasterFile = new Scanner(fileName); //getting the number of disasters in the file int amountOfDisaster = disasterFile.nextInt(); //array for the disasters Disasters[] disasterArray = new Disasters[amountOfDisaster]; //create for loop to print for (int i=0; i
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started