Using Java, write the app GPAScore that starts by obtaining a random type.lib.St
ID: 3633476 • Letter: U
Question
Using Java, write the app GPAScore that starts by obtaining a random type.lib.Student instance using the getRandom method of that class. It then outputs some student data followed by a listing of all courses of a given that this student has taken. Here is a sample run:Enter the year ... 3
Student Name: FSLL
Student ID: 396578338
Student GPA: 2.3
---------------------------------------------------
364C C
3914 D
GPA in year 3 is: 2.5
---------------------------------------------------
In this run, the user is interested in third-year courses, i.e. ones whose numbers begin with "3". Note that the student GPA is formatted with one decimal. Note also that the listing is surrounded by two dashed lines (23 hyphens each). Each line in the listing contains a course number and the obtained grade in that course separated by a tab character. The listing is followed by the GPA of the student in the listed courses. You can assume, as a pre, that the user's input is an integer between 1 and 4, inclusive. If the student has not taken any course in the specified year, a message is displayed:
Enter the year ... 4
Student Name: QRPF
Student ID: 357633975
Student GPA: 2.3
--------------------------------------
No courses taken in year 4!
--------------------------------------
Use javac command to make sure the program complies.