Written Assignment Unit 3 - CS 4405-01 (Mobile Applications)
Written Assignment Unit 3 - CS 4405-01 (Mobile Applications)
Introduction
As a mobile application developer, I was responsible for developing two Android applications
based on unique customer needs. The first application is a BMI calculator, which helps a
corporation track the health of its personnel. The second is a basic calculator that can perform
simple arithmetic operations. Both applications will be built with Kotlin, which uses Object-
Oriented Programming (OOP) concepts to generate structured and reusable code. This paper
describes the procedures I followed to accomplish each section of the assignment, as well as the
In the first part of the assignment, the goal was to create an Android application that calculates
the Body Mass Index (BMI) of a user and classifies them as underweight, normal weight, or
overweight. The app is designed to take inputs from the user, such as weight, height, and gender,
and display the BMI result with appropriate color coding based on the classification.
Steps Taken
layout included EditText fields for the user to input their weight and height, and a
Spinner to allow selection of gender. I also added a "Calculate" button that triggers the
BMI calculation.
2. Business Logic: Next, I created a Kotlin class named Person to represent the user's
details. This class contained properties for weight, height, and gender. I then
3. Enum Class for BMI Categories: I created an enum class BMICategory to represent
enum class helped categorize the BMI value based on predefined ranges:
4. Displaying Results: Once the BMI was calculated, I used a when clause to determine
the category the user falls into and displayed the result on a new screen. If the user was
underweight or overweight, the message was displayed in red, while a normal BMI result
input when the "Calculate" button was clicked. I instantiated the Person class using the
input values and called the calculateBMI() method. The result was then displayed
For the second part of the assignment, I developed a simple calculator app that could perform
OOP concepts. The app took two numeric inputs and performed the selected operation based on
user choice.
Steps Taken
EditText fields to accept the operands and four buttons to represent the four
operand2 to store the two input values. A constructor was used to initialize these
3. Enum Class for Operations: To represent the four operations, I created an enum class
structured way:
}
4. Operation Logic: I implemented a method performOperation() within the
clause to determine which operation to perform based on the selected enum value:
operation button. When a button was clicked, I retrieved the input values, instantiated the
corresponding operation type. The result of the calculation was then displayed on the
screen
Conclusion
employing essential OOP concepts like classes, objects, constructors, and enum classes. The
BMI calculator helps 123 Start Up employees manage their health, while the basic calculator
applications meet the requirements and provide practical examples of how Kotlin can be used to
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
Traversy Media. (2020, November 10). Build a simple android app with kotlin [Video].
YouTube. https://www.youtube.com/watch?v=BBWyXo-3JGQ