Need some help (Checkbox problem)

I am building an app to calculate something, I want to use checkbox.
How can I relate each checkbox to a number then I can add them up?

Example: (I have A, B, C here, and they related to number 1, 2, 3)
☐ A
☐ B
☐ C

And when I checked box A and C, it will add up A(1)+C(3), and show the answer 4.

Something like this:

image

image

1 Like

Another approach with dictionary blocks. Every time two or more checkboxes are checked then they get added and if un checked then subtracted

1 Like

Thank you so much @TIMAI2 and @dora_paz :bowing_man: :bowing_man: :bowing_man:

1 Like

Or this might be the simpliest way:

It also works with any number of checkboxes.

1 Like

Hi Anke, where did you get the component "component" from please

See how

Animation2

1 Like

Here is a version with 4 checkboxes:
chbSum4.aia (2.4 KB)

Remove the fourth one again if you don't need it. It's just to show that it also works with more than 3 checkboxes.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.