Page 14 - Web_Application_v2.0_C12_Fb
P. 14

CHAPTER 2: JAVASCRIPT PART 2
                  S.No.             Learning Outcomes                   Theory                    Practical

                    1.       Create and use functions to organize and     Functions in JavaScript  1.  Write  a  program  with  2
                             reuse code effectively.                Naming a Function      functions to find simple or
                             Solve  programming  problems  using     Types of Functions    compound interest depending
                             functions.                             Invoking the Function/   on user input also take user
                                                                    Calling the Function   input for principal, rate and
                                                                    Function Return        time.
                                                                                        2.  Write a program where a
                                                                                           function MyFunc( ) it takes
                                                                                           the user name and displays a
                                                                                           message”
                                                                                             Hello username welcome to
                                                                                           this page!
                                                                                        3.  Write a program with a
                                                                                           function to find the smallest
                                                                                           out of 3 numbers.
                                                                                        4.  Write a program with a
                                                                                           function to take user input in
                                                                                           kilograms and  convert it to
                                                                                           grams.
                                                                                           [1Kilogram=1000grams]
                                                                                        5.  Write a program with a
                                                                                           function sortnum( ) to sort 3
                                                                                           numbers in ascending order.
                                                                                        6.  Using a button call a function
                                                                                           Pytha( ) and take the input for
                                                                                           the sides then check whether
                                                                                           a  number  is  a  Pythagorean
                                                                                           Triplet or not.
                                                                                        7.  Write a program with a
                                                                                           function called through a
                                                                                           button to ask user age  and
                                                                                           if the age is greater than 18,
                                                                                           display the message “You are
                                                                                           eligible” in a paragraph.
                    2.       Understand  the  concept  of  objects  and     Objects in JavaScript  Compare Windows and MacOs
                             their role in JavaScript.              Properties    and   Compare Android and iOS
                             Define and  create objects using object   Methods
                             literals and constructor functions.    Properties of Objects
                             Access and  manipulate  object  properties
                             and methods.
                             Understand object-oriented programming
                             principles in JavaScript.

                    3.       Understand the string data type in     Strings in JavaScript  Declare a function ‘stringsjava’ in
                             JavaScript.                            String    Property:   JavaScript  to  accept  two  strings
                                                                    Length              arguments. The function should
                                                                                        a.  Convert  both the  strings to
                                                                                           lowercase
                                                                                        b.  Search  for  string1  in  string2
                                                                                           and display the string if found.
                                                                                        c.  Replace all occurrences of
                                                                                           letter ‘I’ with ‘ ! ‘ in string2.
                                                                                        d.  Display first character  of
                                                                                           string1.





                                                                  (xii)
   9   10   11   12   13   14   15   16   17   18   19