Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

App Inventor

Authors: David Wolber, Hal Abelson

1st Edition

1449397484, 9781449397487

More Books

Students also viewed these Programming questions

Question

Determine the sign of the given functions. cos 260, csc 290

Answered: 1 week ago