Created
March 30, 2020 06:57
-
-
Save xuhaibahmad/a0eaae8c183299b42140cd516fb01b4c to your computer and use it in GitHub Desktop.
This file contains 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
class GradeCalculatorActivity : AppCompatActivity() { | |
companion object { | |
private const val TOTAL_MARKS = 100 | |
} | |
private val gradeCalculator = GradeCalculator() | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_grade_calculator) | |
btSubmit.setOnClickListener { | |
val inputMarks = etMarks.text.toString().toInt() | |
val grade = gradeCalculator.getGrade(inputMarks, TOTAL_MARKS) | |
tvGrade.text = "Your Grade is: $grade" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment