Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

what do i do here try myFile = new Scanner(aFile); numRecs = myFile.nextInt(); recCounterRead = true; //This is where you instantiate the array of Student

what do i do hereimage text in transcribed

try myFile = new Scanner(aFile); numRecs = myFile.nextInt(); recCounterRead = true; //This is where you instantiate the array of Student objects, and / /where you use a counter loop, using numRecs as number of time to loop, //to read all the records in the input file, and //create a Student object per record, to place in the global array of Student objects //Call a method that does them. 1/When this method successfully ends, the array of Student objects should be populated. catch (FileNotFoundException e) throw new FileNotFoundException ("The file " + fileName + " was not found."); catch (InputMismatchException e) // Check which input mismatch occurred: //Use a flag to determine if it is for non-numeric rec counter OR // non-numeric GPA catch (BadDataException e) //this exception doesn't have to be caught here, since it is being caught in main. // You can delegate the BadDataException back to main throw new BadDataException(e.getMessage()); catch (NoSuchElementException e) catch (Exception e)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions