Part II: Reading a Data 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 earned (an integer), the total quality points earned (a double). Here is the students.dat data file: students.dat Smith 27 83.7 Jones 21 28.35 Walker 96 182.4 Doe 60 150 Wood 100 400 Street 33 57.4 Taylor 83 190 Davia 110 198 Smart 75 292.5 Bird 84 168 Summers 52 83.2 The program should compute the GPA (grade point or quality point average) for cach 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: • AFileNotFoundException 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.

Question
Part II: Reading a Data 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 earned (an integer),
the total quality points earned (a double).
Here is the students.dat data file:
students.dat
Smith 27 83.7
Jones 21 28.35
Walker 96 182.4
Doe 60 150
Wood 100 400
Street 33 57.4
Taylor 83 190
Davia 110 198
Smart 75 292.5
Bird 84 168
Summers 52 83.2
The program should compute the GPA (grade point or quality point average) for cach 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:
• AFileNotFoundException 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.
Expand
Transcribed Image Text

Part II: Reading a Data 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 earned (an integer), the total quality points earned (a double). Here is the students.dat data file: students.dat Smith 27 83.7 Jones 21 28.35 Walker 96 182.4 Doe 60 150 Wood 100 400 Street 33 57.4 Taylor 83 190 Davia 110 198 Smart 75 292.5 Bird 84 168 Summers 52 83.2 The program should compute the GPA (grade point or quality point average) for cach 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: • AFileNotFoundException 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.

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Programing Language

Java

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: Note:- Please type and execute this java program and also need an output for this program.

A: public class Rain { //method that query the user for 1 to 10 days of rainfall for each month public ...

Q: need help with this python recursion question. why is 4? please explain clear on each steps , please...

A: Introduction of the Program: The python program is an example of a recursive function and a recursiv...

Q: Describe a privacy issue so serious that it would case you to stop using Facebook.

A: Privacy Issue :  The privacy issue is really an important thing to discuss about when it comes to pe...

Q: An I/O port typically consists of four registers, what are these registers? Give a brief description...

A: I/O port typically consists of four registers which are as follows:- Status register Control regist...

Q: Differentiate between scalar and superscalar processor with an aid of diagrams. Superscalar processi...

A: Solution: There are  different types of CPU,s available for the computers But these CPU's does diffe...

Q: Describe the System.Data namespace class?

A: SYSTEM.DATA NAMESPACE CLASS: The namespace System.Data is basically the core part of the ADO.NET. T...

Q: Which of the following is volatile? Select one: a. Hard disk b. ROM c. RAM d. USB Flash drive

A: Volatile memory Random Access Memory is a type of computer memory that can be accessed randomly. RA...

Q: Java program

A: if previous value is same as current value, stay in run else no if current value is not same as next...

Q: this java program computes the sale of flowers. Name of flowers: daisy, pansy, rose, violet, carnati...

A: subtract the coupon value from total, if the total is greater than the coupon; display total; otherw...

Q: A personal phone directory contains room for first names and phone numbers for 30 people. Assign nam...

A: Since you have not mentioned the programming language. I am attempting this in java. if you need it ...

Q: #7 Push the value 6 to the following binary heap

A: Given array: { 4, 8, 5, 10, 14, 6, 7, 11, 13} Forming Min Heap from the array: Note: Since you are ...

Q: There are nine key components of an e-commerce process architecture that is the foundation of the e-...

A: E-commerce: E-commerce refers to electronic commerce and buying and selling activities of products ...

Q: Cache memory is an important component of today’s computers. Specify the purpose of cache memory and...

A: Cache memory refers to a memory component that holds data on a temporary basis while performing some...

Q: Using Java create a craps game prompting users to play bets, tracking win / lose records. keeping tr...

A: import java.util.*;import java.lang.*;import java.io.*;class Craps{ static int roll2Dice(Random...

Q: What is the goal of Artificial Intelligence? State the different domains of it with two examples for...

A: Actually, Artificial Intelligence is a complex software  this is similar to human brains.

Q: Computer Science Question

A: In SQL, to sort the query output "order by" clause is used. In SQL, by default sorting on a characte...

Q: Draw an ER diagram based on the following information:

A: The music database stores details of a personal music library, and could be used to manage your MP3,...

Q: 3. Decomposition – 3NF. Consider relation R=(ABCDEFG), F={AB→AC, BC→AE, AD→BCE}. (a) Is it in 3NF? P...

A: F={AB→AC,BC→AE,AD→BCE} Closure of F (F+)={A,B,C,D,E} The candidate key is the set of attributes that...

Q: Draw an ER diagram based on the following information:

A: Click to see the answer

Q: class IndexItem { public: virtual int count() = 0; virtual void display()= 0; };class Book : public ...

A: You need to implement count function and add function  

Q: For given weighted Graph, find the MS@ysing Prim and Kruskal algorithms. You must show the intermedi...

A: Start from a node and keep tract of two sets of vertices which are included in MST and which are not...

Q: Could you help me on this? Please use pointer notation instead of array

A: Actually, array is a collection of elements

Q: ) Write a program to overload the function call operator ( ) so as to allow the more common form of ...

A: Actually, array is an collection of elements.

Q: JAVA PROGRAM Write a program that asks the user to input two integers a and b. Then create an array...

A: public class Tester{   public static void main(String[] args){     int arr[];      //declare an arra...

Q: Write a program in python that allows an instructor to calculate the final grade for the students in...

A: Python is an interpreted, high-level and general-purpose programming language. Created by GVR and fi...

Q: In JavaScript, what is the purpose of using loops and what is its syntax?

A: JavaScript loops-                     JavaScript loops are used to run a block of code again and aga...

Q: 2) The ceiling of a floating-point number x is the smallest integer that is still larger than or equ...

A: Actually, python is a easiest programming language. It is a structural and object oriented programmi...

Q: Please finish fast but accurate.Thank you!

A: Actually, in single cycle one instruction will execute. 1 cycle has 3 phases fetch the data decode t...

Q: The text edited by a line editor is represented by a doubly linked list of nodes, each of which cont...

A: Actually, string is a sequence of characters.

Q: In C programming Language: use the correct program and function descriptions. use a user defined fu...

A: #include <stdio.h>#include <stdlib.h> #include <time.h>  int successful_searches=0...

Q: I need help with this in C++ please.

A: Actually, c++ is a powerful general purpose language.

Q: Discuss the possible data request scenarios in a distributed database environment.

A: Actually, distributed database is a distribute the data to different computers.

Q: Store three 16-bit numbers and four bytes in a data segment

A: mov AX 3 mov BX 4 mov CX 4  

Q: What do you consider when adapting a Process Model to a software project

A: SOFTWARE PROCESS MODEL - The basic meaning of software process model is that a simple and particular...

Q: Write while loops to do the following: Repeatedly print the value of the variable xValue, decreasin...

A: A while loop is an entry controlled loop, in which the condition is checked first before enter into ...

Q: please solve it by using FLOWCHART in VISUAL LOGIC : The student names and the grades for four test...

A: First of all, you need to have an array of strings to store names Then, you need to have for more ar...

Q: please helllllllllllllllllllllllllllllllllllp

A: Note: Answering the first three subparts i.e. a,b, and c. Given Data : Size of memory word(s) = 1048...

Q: Hi! I need help writing out the pseudocode and codes for these programs. All instructions are includ...

A: Actually, python is a easiest programming language. It has a concise(less) code, It is a structural ...

Q: Differentiate between SMEs and public sector organisations

A: SME that means - SME stands for tiny and Medium Enterprises. The SME definition in Asian country as ...

Q: How is a vulnerability evaluated in cybersecurity?

A: In context with cyber security vulnerability  is a weakness that may be misused by attacker to perfo...

Q: 10.How many 16 K memories can be placed (without overlapping) in the memory space of a processor tha...

A: Actually, memory is used to stores the data. processor is used to processing the instructions.

Q: A personal phone directory contains room for first names and phone numbers for 30 people. Assign nam...

A: import java.util.*;class PhoneNumbers {    public static void main(String[] args) {        Scanner s...