Created
March 25, 2016 03:39
-
-
Save j4cksw/4153c7bf3b2eb0e8eb15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example; | |
| public class MyGradeController { | |
| private GradeDisplay display; | |
| private GradeConverter converter = new GradeConverter(); | |
| public MyGradeController(GradeDisplay display){ | |
| this.display = display; | |
| } | |
| public void onSubmit(){ | |
| Integer score = this.display.getScore(); | |
| String grade = this.converter.fromScore(score); | |
| this.display.setGrade(grade); | |
| } | |
| public void setGradeConverter(GradeConverter converter) { | |
| this.converter = converter; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment