package gradebook; import java.util.Collection; /** A Graded Item represents an assignment in the gradebook, outlined in Section 2.4 of the requirements documentation. The data in GradedItem contains a Category that the graded item is grouped under in the Spreadsheet view. Graded items also contain a GradedItemType that dictates how the assignment is scored. This class also contains a string for the name, booleans for hiding the assignment, allowing extra credit, and accepting late assignments. If the assignment can be turned in late, a LateType object is provided to dictate how to deduct points appropriately. */ public abstract class GradedItem{ Category category; GradedItemType type; String name; boolean isHidden; boolean allowExtraCredit; boolean acceptLate; LateType lateType; } /** A GradedItem type dictates how an assignment is graded. This is the parent class of the PointsType, PercentageType, and PlusCheckMinusType. */ abstract class GradedItemType{} /** PointsType extends GradedItemType to include an integer to save the total number of points allowed. */ abstract class PointsType extends GradedItemType{ int totalPoints; } /** The PercentageType class extends GradedItemType to include an interger to save the total percentage possible. */ abstract class PercentageType extends GradedItemType{ int totalPercentage; } /** A PlusCheckMinusType extends GradedItemType to allow an item to be graded on a plus, check, minus scale. The PlusCheckMinusType includes integers to specify the percentage ranges for each mark. Two integers specify the minimum and maximum percentage values for the check mark grade. The maximum check value corresponds to the minimum check mark value, and the minimum value corresponds to the maximum minus mark value. All plus, check, minus graded items must fall within 0% to 100% */ abstract class PlusCheckMinusType extends GradedItemType{ int checkMin, checkMax; } /** A LateType is an abstract class that dictates how points are deducted for turning in late assignments. */ abstract class LateType{/* */} /** A DecayLate object extends LateType to dictate how points are deducted for assignments at a decay rate. This behavior is outlined in Section 2.4.1 The data for this class are an integer to specify the amount of points/percentage to deduct for each unit of time late and two booleans to specify whether the assignment is deducted by percentage or points and to deduct daily or hourly. */ abstract class DecayLate extends LateType{ int amountToDeduct; boolean isPoints; //if false, percentage boolean deductByDay; //if false, deduct hourly } /** A GracePeriodLate object extends LateType to dictate how points are deducted for assignments on a grace period rate. The behavior is outlined in Section 2.4.1 The data for this class are an amount of days/hours allowed and a boolean to specify whether or not the assignment is deducted hourly or daily */ abstract class GracePeriodLate extends LateType{ int gracePeriodAmount; boolean isDays; //if false, grace period is handled hourly }