Page 137 - Computer Software Application TP - Volume 1
P. 137

COMPUTER SOFTWARE APPLICATION - CITS





                 let fruits = [“apple”, “banana”, “orange”];
                 // Objects (collections of key-value pairs):
                 let person = { name: “Jane”, age: 25 };
                 const PI=3.14;

                 console.log(“Value of num:”, num);
                 console.log(“Value of text:”, text);
                 console.log(“Value of isTrue:”, isTrue);
                 console.log(“Value of fruits:”, fruits);
                 console.log(“Value of person:”, person);

                 console.log(“Value of PI:”, PI); // Output: 3.14
                 </script>
                 </body>
                 </html>

              3  Save the program as a .html file
              4  Open the html file with a web browser
              5  Go to the browsers console tab and verify the output.


























           TASK 2: Using Operators
           I  Arithmetic Operators
              1  Open the text editor
              2  Write the following codes
                 <html >
                 <head>

                 <title> Arithmetic Operators </title>
                 </head>
                 <body>
                 <script>

                 let a = 10;



                                                           122
                               CITS : IT & ITES - Computer Software Application - Exercise 38
   132   133   134   135   136   137   138   139   140   141   142