Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design class Student stored in source code file Student.java. Provide data members for string student identification number ( ex . 1 0 0 0

Design class Student stored in source code file Student.java. Provide data members for string
student identification number (ex."100001"), student name (ex. "Mary Smith"), student major (ex.
"CIS"), and number of credit hours (ex.55). Provide default and parameterized constructor, accessors,
mutators, and toString methods. Include a boolean canGraduate method which returns true if the
student has at least 60 credit hours, else false.
The main application uses an array of Student. Input file
graduates.txt records the number of students in the first line
followed by lines of student data in comma-separated fashion.
a. Read the data from the file into the array. Use exception
handling with a try-catch block to end the program on a file IO
error.
b. Use an interactive loop to ask the user to enter student identifications and number of credit hours
awarded during the summer. Search for the student identification in the array and update the credit
hours. Report an error message if the identification is not found. Use exception handling with a try-
catch block to report an entry error on the integer number of summer credit hours. Hint: Read the credit
hours as a string and use Integer.ParseInt method to convert to an integer. Catch the
NumberFormatException that arises if Integer.ParseInt fails. This loop uses "quit" as the sentinel
value to stop. See sample output.
c. Produce a neatly formatted chart showing graduation status. See sample output.
The following static method in the main application is required. Other methods may be added as
desired.
// return the index of the Student with identification or -1 if not found
public static int searchID (Student [] students, String identification)
image text in transcribed

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

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

Identify psychologys main subfields.

Answered: 1 week ago