In this program, create a class called Grade that stores a numerical score and has an action to convert the score to a letter grade. Build this class in the grade.quorum tab in the editor. This class stores an integer score as a field. It must also have a setter and getter action for the score field. The setter action sets the score field and is called SetScore. The getter action gets the score field and is called GetScore. The last action this class needs is the ConvertToLetterGrade action, which returns a letter grade for the value stored in the score field. Build all of this in the grade.quorum tab.
The Main.quorum tab uses the Grade class to set the score and convert it to a letter grade. When you have made the Grade class, this program will output the following.
83 is a letter grade of B
Coding:
Hotkey Shortcuts
Move BlocksUP or DOWN or TAB
Run Program ALT + SHIFT + R
Stop Program ALT + SHIFT + S
Hide Tray ALT + SHIFT + X
Zoom In ALT + +
Zoom Out ALT + -
Open Help ALT + SHIFT + H
Navigate to Tray ALT + 1
Navigate to Blocks ALT + 2
Enter Navigation Mode SHIFT + ENTER
Switch to Next Tab CTRL + Tab
Switch to Previous TabCTRL + Shift + Tab
Blocks
Hint
Great job!
Try again
Add the class block. Inside this block, add the field and three actions. Similar to previous problems, use an if block in the ConvertToLetterGrade action to return the letter grade for the value of score. The SetScore action is used in Main.quorum to set the value of score. Your program should have the following outline.
class Grade integer score = 0 action SetScore(integer value) end action GetScore returns integer end action ConvertToLetterGrade returns text end end