Lab 3 - Student Record Search
For our final lab we will be building on the application we created in Lab 2, using the
Student class and the StudentRecordTracker class. We are going to create an
interactive application that will allow a user to search student records. Please note this
lab covers material from Unit 1 through to Unit 6. The guidelines below are a
ecommended approach to completing this final lab.
Read and analyze the problem and ensure that you have a complete
understanding of the requirements.
Refer back to Unit 2 - specifically the lesson on Do While Loops and implement
the event controlled loop required to for the interactive component for your
program. This code should go in your StudentRecordTracker.java class. At this
stage simply implement the code that asks the user for a student number then
prompt the user to enter 1 to continue or 2 to exit. We will be writing the
searching logic in week 6.
After reviewing the material in Unit 6, create an a
ay to store Student objects.
Initialize your a
ay with the student objects you created in Lab 2.
Be sure that you have a method in your student class that returns the student
number. You will need this in order to do your search.
Implement the searching logic using a for loop.
Continue working on your searching logic if you haven't completed it yet.
Be sure that you have followed the co
ect Java naming and style guidelines.
Test your program and ensure that it is e
or free and produced the co
The Student Record Tracker - Requirements
The requirements for this program are fairly straightforward. The program must allow
the user enter a student number which will be used to search an a
ay of Student
objects. If a student record is found the program should display the student's first name,
last name, their program and the final grade they received. You can simply display all
this information on a single line - (Use the StringBuilder class to do this to make your job
easier). If a student record is not found the program should display the appropriate
message. When the search is complete the program should ask the user if they wish to
continue searching or exit the program.
When working through this problem keep in mind the lesson on "A
ays of Objects" in
unit 6. Remember that we can run object methods from an a
ay. This will be a critical
component of your searching logic. Also please refer to the lesson on "Parallel A
ay Searching", looking specifically at the final ProductSearch.java example. In
this case we aren't using parallel a
ays rather a single a
ay of objects however the
searching logic is very similar. When you locate the matching student record be sure
that you set your flag and set your index value so that you can locate that object in the
ay later on in your code.
You may use the Scanner class or the JOptionPane class to accept input from the user.
Create a folder on your computer called C:\IntroToJava\Lab 3, place all your .java files
equired for this lab in that directory. Zip the contents of that directory and upload your