Page 390 - Web_Application_v2.0_C12_Fb
P. 390

var result;
                   if (choice === "area") {
                   result = Math.PI * Math.pow(radius, 2);

                   } else if (choice === "circumference") {
                   result = 2 * Math.PI * radius;
                   } else {
                   result = "Please select a calculation.";
                   }
                   answer.textContent = (typeof result === 'number') ? result.toFixed(2) : result;
                   }
                   </SCRIPT>

                   Enter the radius of the circle:
                   <INPUT TYPE="number" ID="radius">
                   <BR><BR>
                   Choose what you want to calculate:
                   <SELECT ID="calculation">
                   <OPTION VALUE="area">Area</OPTION>
                   <OPTION VALUE="circumference">Circumference</OPTION>
                   </SELECT>
                   <BUTTON ONCLICK="calculate()">Calculate</BUTTON>
                   <P ID="result"></P>

                   </BODY>
                   </HTML>
                    Output of the preceding code is as follows:


























                21.   Create a Poster Using a Template on 'Mental Health Matters.' Open a template poster and customize it
                    with images and text.
                Ans.  Follow these steps to create a poster on Mental Health Matters in Canva:
                    Step 1:   Open any web browser and log in to your Canva account.

                    Step 2:   Click on Open menu button.


                388   Touchpad Web Applications (Ver. 2.0)-XII
   385   386   387   388   389   390   391   392   393   394   395