A GPA calculator in JavaFX attempting to use the Model View Controller (MVC) pattern
A GPA calculator in JavaFX attempting to use the Model View Controller (MVC) pattern
A GPA is simply a weighted average. You can see more examples on UVM's help page The calculate GPA, you multiply the number of credits by the numerical grade for a class and divide by the total credits
Grade | Value |
---|---|
A+ | 4.0 |
A | 4.0 |
A- | 3.67 |
B+ | 3.33 |
B | 3.0 |
B- | 2.67 |
C+ | 2.33 |
C | 2.0 |
C- | 1.67 |
D+ | 1.33 |
D | 1.0 |
D- | 0.67 |
F | 0.0 |
When including your current GPA, this program may yield a total GPA that's off by 0.01. This is because your school may round up or down when calculation your overall GPA and including your Overall GPA may be slightly different than entering all the classes individually.
UVM rounds down when calculating your overall GPA. Thus 3.5995 is just 3.59 and not 3.60. This program also reflects that convention even if it's not mathematically equivalent.
@FXML
annotation
@FXML
TextField
events (long way)
-fx-pref-width
, -fx-min-width
, -fx-max-width
Ctrl+F
-fx-pref-widthFXML GridPane
initialize()
is done:Platform.runLater(()->class1Grade.requestFocus());
onBlur()
(leave TextField
)Scene
from GUI objectStage
from GUI objectsetOnAction()
to separate inner class in Controller
addEventHandler()
https://gjf2a.blogspot.com/2015/01/dynamically-adding-javafx-controls.html