> For the complete documentation index, see [llms.txt](https://uw-info448.gitbook.io/info-448-android-development/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://uw-info448.gitbook.io/info-448-android-development/homework/homework-5-tip-calculator.md).

# 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.

{% hint style="warning" %}
I constantly have been mentioning that you should always refer to the Assignment section for any changes to the assignment.
{% endhint %}

## 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.&#x20;

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.
