- Familiarity with Eclipse IDE
- Java syntax, the String class
- Object oriented programming
- Javadoc comments
Task: Create a grade calculator for this course.
In this lab, you'll create a Java program to calculate grades in CS 3443.
For specifics on grades in this course and their weights, refer to the course syllabus.
Create a new project in Eclipse, following the lab guidelines.
Create two new Java classes: Lab1.java and GradeCalculator.java. (Use these names exactly!)
This class will run our application. (Hint: it must contain a main method).
It will do the following:
Note that the Lab1 class will have "hard-coded" grades - it will use the getters and setters from the GradeCalculator to set values to the appropriate grades. You will choose the value of the grades in your submission.
- Create a new GradeCalculator object
- Add grades to the calculator
- Print the calculator to the console, using the toString method.
This class will represent a calculator for this course. It must NOT have a main method in it - objects will instead be instantiated in the Lab1 class. Additionally, this class must not print anything to the console.
It must have the following:
- A constructor which takes no parameters
- Class variables for each graded item (midterm exam, labs, etc)
- A toString method, which takes no parameters and returns a String representation of the data.
- Getters and setters for all class variables
- A method called calculateFinalGrade, which takes no parameters and returns the weighted average of all grades in this course.
- A method called calculateLetterGrade, which takes no parameters and returns the letter grade cooresponding to the student's current grade in the course. (Hint: you may call the previous method).
The output of your program must match the format of the sample below. This sample is the result of running the Lab1.java class with sample data filling in the grades.
Lab average: 80.0
Quiz average: 80.0
Team project: 97
Midterm exam: 80
Final exam: 90
Final grade in this course is B (85.9)
In calculating the grade, you may assume there will be 10 labs, 10 quizzes, and 1 grade each for the team project, midterm, and final exam. If a grade is missing, your program must substitute a zero for that grade.
Prior to submitting your project, add comments to each Java file.
At the top of each class, add a Javadoc comment describing the functionality of the class. Add your name to the @author tag.
At the top of each method, add a Javadoc comment describing the functionality of the method. Add @param tags for each parameter. Add @return tag if it returns a value.
Submissions which do not compile will receive a maximum of 10 points total.
- (10pts) Comments - All comments are included and in Javadoc format.
- (10pts) Submission - The Eclipse project is correctly submitted, as abc123-lab1.zip.
- (30pts) Correctness - Both classes are declared as described above and function appropriately.
- (50pts) Tests - The grader will test your calculator by entering different grades into your Lab1 class. Your calculator must return the correct letter and average to receive full credit.