Uploaded by Baraa abu draz

quis

advertisement
Designing Android Application Calculate the ideal weight for height
This application has 3 interfaces (activities)
The First interface for Welcome has:
1- 2 Button
2- Button 1 go to the second interface application.
3- Button 2 go to the third interface about programmer.
The second interface for Application has:
Radio Button – To Choose Male or Female.
Text views – To display final result.
Edit texts
– To get the input values for height in cm and weight KG.
Button
– To get the result when it’s clicked.
To get the ideal weight Result for Male =height -100
To get the ideal weight Result for Female =height -110
If result = weight print normal
If result > weight print Overweight
If result < weight print underweight
Hint:
1- All Action inside Button not inside Button Group
2- Use if Statement to Know what selected in Radio Button
3- Use this Statement
Int selectedId =radioGroup.getCheckedRadioButtonId(); //save in selectedId the id of selected Radio
button
radioButton = findViewById(selectedId);
if (selectedId == R.id.maleid) { } //use it to compare between selected and male Radiobutton
if (selectedId == R.id.femaleid) { } //use it to compare between selected and female Radiobutton
maleid and femaleid id of RadioButton you able to naming them as you like
The Third interface for Application has:
Text views – To display information about programmer (student).
Download