Note: This lab assumes that you have completed lab 1, and that you know how to login to your account, and how to open, edit, save your files, as well as compile and run your programs. If you have forgotten any of these techniques, refer back to the lab 1 handout. Be sure to follow the directions very carefully. If you have any problems or questions, be sure to ask your instructor as soon as possible. Points will be deducted if the submitted programs do not have the appropriate comments included.
You should complete the skeleton (i.e., complete all the methods) without modifying what is already there.
By the way, the skeleton will appear to have syntax errors in it when you open it. The reason is that all Java functions (methods returning a value) are supposed to contain a return statement to return their result. The functions in the skeleton, however, do not. Once you have added appropriate return statements to all the functions, the errors will be gone.
(You are allowed to make changes to the given skeleton, if you feel that that is necessary. But if the resulting design is considered by your instructor to be inferior to the one provided in the skeleton, your grade will reflect that. And, in any case, you MUST make use of appropriate class methods to structure your solution.)
Start Eclipse, create a new project, Lab7. Import into your Lab7 project the following files from K:\CSE201\Lab7 (see Lab 1 for instructions on how to import files in Eclipse):
After importing the files, you need to tell Eclipse where to find the FileIOHelper and Student classes. To do that, carefully follow these steps:
If, when using the Student and/or FileIOHelper classes in your lab, you get compiler errors saying that these classes are unknown, it probably indicates you made a mistake in this last setup step. In that case, you may want to come back and try the setup again.
Complete the Lab7 program according to the description below. If you don't remember how to create a project or a class in Eclipse, see Lab 1 for instructions.
Enter input file name: info.txt
Name Score1 Score2 Score3 Total
--------------------------------------------------------
Andy Borders 200 250 400 850 +
John Borell 250 250 500 1000 +
John Smith 120 220 330 670 -
Brent Garland 210 230 340 780 =
Robert Fennel 200 170 350 720 -
Craig Fenner 230 220 480 930 +
Bill Johnson 140 150 220 510 -
--------------------------------------------------------
The total number of students in this class is: 7
The average total score of the class is: 780
John Borell got the maximum total score of: 1000
Bill Johnson got the minimum total score of: 510
--------------------------------------------------------
The program performs the following actions:
1 2 3where 1, 2, and 3 are separated by tabs.
<number of students>
<student name>
<score 1>
<score 2>
<score 3>
<student name>
<score 1>
<score 2>
<score 3>
...
where the first line <number of students> must contain the
number of students in the input file, <student name> is a
string representing a student name, and <score 1>,
<score 2>, <score 3> are integers representing
the three student scores.
See info.txt for a sample input file in this
format. Note that your solution must work with an input file following this
format but with an arbitrary number of student records: make sure your code
is not hard-coded to read in 7 students.
To allow you to experiment with the program you are supposed to write, we have included a demo version of the lab in the Lab7.jar file. You can run the demo from within Eclipse by selecting the Lab7.jar file in the Package Explorer view, and then selecting from the menu bar Run->Run As->Java Application. The demo starts by displaying the message:
*** This is the Lab7 Demo ***
so that you know you are running the demo.
You can/should create your own test input file, and can replace "info.txt" with the name of your file. Feel free to run and test this demo as much as you need to fully understand the expected behavior of your program.
Make sure your program compiles and runs correctly before submitting. To submit, use the Submit tool available on the Widows desktop to submit the Lab7.java file from the Lab7 project (the location of the project in the file system will be z:\eclipse\workspace\Lab7). Make sure that you select lab7 from the list of Assignments. If you don't remember how to use the Submit tool, see Lab 1 for instructions.