Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write an application which will write five student ID numbers and GPAs to a rw file called Stu.dat and then allow you to display the

Write an application which will write five student ID numbers and GPAs to a rw file called Stu.dat and then allow you to display the GPA of any student upon entering their ID number, for any number of students.

Directions

Import the classes necessary to support your application.

Create a class called ReadWrite. This class has no properties or behaviors.

Create a main method which will include the following:

Add an appropriate throws statement in the main method.

Create a reference to a text file called Stu.dat with rw access.

Include try and catch blocks for exception handling.

Use a loop to interactively assign student ID numbers and their GPA scores.

With the use of a second loop, display the GPA for specific student ID numbers.

Use a sentinel to determine when you wish to stop the program.

Include a finally block within your program.

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

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions