Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 151 - 2615_KEC
P. 151

    } else {

                                 setText("resultLabel", "Wrong answer, try again.");

                         }

                     };

                     Note: To perform it, add label, Text Input and button in design mode.

                            REVISIT

                          ▶ In Code.org’s App Lab, variables allow us to manage user input, perform calculations and
                          control program behaviour dynamically.
                          ▶ In App Lab, operators and conditional statements help you perform calculations, compare
                          values and make decisions in your program.

                          ▶ Conditional statements allow programs to make decisions based on conditions.
                          ▶ In App Lab, you can use Boolean operators (&&, ||, !) to make your program smarter.

                          ▶ In App Lab, we can create functional apps using variables and conditional logic.

                                                       HANDS-ON PROJECT

                     PROJECT NAME: Interactive Calculator

                     Objective:

                       Design and build an interactive calculator that can perform basic arithmetic operations
                       (addition, subtraction, multiplication, division).

                       Create a user-friendly interface with buttons for numbers, operators and result display.

                       Implement the logic behind the calculator using event handling, variables and conditionals
                       to process user inputs and display results.

                                                                              Working with Variables and Conditional Logic  149

| 146 147 148 149 150 151 152 153 154 155 156 |