NOTES:
This should be a Java application (not an applet). Call the only class Grades. [A similar example Java application will be discussed in class. Contest.java]
In the Grades class, there should be exactly five assignments (plus the three exams and one final). These values need both points and total fields where points is per instance and total is per class. The field names must be asgn1Points, ..., asgn5Points, exam1Points, ..., exam3Points, and finalPoints (plus the corresponding ones with Points replaced by Total).
The fields called asgns and exams will determine whether or not any of the above fields currently have valid values. We will assume that all instances have the same number of asgns and exams.
The five percents of total grade (in the PROCESS section above) should be considered constants in the Grades class (and the same for all instances).
There should be four methods (including main). A method called showPercent should be available to all while the methods called findYourPercent and findTotalPercent should be for use within the class only (used by showPercent). Each of the find methods should return the appropriate percent. The show method should give the output shown in the sample run.
Remember to concentrate on explicitly choosing either public or private and either static (or non-static) for all fields and all methods. None of the methods except main will have any parameters but any or all of them may have local variable(s). Two of the methods should not return a value.
In the main method, your should create five sample Grades objects. For each one, you should set the values of asgns, exams, or other relevant fields. [For the purposes of this assignment, you may adjust either the number of assignments and/or the number of exams for each object. This would not be the case normally.] Call the sample objects sampleObject1, ..., sampleObject5.
The first sample object should contain no assignments nor exams.
The second sample object should contain one assignment (9/10) and no exams.
The third sample object should contain no assignments and one exam (85/100).
The fourth sample object should contain one assignment (9/10) and one exam (85/100).
The fifth sample object should contain five assignments (all 9/10) and four exams (all 85/100).
Obviously, you may try other sample objects but the above five should be the only ones left in main when your assignment is turned in.
Please place the main method last in the class Grades. In testing your program, I will add another sample object or two. (I may also remove some or all of your sample objects).
All values, except the number of assignments and the number of exams which are integer, should be treated as real numbers (use double).
Like assignment #1, this program should not error off on any missing value but you may assume that values entered (via hardcoding) are non-negative.
Make certain to use the exact prompts, exact output wording, and exact output spacing shown in the sample run. (This time the numbers output should be exact.)
Remember to start with file name, your name, class, date, and purpose
- add any other helpful documentation (e.g., above section(s) of code).