Question
Java 2 1) Create a class that include variables for student name (String) and score (int). 2) Create an ArrayList that will contain the class
Java 2
1) Create a class that include variables for student name (String) and score (int). 2) Create an ArrayList that will contain the class as an object. 3) Your program should read score.txt using Scanner. The file contains the name and score for each student. 4) Name and score should be stored in the ArrayList. 5) After reading the file, print all the students name and score from the ArrayList. 6) ** If you dont know how to read a file, manually save all the 4 students data. 7) Ask for the user to input a desired score using Scanner. 8) If the users input is not an integer, ask for input again. (Accept only integer) See exception. 9) Print name and score of student whose score is >= the users desired score.
//print in file Ed 20 Tom 30 Jane 27 Jessica 28
Input desired score: k Input integer number only ) Input desired score: 28 Tom 30
Jessica 28
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