Page 115 - Modular_V2.0_C++_Flikpbook
P. 115

Step 21  From the Lists category, drag the add items to list block into the Viewer and connect
                          it to global List to store multiplication results.
                 Step 22  Use the join block to format the multiplication statement from the Text category, drag
                          the join block and connect it to the item socket of the add items to list block.

                 Step 23  Add TextBox1 input as the first number from the TextBox1 category, drag TextBox1.
                          Text and place it in the first input of the join block.

                 Step 24  Add the multiplication symbol (×) from the Text category, drag a text block (empty
                          quotes "") and type ×, then connect it as the next input in the join block.
                 Step 25  Add the loop number from the Variables category, drag "get number" and place it in
                          the join block after the × symbol.

                 This represents the multiplier (1 to 10).

                 Step 26  Add  the  equals  symbol  (=)  from  the  Text  category,  drag  another  text  block,
                          type =, and connect it as the next input in the join block.
                 Step 27  Add the computed answer from the Variables category, drag get global Answer and
                          place it as the final input in the join block.

                          The join block is  used to format the
                          multiplication equation (e.g., 5 × 1 = 5).

                 Step 28  Inside the Button1 Click block, Drag the
                          set ListView1.Elements to block into the
                          Viewer and connect get global List to it.

                          This step updates the ListView to display
                          the multiplication table stored  in  global
                          List.
                 Testing the Multiplication Table App

                 After completing the design and blocks for your Multiplication Table App, follow the given

                 steps to test it on your mobile device:

                 Step 1   Download  and install the  MIT AI2
                          Companion app on your mobile phone
                          from the Google Play Store.
                 Step 2   Click on Connect from the top menu.

                 Step 3   Click on  AI Companion from the
                          drop-down list.

                                                                                                                 113
                                                                                               App Development
   110   111   112   113   114   115   116   117   118   119   120