You are on page 1of 1

AP Computer Science 4.4 - Student Class p1 Completed?

Lab Goal : This lab is designed to give you more practice using arrays and Objects

Lab Description : Write a program that will process a class of Student data and print the student data
to the screen.
1) The first line in the file, “student.dat”, contains the number of Students in the course
2) Create a Student object from each line in the data file. Each line has the following data fields
separated by colons:
Student ID::Student Name::List of Grades (exactly 10 grades for each student)
3) Add each Student object to an array of Students
4) After all of the records have been created, print a “class report” with the data for each student including
test scores and average for each student.

Sample Data : Files Needed ::


4
600456::Demarcus Lawrence::78 98 87 92 100 100 92 45 95 86
500111::Jason Witten::98 78 92 95 85 88 80 78 86 89 Student.java
600734::Cole Beasley::77 67 87 76 72 78 98 89 78 76 StudentRunner.java
500345::Brandon Carr::78 89 67 66 76 77 82 84 78 72 student.dat

Sample Output :
------------------------ Students -------------------------
***********************************************************
Name: Average: Test Scores:
Demarcus Lawrence 87.30 [78, 98, 87, 92, 100, 100, 92, 45, 95, 86]
Jason Witten 86.90 [98, 78, 92, 95, 85, 88, 80, 78, 86, 89]
Cole Beasley 79.80 [77, 67, 87, 76, 72, 78, 98, 89, 78, 76]
Brandon Carr 76.90 [78, 89, 67, 66, 76, 77, 82, 84, 78, 72]
Jamie Sotherby 74.30 [56, 67, 74, 72, 84, 89, 77, 79, 67, 78]
Gavin Escobar 76.00 [77, 76, 56, 65, 78, 82, 81, 90, 78, 77]
Jody Johnson 85.30 [72, 84, 87, 92, 87, 82, 88, 92, 91, 78]
DeMarco Murray 71.00 [67, 63, 72, 76, 83, 89, 77, 67, 64, 52]
Rayne Dakota Prescott 96.20 [100, 97, 89, 98, 99, 92, 100, 100, 92, 95]
Angie Hughman 90.50 [92, 95, 100, 92, 87, 92, 89, 83, 90, 85]
Jessica Lange 81.60 [84, 78, 83, 89, 75, 77, 84, 82, 82, 82]
Ronald Leary 86.80 [84, 81, 94, 97, 98, 86, 85, 82, 82, 79]
DeMarcus Ware 59.10 [67, 56, 45, 62, 34, 29, 74, 77, 69, 78]
Jason Witten 76.80 [78, 75, 67, 72, 74, 77, 84, 89, 75, 77]
Tony Romo 88.00 [85, 89, 84, 100, 74, 85, 89, 93, 92, 89]
Katrina Slessinger 85.90 [87, 83, 85, 90, 90, 89, 88, 79, 82, 86]

Student class implements Comparable

private String id; Student ()


private String name; Student(String line)
private int[] grades;
String getName()
int [] getGrades()
String getId()
double getAverage() compareTo is
int compareTo(Student s) written in Part 2
String toString()
// Name and Average only

You might also like