2017년 4월 3일 월요일

HELP FOR THE SPINNER BLOCK AND CONNECTION TO DATABASE AND CONNECTION TO ARDUINO


Please I just want a help with my application where it should be calculated based on the formula below.

I don't know how to do if the weight is in kilograms or lbs. and in height how can i get if it is in cm or inches using the Spinner Block.

Also I don't know if it will work together with the arduino to count footsteps and also how can i create database.

Thanks for the BIG help, very much appreciated.

W = weight in kilograms (weight (lbs)/2.2) =weight in kg
H = height in centimeters (inches x 2.54) =height in cm
A = age in years

Men: BMR=66.47+ (13.75 x W) + (5.0 x H) - (6.75 x A)
Women: BMR=665.09 + (9.56 x W) + (1.84 x H) - (4.67 x A)


SMARTPHONE_APP.aia

--
Search the forum! This same question had been asked before, and anyway you would spoil all the fun for yourself if you would not try to learn some app inventor first.
And if you post an .aia, post also a screenshot of the blocks, usually it spares us the need to open your .aia

--
============> Your blocks did not copy in the right way. So they are not here.

​Here's the updated blocks.

I don't know what's wrong with this blocks. I Know my formula was right.

Help me with this problem.

================= Your reply was not posted, apparently because you sent it to me privately and only cc-ed the forum.
And I saw that it was you who posted this question earlier. Why did you not continue on that thread?

Anyway, I cannot help you if you do not say what the problem is. If you do the calculation, does it give the wrong values? Did you try DoIt to find out where it goes wrong?
What does this formula mean, anyway? What does BMR stand for?

One thing I noticed: global gender is 66.47 for males and 665.09 for females. Is there a 600 times difference between males and females? How?

--
See attached for how to nest expressions, and how to name variables, parameters, and functions by purpose and type, for clarity.

I left calling the choice of function based on sex to you.

You can copy the blocks across projects 
using the BackPack.



--
Sorry for the inconvinience. here is the block I've created



--
Sir, thanks for your help.

But I've created a spinner for the selection if the height is for inches or in cm. and for the weight in klg or lbs.
for the user to choose whether what's is he/she going to select.

--
Your problem is this:
You cannot be sure that the "when Spinner.AfterSelection" is ever called, because if the default selection is already what the user wanted, there is no need to call it.

You can do eithor of two things:
1. Make the selection initially something like: "please choose ...". You must then when calculate is clicked test whether the user made a selection (selectionIndex not equals 1) and show an error message if not.
Or:
2. The other way is not to bother about the AfterSelection blocks and do all the calculation in the "when Calculate.Click" block.

--


댓글 없음:

댓글 쓰기