Problem description Write a program that will read in a file of student academic credit data and create a list of students on academic warning. The list of students on warning will be written to a file. Each line of the input file will contain the student name (a single String with no spaces), the number of semester hours earned (an integer), the total quality points earned (a double). 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) then write the student information to the output file if that student should be put on academic warning. A student will be on warning if he/she has a GPA less than 1.5 for students with fewer than 30 semester hours credit, 1.75 for students with fewer than 60 semester hours credit, and 2.0 for all other students. Do the following: 1. Create a text data file "students.dat". The following shows part of a typical data file: Smith 27 83.7 Jones 21 28.35 Walker 96 182.4 Doe 60 150 2. Set up a Scanner object scan from the input file and a Print Writer outFile to the out- put file inside the try clause. Note that you'll have to create the Print Writer from a FileWriter, but you can still do it in a single statement. 3. Prompt the user for a filename. If the user enters the name of a file that does not exist, ask for another name until you get one that refers to a valid file. 4. Inside the while loop add code to read and parse the input get the name, the number of credit hours, and the number of quality points. Compute the GPA, determine if the student is on academic warning, and if so write the name, credit hours, and GPA (separated by spaces) to the output file.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
5. After the loop close the Print Writer.
6. Think about the exceptions that could be thrown by this program:
A
FileNotFoundException
if the input file does not exist.
A NumberFormatException
if it can't parse an int or double when it tries to
- this indicates an error in the input file format.
An IOException if something else goes wrong with the input or output stream.
Add a catch for each of these situations, and in each case give as specific a message as
you can. The program will terminate if any of these exceptions is thrown, but at least
you can supply the user with useful information.
7. Test the program. Test data is in the file "students.dat". Be sure to test each of the
exceptions as well. Use a driver for that.
Transcribed Image Text:5. After the loop close the Print Writer. 6. Think about the exceptions that could be thrown by this program: A FileNotFoundException if the input file does not exist. A NumberFormatException if it can't parse an int or double when it tries to - this indicates an error in the input file format. An IOException if something else goes wrong with the input or output stream. Add a catch for each of these situations, and in each case give as specific a message as you can. The program will terminate if any of these exceptions is thrown, but at least you can supply the user with useful information. 7. Test the program. Test data is in the file "students.dat". Be sure to test each of the exceptions as well. Use a driver for that.
Problem description
Write a program that will read in a file of student academic credit data and create a list
of students on academic warning. The list of students on warning will be written to a file.
Each line of the input file will contain the student name (a single String with no spaces), the
number of semester hours earned (an integer), the total quality points earned (a double).
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) then write the student
information to the output file if that student should be put on academic warning. A student
will be on warning if he/she has a GPA less than 1.5 for students with fewer than 30 semester
hours credit, 1.75 for students with fewer than 60 semester hours credit, and 2.0 for all other
students. Do the following:
1. Create a text data file "students.dat". The following shows part of a typical data file:
Smith 27 83.7
Jones 21 28.35
Walker 96 182.4
Doe 60 150
2. Set up a Scanner object sean from the input file and a Print Writer outFile to the out-
put file inside the try clause. Note that you'll have to create the Print Writer from a
FileWriter, but you can still do it in a single statement.
3. Prompt the user for a filename. If the user enters the name of a file that does not exist,
ask for another name until you get one that refers to a valid file.
4. Inside the while loop add code to read and parse the input get the name, the number
of credit hours, and the number of quality points. Compute the GPA, determine if
the student is on academic warning, and if so write the name, credit hours, and GPA
(separated by spaces) to the output file.
Transcribed Image Text:Problem description Write a program that will read in a file of student academic credit data and create a list of students on academic warning. The list of students on warning will be written to a file. Each line of the input file will contain the student name (a single String with no spaces), the number of semester hours earned (an integer), the total quality points earned (a double). 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) then write the student information to the output file if that student should be put on academic warning. A student will be on warning if he/she has a GPA less than 1.5 for students with fewer than 30 semester hours credit, 1.75 for students with fewer than 60 semester hours credit, and 2.0 for all other students. Do the following: 1. Create a text data file "students.dat". The following shows part of a typical data file: Smith 27 83.7 Jones 21 28.35 Walker 96 182.4 Doe 60 150 2. Set up a Scanner object sean from the input file and a Print Writer outFile to the out- put file inside the try clause. Note that you'll have to create the Print Writer from a FileWriter, but you can still do it in a single statement. 3. Prompt the user for a filename. If the user enters the name of a file that does not exist, ask for another name until you get one that refers to a valid file. 4. Inside the while loop add code to read and parse the input get the name, the number of credit hours, and the number of quality points. Compute the GPA, determine if the student is on academic warning, and if so write the name, credit hours, and GPA (separated by spaces) to the output file.
Expert Solution
steps

Step by step

Solved in 4 steps with 6 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

hello, can you please make it clear for me because i am paying for these questions and eventhough its not true answers .

i did copy and paste and i have this error 

tell me please what  to do exactly

Enter valid file name:
Exception in thread "main" java.util. NoSuch Element Exception
at java.base/java.util.Scanner. throwFor (Scanner.java:937)
at java.base/java.util.Scanner.next(Scanner.java: 1478)
at Main.main(Main.java:14)
Transcribed Image Text:Enter valid file name: Exception in thread "main" java.util. NoSuch Element Exception at java.base/java.util.Scanner. throwFor (Scanner.java:937) at java.base/java.util.Scanner.next(Scanner.java: 1478) at Main.main(Main.java:14)
Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
User Defined DataType
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education