i am trying to add the first four lines of a student.txt into an arraylist of type student and the next
few lines into an arraylist of type course. i have to do this for each student in the txt. However, i
keep running into errors.
Below is the students.txt
Michael West
900753
2003
TruE
Art Appreciation,1090,3,sync,T
Data Structures,2735,5,online,MWF
Calculus,1070,4,in-person,MTWF
Personal Finance,1070,3,online,TBD
Health Ethics,2080,3,async,TR
Festus Park
900846
2000
False
Art Appreciation,1090,3,sync,T
Intro to CS,1724,4,in-person,MWTF
Statistics,2010,3,Online,MWF
Personal Finance,1070,3,online,TBD
Africa and the World,2090,3,sync,WF
Ahmed Nord
900963
2004
true
Intro to Philosophy,1070,3,online,TR
Data Structures,2735,5,online,MWF
Intro to Tennis,1000,3,in-person,MWF
Personal Finance,1070,3,online,TBD
Health Ethics,2080,3,async,TR
Tasha Ohlder
900102
1994
true
Intro to Sociology,1010,3,async,MW
Data Structures,2735,5,online,MWF
Statistics,2020,4,online,MWRF
Personal Finance,1070,3,online,TBD
Intro to Theology,1080,3,async,WF
Earl Mint
900159
2003
false
Calculus,1070,4,online,MTWF
Intro to CS,1724,4,in-person,MWTF
Personal Finance,1070,3,online,TBD
Health Ethics,2080,3,async,TR
English Composition,2010,3,online,MWF
Katie Easton
900951
2000
false
Discrete Structs,2550,3,online,TR
Intro to CS,1724,4,in-person,MWTF
Intro to Karate,1040,3,in-person,MWF
Personal Finance,1070,3,online,TBD
Health Ethics,2080,3,async,TR
Kennedy Dotson
900237
1999
True
Intro to Philosophy,1070,3,online,TR
Data Structures,2735,5,online,MWF
Intro to Data Science,1070,4,in-person,MWF
Personal Finance,1070,3,online,TBD
Nick Peoples
900856
2001
False
Intro to Sociology,1010,3,online,MW
Intro to CS,1724,4,in-person,MWTF
Intro to Tennis,1000,3,in-person,MWF
Personal Finance,1070,3,online,TBD
Olivia Priest
900123
1999
True
Intro to Philosophy,1070,3,online,TR
Data Structures,2735,5,online,MWF
Intro to Data Science,1070,4,in-person,MWF
Macro Economics,2020,3,sync,TW
Personal Finance,1070,3,online,TBD
Rashad Black
900456
2001
False
Intro to Sociology,1010,3,online,MW
Intro to CS,1724,4,in-person,MWTF
Intro to Tennis,1000,3,in-person,MWF
Personal Finance,1070,3,online,TBD
How Things Work,1010,3,async,WF
Michael West
900753
2003
TruE
Art Appreciation,1090,3,sync,T
Data Structures,2735,5,online,MWF
Calculus,1070,4,in-person,MTWF
Personal Finance,1070,3,online,TBD
Health Ethics,2080,3,async,TR
Festus Park
900846
2000
False
Art Appreciation,1090,3,sync,T
Intro to CS,1724,4,in-person,MWTF
Statistics,2010,3,Online,MWF
Personal Finance,1070,3,online,TBD
Africa and the World,2090,3,sync,WF
Ahmed Nord
900963
2004
true
Intro to Philosophy,1070,3,online,TR
Data Structures,2735,5,online,MWF
Intro to Tennis,1000,3,in-person,MWF
Personal Finance,1070,3,online,TBD
Health Ethics,2080,3,async,TR
Tasha Ohlder
900102
1994
true
Intro to Sociology,1010,3,async,MW
Data Structures,2735,5,online,MWF
Statistics,2020,4,online,MWRF
Personal Finance,1070,3,online,TBD
Intro to Theology,1080,3,async,WF
Earl Mint
900159
2003
false
Calculus,1070,4,online,MTWF
Intro to CS,1724,4,in-person,MWTF
Personal Finance,1070,3,online,TBD
Health Ethics,2080,3,async,TR
English Composition,2010,3,online,MWF
Katie Easton
900951
2000
false
Discrete Structs,2550,3,online,TR
Intro to CS,1724,4,in-person,MWTF
Intro to Karate,1040,3,in-person,MWF
Personal Finance,1070,3,online,TBD
Health Ethics,2080,3,async,TR
Kennedy Dotson
900237
1999
True
Intro to Philosophy,1070,3,online,TR
Data Structures,2735,5,online,MWF
Intro to Data Science,1070,4,in-person,MWF
Personal Finance,1070,3,online,TBD
Nick Peoples
900856
2001
False
Intro to Sociology,1010,3,online,MW
Intro to CS,1724,4,in-person,MWTF
Intro to Tennis,1000,3,in-person,MWF
Personal Finance,1070,3,online,TBD
Olivia Priest
900123
1999
True
Intro to Philosophy,1070,3,online,TR
Data Structures,2735,5,online,MWF
Intro to Data Science,1070,4,in-person,MWF
Macro Economics,2020,3,sync,TW
Personal Finance,1070,3,online,TBD
Rashad Black
900456
2001
False
Intro to Sociology,1010,3,online,MW
Intro to CS,1724,4,in-person,MWTF
Intro to Tennis,1000,3,in-person,MWF
Personal Finance,1070,3,online,TBD
How Things Work,1010,3,async,WF
My code is not working at all here is what i have
//reading through student data
ArrayList<Student> hwData = fileRdr("hw02Data.txt") ;
System.out.println("Students data: n" + hwData) ;
//reading through student data
ArrayList<Student> hwData = fileRdr("hw02Data.txt") ;
System.out.println("Students data: n" + hwData) ;
//Function definitions
//file rdr
public static ArrayList<Student> fileRdr (String fname)
throws FileNotFoundException{
ArrayList<Student> studentAL = new ArrayList <> () ;
ArrayList <Course> cAL = new ArrayList <> () ;
Scanner readFile = new Scanner(new File(fname)) ;
while(readFile.hasNextLine()) {
String name = readFile.next() ;
int id = readFile.nextInt() ;
readFile.nextLine() ;
int birthyear = readFile.nextInt() ;
boolean isSciMajor = readFile.nextBoolean() ;
readFile.nextLine() ;
Student s1 = new Student(name,id,birthyear,isSciMajor) ;
studentAL.add(s1) ;
while(readFile.hasNextLine()) {
String line = readFile.nextLine() ;
if(line == "") {
;
} //
String [] data = line.split(",") ;
Course c2 = new Course(data[0],data[1],Integer.parseInt(data[2]),data[3],data[4]) ;
cAL.add(c2) ;
System.out.println(cAL) ;
} //while loop
}
return studentAL ;
} //function call
//Function definitions
//file rdr
public static ArrayList<Student> fileRdr (String fname)
throws FileNotFoundException{
ArrayList<Student> studentAL = new ArrayList <> () ;
ArrayList <Course> cAL = new ArrayList <> () ;
Scanner readFile = new Scanner(new File(fname)) ;
while(readFile.hasNextLine()) {
String name = readFile.next() ;
int id = readFile.nextInt() ;
readFile.nextLine() ;
int birthyear = readFile.nextInt() ;
boolean isSciMajor = readFile.nextBoolean() ;
readFile.nextLine() ;
Student s1 = new Student(name,id,birthyear,isSciMajor) ;
studentAL.add(s1) ;
while(readFile.hasNextLine()) {
String line = readFile.nextLine() ;
if(line == "") {
;
} //
String [] data = line.split(",") ;
Course c2 = new Course(data[0],data[1],Integer.parseInt(data[2]),data[3],data[4]) ;
cAL.add(c2) ;
System.out.println(cAL) ;
} //while loop
}
return studentAL ;
} //function call
End of the function here is the error
Exception in thread "main" java.util.InputMismatchException
at java.base/java.util.Scanner.throwFor(Scanner.java:939)
at java.base/java.util.Scanner.next(Scanner.java:1594)
at java.base/java.util.Scanner.nextInt(Scanner.java:2258)
at java.base/java.util.Scanner.nextInt(Scanner.java:2212)
at Main.fileRdr(Main.java:49)
at Main.main(Main.java:11)
Exception in thread "main" java.util.InputMismatchException
at java.base/java.util.Scanner.throwFor(Scanner.java:939)
at java.base/java.util.Scanner.next(Scanner.java:1594)
at java.base/java.util.Scanner.nextInt(Scanner.java:2258)
at java.base/java.util.Scanner.nextInt(Scanner.java:2212)
at Main.fileRdr(Main.java:49)
at Main.main(Main.java:11)
please help me to fix my code
Classes for Objects They have defined: State; behavior; & how to contruct objects of the
typeCourse - name: String - courseNum: String - creditHrs: int - mode: String - meetings: String +
Course () + Course (name: String, courseNum: String, creditHrs: int, meetings: String) + tostring ()
: String + getters/setters + equals (o: Object): boolean + hashcode () : int

More Related Content

PDF
I wrote a function to read through all of the students in a .pdf
PDF
In java and based upon a txt file please add the first FOUR.pdf
PDF
Basics of Computer Science
PPTX
Python Data Types with realistical approach.pptx
PPTX
Introduction to database
DOCX
CS4700 Database Management Systems.docx
PPTX
Usando el entity framework
PPTX
Python Lecture 8
I wrote a function to read through all of the students in a .pdf
In java and based upon a txt file please add the first FOUR.pdf
Basics of Computer Science
Python Data Types with realistical approach.pptx
Introduction to database
CS4700 Database Management Systems.docx
Usando el entity framework
Python Lecture 8

Similar to i am trying to add the first four lines of a studenttxt int.pdf (20)

PDF
Micro project project co 3i
PPTX
Chap 2 Arrays and Structures.pptx
PPT
Chap 2 Arrays and Structures.ppt
PPTX
Dictionary functions and methods.ppt .
PPT
DATASTRUCTURES UNIT-1
PDF
SQL on Linux and its uses and application.pdf
PDF
Submit1) Java Files2) Doc file with the following contents.pdf
PDF
how do i expand upon selectionSortType so that you are no longer bou.pdf
PPT
C1320prespost
PPTX
Arrays in C language
DOCX
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
PPT
MySQL JDBC Tutorial
DOCX
Lab Manual Data Structure and Algorithm.docx
PPT
358 33 powerpoint-slides_5-arrays_chapter-5
PDF
DATA STRUCTURE BY SIVASANKARI
PPT
Data Structure In C#
PDF
Data structures "1" (Lectures 2015-2016)
PDF
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
PDF
JAVA OOP project; desperately need help asap im begging.Been stuck.pdf
PPT
Micro project project co 3i
Chap 2 Arrays and Structures.pptx
Chap 2 Arrays and Structures.ppt
Dictionary functions and methods.ppt .
DATASTRUCTURES UNIT-1
SQL on Linux and its uses and application.pdf
Submit1) Java Files2) Doc file with the following contents.pdf
how do i expand upon selectionSortType so that you are no longer bou.pdf
C1320prespost
Arrays in C language
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
MySQL JDBC Tutorial
Lab Manual Data Structure and Algorithm.docx
358 33 powerpoint-slides_5-arrays_chapter-5
DATA STRUCTURE BY SIVASANKARI
Data Structure In C#
Data structures "1" (Lectures 2015-2016)
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
JAVA OOP project; desperately need help asap im begging.Been stuck.pdf

More from access2future1 (20)

PDF
The following stockholders equity accounts arranged alphabe.pdf
PDF
You are considering a stock investment in one of two firms .pdf
PDF
The Case of Sam Sawyer Sam Sawyer was a toprated operator i.pdf
PDF
Second Republic Bank is a lending company that operates in t.pdf
PDF
Researchers found that a person in a particular country spen.pdf
PDF
QUESTION 2 internal rate of return method 14 RETURN USE N.pdf
PDF
Question 17 Which of the following contributes directly to t.pdf
PDF
Proporcione ejemplos de cmo Chris y Alison participaron en .pdf
PDF
Please Use SWISH and write the code answer each part carefu.pdf
PDF
PLEASE HELP ME Eric Christopher Associate Director for Glo.pdf
PDF
please help with the fill in the blanks Fill in the followin.pdf
PDF
Patient Documentation Analysis Due Date Sunday 1159 pm MT.pdf
PDF
Please fix the following C++ code to compile correctly in Vi.pdf
PDF
output and explain There is Mylist There is MyArrayList pa.pdf
PDF
Name the hormones that influence the menstrual cycle Ident.pdf
PDF
Mike and Carol Brady realized that their house was not big e.pdf
PDF
Debugging C Console Program Debug the program to identify .pdf
PDF
742 Example 743 Continued Suppose that we have iid Ber.pdf
PDF
Holt Enterprises recently paid a dividend D0 of 275 It .pdf
PDF
2 Use the information above to complete the Aging of Accoun.pdf
The following stockholders equity accounts arranged alphabe.pdf
You are considering a stock investment in one of two firms .pdf
The Case of Sam Sawyer Sam Sawyer was a toprated operator i.pdf
Second Republic Bank is a lending company that operates in t.pdf
Researchers found that a person in a particular country spen.pdf
QUESTION 2 internal rate of return method 14 RETURN USE N.pdf
Question 17 Which of the following contributes directly to t.pdf
Proporcione ejemplos de cmo Chris y Alison participaron en .pdf
Please Use SWISH and write the code answer each part carefu.pdf
PLEASE HELP ME Eric Christopher Associate Director for Glo.pdf
please help with the fill in the blanks Fill in the followin.pdf
Patient Documentation Analysis Due Date Sunday 1159 pm MT.pdf
Please fix the following C++ code to compile correctly in Vi.pdf
output and explain There is Mylist There is MyArrayList pa.pdf
Name the hormones that influence the menstrual cycle Ident.pdf
Mike and Carol Brady realized that their house was not big e.pdf
Debugging C Console Program Debug the program to identify .pdf
742 Example 743 Continued Suppose that we have iid Ber.pdf
Holt Enterprises recently paid a dividend D0 of 275 It .pdf
2 Use the information above to complete the Aging of Accoun.pdf

Recently uploaded (20)

PPTX
What’s under the hood: Parsing standardized learning content for AI
PDF
HVAC Specification 2024 according to central public works department
PDF
Hazard Identification & Risk Assessment .pdf
PDF
IP : I ; Unit I : Preformulation Studies
PPTX
Education and Perspectives of Education.pptx
PDF
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
PDF
Climate and Adaptation MCQs class 7 from chatgpt
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PDF
My India Quiz Book_20210205121199924.pdf
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PDF
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PPTX
DRUGS USED FOR HORMONAL DISORDER, SUPPLIMENTATION, CONTRACEPTION, & MEDICAL T...
PDF
LIFE & LIVING TRILOGY - PART (3) REALITY & MYSTERY.pdf
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PDF
semiconductor packaging in vlsi design fab
PDF
Journal of Dental Science - UDMY (2020).pdf
PPTX
Introduction to pro and eukaryotes and differences.pptx
What’s under the hood: Parsing standardized learning content for AI
HVAC Specification 2024 according to central public works department
Hazard Identification & Risk Assessment .pdf
IP : I ; Unit I : Preformulation Studies
Education and Perspectives of Education.pptx
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
Climate and Adaptation MCQs class 7 from chatgpt
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
Cambridge-Practice-Tests-for-IELTS-12.docx
My India Quiz Book_20210205121199924.pdf
A powerpoint presentation on the Revised K-10 Science Shaping Paper
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
B.Sc. DS Unit 2 Software Engineering.pptx
DRUGS USED FOR HORMONAL DISORDER, SUPPLIMENTATION, CONTRACEPTION, & MEDICAL T...
LIFE & LIVING TRILOGY - PART (3) REALITY & MYSTERY.pdf
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
semiconductor packaging in vlsi design fab
Journal of Dental Science - UDMY (2020).pdf
Introduction to pro and eukaryotes and differences.pptx

i am trying to add the first four lines of a studenttxt int.pdf

  • 1. i am trying to add the first four lines of a student.txt into an arraylist of type student and the next few lines into an arraylist of type course. i have to do this for each student in the txt. However, i keep running into errors. Below is the students.txt Michael West 900753 2003 TruE Art Appreciation,1090,3,sync,T Data Structures,2735,5,online,MWF Calculus,1070,4,in-person,MTWF Personal Finance,1070,3,online,TBD Health Ethics,2080,3,async,TR Festus Park 900846 2000 False Art Appreciation,1090,3,sync,T Intro to CS,1724,4,in-person,MWTF Statistics,2010,3,Online,MWF Personal Finance,1070,3,online,TBD Africa and the World,2090,3,sync,WF Ahmed Nord 900963 2004 true Intro to Philosophy,1070,3,online,TR Data Structures,2735,5,online,MWF Intro to Tennis,1000,3,in-person,MWF Personal Finance,1070,3,online,TBD Health Ethics,2080,3,async,TR Tasha Ohlder 900102 1994
  • 2. true Intro to Sociology,1010,3,async,MW Data Structures,2735,5,online,MWF Statistics,2020,4,online,MWRF Personal Finance,1070,3,online,TBD Intro to Theology,1080,3,async,WF Earl Mint 900159 2003 false Calculus,1070,4,online,MTWF Intro to CS,1724,4,in-person,MWTF Personal Finance,1070,3,online,TBD Health Ethics,2080,3,async,TR English Composition,2010,3,online,MWF Katie Easton 900951 2000 false Discrete Structs,2550,3,online,TR Intro to CS,1724,4,in-person,MWTF Intro to Karate,1040,3,in-person,MWF Personal Finance,1070,3,online,TBD Health Ethics,2080,3,async,TR Kennedy Dotson 900237 1999 True Intro to Philosophy,1070,3,online,TR Data Structures,2735,5,online,MWF Intro to Data Science,1070,4,in-person,MWF Personal Finance,1070,3,online,TBD Nick Peoples 900856 2001 False Intro to Sociology,1010,3,online,MW Intro to CS,1724,4,in-person,MWTF Intro to Tennis,1000,3,in-person,MWF
  • 3. Personal Finance,1070,3,online,TBD Olivia Priest 900123 1999 True Intro to Philosophy,1070,3,online,TR Data Structures,2735,5,online,MWF Intro to Data Science,1070,4,in-person,MWF Macro Economics,2020,3,sync,TW Personal Finance,1070,3,online,TBD Rashad Black 900456 2001 False Intro to Sociology,1010,3,online,MW Intro to CS,1724,4,in-person,MWTF Intro to Tennis,1000,3,in-person,MWF Personal Finance,1070,3,online,TBD How Things Work,1010,3,async,WF Michael West 900753 2003 TruE Art Appreciation,1090,3,sync,T Data Structures,2735,5,online,MWF Calculus,1070,4,in-person,MTWF Personal Finance,1070,3,online,TBD Health Ethics,2080,3,async,TR Festus Park
  • 4. 900846 2000 False Art Appreciation,1090,3,sync,T Intro to CS,1724,4,in-person,MWTF Statistics,2010,3,Online,MWF Personal Finance,1070,3,online,TBD Africa and the World,2090,3,sync,WF Ahmed Nord 900963 2004 true Intro to Philosophy,1070,3,online,TR Data Structures,2735,5,online,MWF Intro to Tennis,1000,3,in-person,MWF Personal Finance,1070,3,online,TBD Health Ethics,2080,3,async,TR Tasha Ohlder 900102 1994 true
  • 5. Intro to Sociology,1010,3,async,MW Data Structures,2735,5,online,MWF Statistics,2020,4,online,MWRF Personal Finance,1070,3,online,TBD Intro to Theology,1080,3,async,WF Earl Mint 900159 2003 false Calculus,1070,4,online,MTWF Intro to CS,1724,4,in-person,MWTF Personal Finance,1070,3,online,TBD Health Ethics,2080,3,async,TR English Composition,2010,3,online,MWF Katie Easton 900951 2000 false Discrete Structs,2550,3,online,TR Intro to CS,1724,4,in-person,MWTF
  • 6. Intro to Karate,1040,3,in-person,MWF Personal Finance,1070,3,online,TBD Health Ethics,2080,3,async,TR Kennedy Dotson 900237 1999 True Intro to Philosophy,1070,3,online,TR Data Structures,2735,5,online,MWF Intro to Data Science,1070,4,in-person,MWF Personal Finance,1070,3,online,TBD Nick Peoples 900856 2001 False Intro to Sociology,1010,3,online,MW Intro to CS,1724,4,in-person,MWTF Intro to Tennis,1000,3,in-person,MWF Personal Finance,1070,3,online,TBD Olivia Priest
  • 7. 900123 1999 True Intro to Philosophy,1070,3,online,TR Data Structures,2735,5,online,MWF Intro to Data Science,1070,4,in-person,MWF Macro Economics,2020,3,sync,TW Personal Finance,1070,3,online,TBD Rashad Black 900456 2001 False Intro to Sociology,1010,3,online,MW Intro to CS,1724,4,in-person,MWTF Intro to Tennis,1000,3,in-person,MWF Personal Finance,1070,3,online,TBD How Things Work,1010,3,async,WF My code is not working at all here is what i have //reading through student data ArrayList<Student> hwData = fileRdr("hw02Data.txt") ; System.out.println("Students data: n" + hwData) ;
  • 8. //reading through student data ArrayList<Student> hwData = fileRdr("hw02Data.txt") ; System.out.println("Students data: n" + hwData) ; //Function definitions //file rdr public static ArrayList<Student> fileRdr (String fname) throws FileNotFoundException{ ArrayList<Student> studentAL = new ArrayList <> () ; ArrayList <Course> cAL = new ArrayList <> () ; Scanner readFile = new Scanner(new File(fname)) ; while(readFile.hasNextLine()) { String name = readFile.next() ; int id = readFile.nextInt() ; readFile.nextLine() ; int birthyear = readFile.nextInt() ; boolean isSciMajor = readFile.nextBoolean() ; readFile.nextLine() ; Student s1 = new Student(name,id,birthyear,isSciMajor) ; studentAL.add(s1) ; while(readFile.hasNextLine()) { String line = readFile.nextLine() ; if(line == "") { ; } // String [] data = line.split(",") ; Course c2 = new Course(data[0],data[1],Integer.parseInt(data[2]),data[3],data[4]) ; cAL.add(c2) ;
  • 9. System.out.println(cAL) ; } //while loop } return studentAL ; } //function call //Function definitions //file rdr public static ArrayList<Student> fileRdr (String fname) throws FileNotFoundException{ ArrayList<Student> studentAL = new ArrayList <> () ; ArrayList <Course> cAL = new ArrayList <> () ; Scanner readFile = new Scanner(new File(fname)) ; while(readFile.hasNextLine()) { String name = readFile.next() ; int id = readFile.nextInt() ; readFile.nextLine() ; int birthyear = readFile.nextInt() ; boolean isSciMajor = readFile.nextBoolean() ; readFile.nextLine() ;
  • 10. Student s1 = new Student(name,id,birthyear,isSciMajor) ; studentAL.add(s1) ; while(readFile.hasNextLine()) { String line = readFile.nextLine() ; if(line == "") { ; } // String [] data = line.split(",") ; Course c2 = new Course(data[0],data[1],Integer.parseInt(data[2]),data[3],data[4]) ; cAL.add(c2) ; System.out.println(cAL) ; } //while loop } return studentAL ; } //function call End of the function here is the error Exception in thread "main" java.util.InputMismatchException
  • 11. at java.base/java.util.Scanner.throwFor(Scanner.java:939) at java.base/java.util.Scanner.next(Scanner.java:1594) at java.base/java.util.Scanner.nextInt(Scanner.java:2258) at java.base/java.util.Scanner.nextInt(Scanner.java:2212) at Main.fileRdr(Main.java:49) at Main.main(Main.java:11) Exception in thread "main" java.util.InputMismatchException at java.base/java.util.Scanner.throwFor(Scanner.java:939) at java.base/java.util.Scanner.next(Scanner.java:1594) at java.base/java.util.Scanner.nextInt(Scanner.java:2258) at java.base/java.util.Scanner.nextInt(Scanner.java:2212) at Main.fileRdr(Main.java:49) at Main.main(Main.java:11) please help me to fix my code Classes for Objects They have defined: State; behavior; & how to contruct objects of the typeCourse - name: String - courseNum: String - creditHrs: int - mode: String - meetings: String + Course () + Course (name: String, courseNum: String, creditHrs: int, meetings: String) + tostring () : String + getters/setters + equals (o: Object): boolean + hashcode () : int