From the course: Programming for Non-Programmers: Android & Kotlin

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

View the app's code structure visually

View the app's code structure visually

From the course: Programming for Non-Programmers: Android & Kotlin

Start my 1-month free trial

View the app's code structure visually

- [Instructor] The last thing I want to do before writing the code for the application is go over how the app is going to work. So here's the flow of the application. The user will tap numbers, and see response at the top in the textView. Then the user should tap the plus or the minus button to put the calculator in addition or subtraction mode. Then, the user will tap more numbers again. And finally, tap the equals button to see the result. Of course, they could always tap the clear button to start over. In doing this, it's important to think about the necessary properties. What data do we need to store in the application? We need some way to store all of the numbers entered into the calculator. We need to store the current mode of the calculator, whether it's addition or subtraction. We need to check to see whether the last button in the calculator that was pressed was a mode button. The reason why we need to know that is because, when the user presses a numeric button on the…

Contents