Homework Assignment 5 - Computer Science I | CSCE 155, Assignments of Computer Science

Material Type: Assignment; Class: COMPUTER SCIENCE I; Subject: Computer Science and Engineering ; University: University of Nebraska - Lincoln; Term: Spring 2006;

Typology: Assignments

Pre 2010

Uploaded on 08/30/2009

koofers-user-65u-1
koofers-user-65u-1 🇺🇸

9 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSCE 155
Spring 2006
Homework Assignment 5: Upgraded Grade Book
Assigned: March 20, 2006
Due: April 3, 2006
Note: This assignment is to be completed individually - collaboration is strictly prohibited.
Points: 100 points
Objectives
The objectives of this homework assignment:
1. Familiarize with the use of arrays
a. Manipulate a collection of data values using an array
b. Compute statistics out of an array of values
c. Declare and use an array of primitive/reference data types
2. Familiarize with the use of exception handling for data format and range checking
3. Familiarize with a sorting method
a. Using the Heap sort on an array of object elements
4. Re-use existing classes
5. Understand basic GUI objects
6. Write a GUI application
a. Identify the GUI objects that are necessary for the application
b. Organize the positions and functions of these GUI objects for the application
c. Design the application such that the user interface is sensible and user-friendly
7. Familiarize with the swing and AWT packages and layout management
8. Familiarize with code documentation, compilation, and execution
9. Expose to Java syntax, programming styles, and Java classes
Problem Description
This is a continuation of your CSE Grade Book (Homework Assignment #3). Statistical
information is important when analyzing grade data and your professor needs your help to sort
and provide statistical data for the student’s grades in his class.
1. Your program should have:
(a) Student.java that holds all the information about a student (Hint: You should reuse
your Student.java class from your Homework Assignment #3 or use (and
acknowledge) the Student.java class provided as the solution online).
(b) Exam.java that holds all the information about an exam (Hint: You should reuse your
Exam.java class from your Homework Assignment #3 or use (and acknowledge) the
Exam.java class provided as the solution online).
pf3
pf4

Partial preview of the text

Download Homework Assignment 5 - Computer Science I | CSCE 155 and more Assignments Computer Science in PDF only on Docsity!

CSCE 155

Spring 2006

Homework Assignment 5: Upgraded Grade Book

Assigned: March 20, 2006

Due: April 3, 2006

Note : This assignment is to be completed individually - collaboration is strictly prohibited. Points : 100 points

Objectives

The objectives of this homework assignment:

  1. Familiarize with the use of arrays a. Manipulate a collection of data values using an array b. Compute statistics out of an array of values c. Declare and use an array of primitive/reference data types
  2. Familiarize with the use of exception handling for data format and range checking
  3. Familiarize with a sorting method a. Using the Heap sort on an array of object elements
  4. Re-use existing classes
  5. Understand basic GUI objects
  6. Write a GUI application a. Identify the GUI objects that are necessary for the application b. Organize the positions and functions of these GUI objects for the application c. Design the application such that the user interface is sensible and user-friendly
  7. Familiarize with the swing and AWT packages and layout management
  8. Familiarize with code documentation, compilation, and execution
  9. Expose to Java syntax, programming styles, and Java classes

Problem Description

This is a continuation of your CSE Grade Book (Homework Assignment #3). Statistical information is important when analyzing grade data and your professor needs your help to sort and provide statistical data for the student’s grades in his class.

  1. Your program should have: (a) Student.java that holds all the information about a student ( Hint: You should reuse your Student.java class from your Homework Assignment #3 or use (and acknowledge) the Student.java class provided as the solution online). (b) Exam.java that holds all the information about an exam ( Hint: You should reuse your Exam.java class from your Homework Assignment #3 or use (and acknowledge) the Exam.java class provided as the solution online).

(c) ClassGrades.java that holds the name of the class the students are taking and all of the instances of student. It should also sort them and generate a statistical summary. Note this class should maintain two arrays to store the students; one with the students in the original order they were entered and a second sorted array. (d) Gradebook.java that provides all of the functionality of the class created in Homework Assignment #3. It should also have a text area that displays the students’ grades as they are entered ( Hint: You should reuse some of your Gradebook.java class from Homework Assignment #3 or use (and acknowledge) the Gradebook.java class provided as the solution online).

  1. The Gradebook’s GUI should also contain five buttons: (a) Calculate Statistics: When the user clicks this button, the program will calculate the statistical information. (b) Sort: When pressed this button will sort the array of students by their average grade for all exams values in the descending order using the Heap sort. Note that your program is not allowed to sort using any readily available Java sort libraries/functions. You must implement your own Heap sort method. (c) Save: This should save the computed student grades in a file with the name of the class as its name (e.g. cse155Grades.txt). Note this should save the data in the order it was entered not in sorted order and every time save is pressed it should only save the new students that have been added since the last time it was saved. ( Hint: Store the new students in a data structure and remove them as they are saved.) (d) Clear: When the user clicks this button, the values of all input fields are cleared. (e) Exit: When the user clicks this button, the program should check if there is unsaved data and if so ask the user if he or she would like to save the information and exit (i.e. standard Yes, No, Cancel type of dialogue). When the program exits the computed statistics should be saved at the end of the file; this is the only time that the stats should be appended to the file and if the user does not save the grades the stats should not be appended.
  2. The user should be able to remove students from the system. Consider using a Combo box with all of the students’ names listed and a delete student button.
  3. As the students are entered they should also be displayed in the textArea and it should also be updated when students are deleted (i.e. the textArea should always show a current list of students and grades.
  4. After sorting them, the Gradebook’s GUI will display the sorted students with their average grade.
  5. The Gradebooks’s GUI will also display the statistics for the class: (a) the number of students, (b) the mean of the students’ average grade, (c) the median of the students’ average grade, and (d) the standard deviation of the students’ average grade.
  6. Your program must handle exceptions and be robust.

Appendix

  1. Heap Sort (a Java implementation can be found in your textbook, Chapter 11).
  2. Average of n values is defined as
  3. Median: In a sorted data set, the median is the value of the data positioned at i = n/2 were i is rounded up if it is not an integer.
  4. Standard deviation: σ , where xi is the value of a particular instance, n is the number of instances.