Hey guys, doing an assessment for school. I don't want the whole code laid out in front of me, I just need help with the error. I am not sure why I am getting this error. The code is not finished at all, but I am stumped on how to get past loading in the things from the text file. Here is my code:
import java.util.Scanner; import java.io.File; import java.io.IOException; public class Hurricanes2 { public static void main(String[] args)throws IOException { //declare and initialize variables int arrayLength = 59; int [] year = new int[arrayLength]; String [] month = new String[arrayLength]; int [] pressure = new int[arrayLength]; int [] windSpeedK = new int[arrayLength]; File fileName = new File("hurcdata2.txt"); Scanner inFile = new Scanner(fileName); //INPUT - read data in from the file int index = 0; while (inFile.hasNext()) { year[index] = inFile.nextInt(); month[index] = inFile.next(); //pressure[index] = inFile.nextInt(); //windSpeedK[index] = inFile.nextInt(); index++; } inFile.close(); //PROCESSING - calculate and convert values // convert windspeed from knots to MPH // determine category // count number of each category int [] windSpeedMph = new int[windSpeedK.length]; for(index = 0; index < windSpeedK.length; index++) { windSpeedMph[index] = windSpeedK[index] * (int)1.15078; } //Find min, max and average for category, windspeed and pressure //Output - print table using printf to format the columns System.out.println(" Hurricanes 1980 - 2006"); System.out.println(); System.out.println("Year Hurricane Category Pressure (mb) Wind Speed (mph)"); System.out.println("====================================================================="); System.out.println("====================================================================="); for(index = 0; index < windSpeedK.length; index++) { System.out.println(windSpeedMph[index]); } }//end main() }//end Hurricanes2
and here is my error:
Error:Internal error: (java.io.FileNotFoundException) C:\FLVS\APCS\Module 6\Mod06 Practice\.idea\misc.xml (The system cannot find the file specified)
java.io.FileNotFoundException: C:\FLVS\APCS\Module 6\Mod06 Practice\.idea\misc.xml (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.jav a:138)
at com.intellij.openapi.util.JDOMUtil.loadDocument(JD OMUtil.java:340)
at org.jetbrains.jps.model.serialization.JpsLoaderBas e.loadRootElement(JpsLoaderBase.java:69)
at org.jetbrains.jps.model.serialization.JpsLoaderBas e.loadRootElement(JpsLoaderBase.java:40)
at org.jetbrains.jps.model.serialization.JpsProjectLo ader.loadFromDirectory(JpsProjectLoader.java:116)
at org.jetbrains.jps.model.serialization.JpsProjectLo ader.loadProject(JpsProjectLoader.java:98)
at org.jetbrains.jps.model.serialization.impl.JpsSeri alizationManagerImpl.loadModel(JpsSerializationMan agerImpl.java:41)
at org.jetbrains.jps.cmdline.JpsModelLoaderImpl.loadM odel(JpsModelLoaderImpl.java:45)
at org.jetbrains.jps.cmdline.BuildRunner.load(BuildRu nner.java:71)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(Bu ildSession.java:198)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSe ssion.java:113)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandl er$1.run(BuildMain.java:157)
at org.jetbrains.jps.service.impl.SharedThreadPoolImp l$1.run(SharedThreadPoolImpl.java:41)
at java.util.concurrent.Executors$RunnableAdapter.cal l(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.jav a:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
PS:
It compiles fine, but when I execute it I get this.