Homework 5: Tip Calculator
Due: April 17
Let's create an app that is far more realistic and useful in our everyday life. For this assignment, we've asked you to submit an app that lets you calculate tip when you dine out somewhere.
By completing this assignment, you'll become more experienced dealing with Kotlin's String Interpolation, mathematical functions (Math
), and possibly useful functionalities like spinners and input controls.
I constantly have been mentioning that you should always refer to the Assignment section for any changes to the assignment.
Tips
Generally speaking, make sure you know how to parse a String
into a Double
. You'll need to do so in order to work with numbers for calculation.
You'll be working with text fields and buttons for this assignment. Make sure you properly declare the input method by adding android:inputType
to whatever element you've added to the XML.
Having a proper, easy-to-look-up ID for each element will be beneficial towards looking up the element in your class through findViewById<T>(R.id.name_of_object) as T
.
The syntax for Kotlin's onClickListener
is little different from Java's.. Make sure you nail this right.
Last updated