Question
Introduction to Programming of Baltimore County Reading from Text File Review the program Warning java that reads in a file of student academic credit data.
Introduction to Programming of Baltimore County Reading from Text File Review the program Warning java that reads in a file of student academic credit data. Each line of the input file will contain the student name (a single String with no spaces), the number of semester hours eaned (an integer), the total quality points earned (a double).
Here is the students.dat data file:
The program should compute the GPA (grade point or quality point average) for each student (the total quality points divided by the number of semester hours), and display the student name if the gpa is less than 2.0. The file Warning java contains a skeleton of the program. Do the following:
1. Add the code to calculate the gpa
2. Display the name if the gpa is less than 2.0.
3. Test to ensure the output is accurate.
4. Add code to catch the following exceptions:
.A FileNotFoundException if the input file does not exist. How will you test for this exception? .
A NumberFormatException if it can\'t parse an int or double when it tries to-this indicates an error in the input file format. How will you test for this error? Display the record number in error
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