Question: So Ive posted this question before and didnt get a clear answer. The person told me to put myinput.txt in the same directory as that

So Ive posted this question before and didnt get a clear answer. The person told me to put myinput.txt in the same directory as that of Stats.java file. How do I put it in the same directory. This is my first week coding so please try to explain it in simple terms so that I can understand. Thank You.
 So Ive posted this question before and didnt get a clear

ecipse-workxpace-HomeWork2/a/homework2/Stats java Eclipse IDt e Edit Source Refactor Navigate Search Project Run Window Help Stats.java Et 4 public class Stats ( 6Adding TOException to main aethod for outputfile. public static void main(Stringll args) throus T0Exception ( / /Declaring variables int IDNumber, rightAns,wrongAns, answered, onitted, grade, numberOf Students int maxGradetD , maxGrade , maxPerID double rightAnspercent, maxPercent -1.0 String message null, oMessage ull 1e 12 13 14 15 //open input File File nyfile-new File("myinput.txt") 16 17 18 19 20 21 //Creating scanner object. Scanner inputFile new Scanner(myfile); / /Scanner inputFile new Scanner (System.in); /read from console //Creating outputFile using Printwriter class. Printuriter outputfile 23 24 25 26 27 28 29 //Attaching object to a file and opening file. outputFile new Printwriter("myoutput.txt") /iprinting Table Header outputFile.printin( titicititititititittttExan Statisticsin") outputFile.printin("Student ID tRighttwrong\tAnswered tOmittedt itGrade t " 31 "Percent ititittMessagetieleititomitted Message) D Console S terminated. Stats (1) lava AppkationCprogramF les laval re-10aabin ymaw exe Clana 2019,24101 PM) Exception in thread "main-iavadonientrounderception: mynput.txt (The system cannot find the file specified) at java.base/java, io.FileInputStream.opene(Native Method) at java.base/java. io.FileInputStream,open (Unknown Source) at java.base/java.Lo.PileInputStream.(Unknown Source) at Homework2/homework2.Stats.main(Stats java:19) Smart Insert O Type here to search

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!