Composition

Print this diagram of the data structures used in Composition6 demo & use a pencil to fill in the data from the associated data file.

Copy and paste the code found in the Composition6 demo program into a new project and class named Composition.

Modify the program to fulfill the following specifications. See the code for instructions on where to add a few of the parts explained below. Note that all three classes Composition, Name, and Student are typed into the same file for convenience. Do not add any instance fields or "interesting" methods to the Name or Student classes.

1. Use the model to add pre and post-conditions to all methods in the Student class.

2. Implement any missing accessor and modifers to the Student and Name classes that there may be. That is, each instance variable should have an accessor and a modifier.

3. Implement default constructors to the Student and Name classes. The following lines of code may be useful
myName = new Name(????);
mySchedule = new ???[4];
myGrades = new ???[4][2];

4. Add code to the client program (i.e. the main method) that computes and displays the overall class average of all semester grades from all students in all of each student's classes. In other words, this segment of code will display one number that represents the combined average grade of all students (e.g. 88.945)! Label this part as "Part 4" in your source code comments and your output.

5. Add code to the client program (i.e. the main method) that prints a list of the names of all students (in the format "Jane Doe") who are failing (i.e. have a gpa of less than 60%). Label this part as "Part 5" in your source code comments and your output.

6. Add code to the client that allows the user to input a student's first and last names and the name of a class and then displays the average of the semester grades for that student in that class. Label this part as "Part 6" in your source code comments and your output.

7. Add code that prints the list of last names and first initials (in the format "Doe, J" with a comma) of all students who take English later in the day after Algebra. Label this part as "Part 7" in your source code comments and your output.

You may use Mr. Minich's dropbox.com data file for testing purposes. But you should also create your own data text file with different data and place it in the Public folder of your own dropbox.com account. By placing the public link to your data file as the parameter in the loadData call statement, you can test your program with other sets of test data. You can even use data files of other Java students! Be sure though to use Mr. Minich's original link when you call him to your desk to grade your program's runtime. See Mr. Minich if you have any questions about this powerful ability to test your program with data over an Internet connection!

Your program must follow the class Coding Standards.

Preconditions:

    • You can assume that valid names and classes will be inputted.
    • You can assume that there will not be two students with the same first and last names or the same last name and first initial.
    • You can assume that no student has the same class two or more times per day.

You must call the instructor to your computer to have him grade the source code and the runtime of this project.

Submit the Composition.java source file to the HandIn folder.