Question: Develop an iOS application in Swift, which can calculate the Body Mass Index of a person and determine whether a person has normal weight, is
Develop an iOS application in Swift, which can calculate the Body Mass Index of a person and determine whether a person has normal weight, is overweight, or is underweight.
Create the UI where the user can give his input weight, height, gender. Then there should be a button on the screen that when tapped should display the UI where the app
displays the result.
The app should also display the appropriate message as per the calculated BMI. That is if a person is underweight or overweight, it should display a message in red color that
you are underweight or you are overweight as the case may be and if the BMI is normal, it should display a message in green color that your weight is normal.
Write the business logic using Swift OOP concepts.
Hint: Design a screen where you can get inputs from the user. A button should be there on the same screen. Create a class with properties such as age, gender, and weight with apt
data types as required and a method to calculate the BMI. Tapping on the calculate button on the input screen should trigger the code to create the object of the above class. Using
this object, call the method having the job of calculating BMI. Use swift enum and write the cases for, normal, underweight, and overweight conditions. You can verify the BMI
ranges. normal, overweight, and underweight on internet. Use the swift enum and switchcase to decide how you will be presenting the result on the screen to the user with the
appropriate message and correct BMI.
Give the code for both the apps along with screenshots include figure captions showing outputs of the different functionalities of these apps.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
