On This Page
Overview
During this assignment, you will:
- Develop a program to calculate your grade for this course
- Pass multi-dimensional arrays to methods
- Process multi-dimensional arrays of unknown sizes with loops
- Use Polymorphism to differentiate between object types
Background Information
Grades are calculated by dividing the total actual points by the total possible points within an area. These numbers are usually expressed as a percentage. For example, we may have 10 assignments worth 10 points each, or 100 points total. Your actual score on the assignments may add up to 95 points. Thus, your total assignment score is 0.95, or 95%.
Since there are multiple areas of assessment, you must calculate the percentages for each area and multiply the percentage times the weight for that area. Continuing our example, assignments may be worth 40% of the total grade. Thus the weighted percentage is 0.95 * 0.40 = 0.38.
To arrive at your total score, you sum the weighted percentages of each area.
Note the following information about scores and grading:
- All the evaluation areas and weights are on the syllabus page.
- Since you have not taken the midterm and final exam yet, your final grade will be different than your score to date.
- Each individual item in some evaluation category may have different possible scores. For instance, assignment 1 has a possible score of 10 while assignment 2 has a possible score of 20. Thus, for every item you must enter data for both possible values and actual values.
- It is possible to earn more credit on an assignment, at least in this course, than the maximum possible score. This is accomplished through extra credit and helps students make up for problems on any one assignment.
- The scores in one evaluation area cannot influence the scores in another. For instance, if you have 105% on your assignment scores, you cannot apply the extra 5% toward test scores.
- All your score data is in WebCT.
^ top
Specifications
Create a gradebook application that encapsulates your scores and calculates your grade for this course. Use the class and method declarations of the starter code to begin the design of your application.
Implement the MyScores hierarchy shown below.

MyScores must be declared abstract and all the data for a MyScores object (beyond what I provide in MyGradebook) must be declared in class MyScores; no subclass of MyScores can declare any data variable. In addition, all data must be private to class MyScores. This forces you to use proper encapsulation of the data and provide get and set methods.
In addition to the data, class MyScores must declare at least the following methods:
- A constructor with no arguments that sets the data variables to default values.
- A constructor with arguments that sets the data to the values supplied.
- Set (mutator) methods for each individual data variable declared, that allow the programmer to set any data variable. For example, if you have a variable named
data, you must have a method setData.
- Get (accessor) methods for each data variable, that allow the programmer to retrieve any piece of data independently for a score in the hierarchy. For example, if you have a variable named
data, you must have a method getData().
- A
toString method that returns a String value describing the object and its weighted percentage.
- The abstract method
calcPercentage that each subclass must implement.
public abstract double calcPercentage();
You are required to implement the preceding methods. If you would like to provide more methods, you may do so.
You may not use any switch or if-else if-else if-...-else statements in your code, with the exception of a method to convert percentages to letter grades and the calcPercentage() methods.
There should be no MyAsn or MyTest variables in any part of your program -- only MyScore variables containing references to all score objects. The program should keep an array of MyScore variables containing all the score objects. The programs reportGrade method should iterate through the array of MyScore variables and get the names and weighted percentages for every score. The accumulated score should be displayed at the end along with a letter grade.
The program must display the weighted percentages for all the assessed areas. In addition, the program must display your score and letter grade to date, as well as your score and letter grade excluding the final exam. As added steps, add code that returns the score you need to achieve on the final exam to get an "A" grade in the course. An example of the output is shown below.
Turn in the assignment using the data values supplied in the starter code. I plan to use these known data for testing.
Do not forget to document all the code. Though I have put in a few comments in the starter code, you are responsible for the accuracy and completeness of the final comments.
Sample Output
Weighted Percentages:
Assignments: 0.4
Midterm: 0.2
Final: 0.0
Total to date: 0.6000000000000001
Letter grade to date: D
Total excluding final: 0.9230769230769231
Letter grade excluding final: A
^ top
Test Cases
Testing is an important part of software development. Usually, programmers develop tests for each unit of code they produce. This is know as "unit testing" and allows the programmer to verify that the code they develop works correctly.
To assist you in developing your code, I provide tests for this assignment. These tests, known collectively as "test cases", help to make sure that your assignment meets its requirements. I will use these test cases (and perhaps others) to test your assignment, and you should too. If the test cases do not pass, then you will lose points for the assignment.
Note that the tests do not cover all conditions. Neither do the tests check all the classes. See the extra credit section if you would like to add more exhaustive tests.
Install the tests by copying the following file into the same directory as your .java source code files:
Run the tests as you would any other Java program. You may need to compile your source code before compiling and running the test code.
^ top
Extra Credit
The following are worth extra credit points:
- Create a set of tests for the
MyTest class. Your score for this extra credit will vary depending on the completeness of your test coverage. (1-3 points)
Make certain that your README.txt file lists any extra credit attempted.
^ top
Grading Criteria
The instructor will evaluate your assignment using the following criteria. Each criteria represents a specific achievement of your assignment and has a scoring guide. The scoring guide explains the possible scores you can receive.
Some scoring guides have a list of indicators. These indicators are a sign of meeting, or a symptom of not meeting, the specific criterion. Note that a single indicator may not always be reliable or appropriate in a given context. However, as a group, they show the condition of meeting the criterion.
For information on grading policies, including interpretation of scores, see the course Syllabus.
Program Compilation
- 4: Source code compiles with no errors or warnings
- 0: Does not compile
Functionality
- 10: Demonstrates mastery of the assignment
- Has extra features or demonstrates techniques beyond the assignment
- Applies concepts from the lessons appropriately
- Meets all specifications (see above) with particularly elegant solutions
- No errors encountered during operation
- All test cases pass
- 8: Has all the functionality expected of the assignment
- Demonstrates many techniques from the lesson
- Meets all specifications (see above)
- Implementation seems more complicated than necessary.
- May have one minor error
- All test cases pass
- 6: Has most of the functionality expected of the assignment
- Demonstrates some techniques from the lesson
- Meets all but one of the specifications (see above)
- Implementation seems excessively complicated.
- May have 2-3 minor errors
- All but one test case passes
- 4: Has some of the functionality expected of the assignment
- Demonstrates some techniques from the lesson
- Meets at least 1/2 of the specifications (see above)
- Implementation seems excessively complicated.
- May have more than 3 minor errors
- At least 1/2 of all test cases pass
- 2: Serious functional problems but shows some effort and understanding
- Meets less than 1/2 of the of the specifications (see above)
- Has a major error or many minor errors
- Implementation seems very convoluted
- Demonstrates few techniques from the lesson
- Less than 1/2 of all test cases pass
- 0: Does not execute
Program Style
- 4: Code is well-documented
- 3: Code has minor documentation errors
- Has 1 documentation error
- 2: Code has some documentation errors
- Has 2-3 documentation errors
- 1: Code has many documentation errors
- Has more than 3 documentation errors
- 0: No apparent attempt to document code
README.txt File
- 2: README.txt file submitted with specified information included
- 1: README.txt submitted but some information was not included
- 0: No README.txt submitted
Maximum Score: 20, plus extra credit
^ top
What to Turn In
Submit your assignment following the instructions for homework. Include the following items for grading:
README.txt file
- All of your source code (i.e.
.java files)
- Any other source code needed to make your program function
You must submit all the files needed to make your assignment function properly. Do not assume that the instructors has any files unless explicitly stated by the instructor. Your assignment must work as submitted.
^ top
Home
| WebCT
| Announcements
| Schedule
| Expectations
| Syllabus
Help
| FAQ's
| HowTo's
| Links
Last Updated: October 04 2003 @14:54:28
|