Question: Written in Android Design and write an app that calculates a person's BMI (Body Mass Index). Users should be able to enter their weight and
Written in Android
Design and write an app that calculates a person's BMI (Body Mass Index). Users should be able to enter their weight and height in english units (pounds and inches) and then calculates and displays the BMI.
BMI formula
weight in pounds * 703
BMI = -----------------------------------
height in inches * height in inches
The app should also display a message based on the following information from the Department of Health and Human Services:
BMI less than 18.5 Underweight
BMI between 18.5 and 24.9 Normal
BMI between 25 and 29.9 Overweight
BMI greater than or equal to 30 Obese
Your app initially needs to have two buttons, one to perform the calculation and one to clear the text input and display boxes.
You should use an embedded TableLayout to format the label/entry pairs and you should have a text box at the bottom of the screen to display errors like missing data. The text boxes for input should allow only numbers, with a decimal point if you think that is appropriate. Numeric output should be formatted to display one digit to the right of the decimal point. Additionally, you should develop and implement an alternate landscape layout with the widgets rearranged (if necessary) to fit better on a horizontal screen. (Ctrl-F12 will toggle between the orientations when using the emulator.)
Once this screen works correctly, you need to add a target heart rate calculator. Add another button to the BMI screen that will take the user to a new screen (new activity/intent) that will allow the user to enter their age and then calculate and display their maximum and target heart range rates.
The formula for calculating your maximum heart rate is 220 - age in years. Your target heart rate is in a range of 50 to 85 percent of your maximum rate. Note(on the screen or as another screen) that these numbers are just estimates and will vary depending upon the persons health, fitness and gender, and that everyone should consult their doctor before starting a new exercise plan.
You will also need a back button on the new screen to return the user to the BMI calculator. You do not have to pass any information back. Use some other color (other than the default) either for the background or text. Put at least one new color in the colors.xml file and use it at least once on each screen. Use your own good judgment in designing
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
