CS 4405-01 Mobile Applications - AY2025-T1 WRITTEN ASSIGNMENT UNIT 3
CS 4405-01 Mobile Applications - AY2025-T1 WRITTEN ASSIGNMENT UNIT 3
Introduction
To create a Body Mass Index (BMI) calculator application for the client "123 Start Up," we will
develop an Android application utilizing Kotlin. This application will allow users to enter their
weight, height, and gender, subsequently calculating their BMI to assess whether they fall into the
November 24).The results will be presented with suitable messages and color coding
Implementation
Input Fields: For users to provide their weight, height, and gender.
We will establish a Person class to manage the input data and perform the BMI calculation.
NORMAL,
OVERWEIGHT
class Person(private val weight: Double, private val height: Double, private val gender: String) {
return when {
}
}
Upon the user pressing the calculate button, the application will instantiate the Person class and
calculateButton.setOnClickListener {
}
resultTextView.setTextColor(
when (category) {
Introduction
For the straightforward calculator application, we will develop a Kotlin class that executes
- class and objects. (n.d.). This process will incorporate the use of classes, objects, constructors,
Implementation
The Calculator class will encompass properties for the operands and a method to carry out
package com.example.ucalculator
This is an example of how the Calculator class can be utilized within your application.
The BMI calculator application exemplifies the application of classes, enums, and object-oriented
programming principles within the Kotlin programming language. Kotlin programming language.
(2021, November 24). Additionally, the straightforward calculator application serves to further
capabilities in creating functional and user-friendly applications for the Android platform. Kotlin
677 Words
References
1. GeeksforGeeks. (2021, August 17). Kotlin android tutorial. Retrieved June 23, 2022,
from https://www.geeksforgeeks.org/kotlin-android-tutorial/
tutorialspoint. https://www.tutorialspoint.com/kotlin/kotlin_class_and_object.htm
android-tutorial/
TutorialKart. https://www.tutorialkart.com/kotlin/kotlin-oop/
6. Kotlin programming language. (2021, November 24). GeeksforGeeks. Retrieved June 23, 2022,
from https://www.geeksforgeeks.org/kotlin-programming-language/
7. lmf. (2020, November 6). Build your first android app in kotlin. Android
Developers. https://developer.android.com/codelabs/build-your-first-android-app-kotlin#0