Page 105 - Computer Genius Class 06
P. 105

What is an Event?

                 Event is an action which has happened. You can consider event as a generalization of things on
                 which the program responds.

                 In programming, an event is an action which occurs as a result of the user or another source, such
                 as a mouse click.
                 Examples of the events are:

                   Clicking and loading the web page on web browser

                   Creation of file in a file system

                   Webcam or microphone receiving sensory input

                   Incoming network traffic

                   Typing on keyboard

                   Timer

                   In mobile apps, the events that happen are the results of the user doing something (on a click of
                   button the orientation of the phone screen changes)
                 What are Event Handlers?

                 Event handler is a block of code which get executed when the event occurs and it is associated with
                 the event.
                 Examples of Event Handlers:
                   In Makecode Arcade, you display message by using ‘splash’ block . ‘splash’ block will get execute
                   when you click on ‘start the simulator’ button. In this ‘start the simulator’ button is an event
                   handler.

                   When you click “send” for a text message, it sends the message and makes a sound.
                   When you purchase an app from an app store, the phone asks for a password.

                   When you click an icon for an app, the app opens.

                 What are Collections?

                 A collection is a container which groups multiple elements into a single object. Collections are used
                 to store, retrieve and manipulate stored data.
                 Example of collection:

                   Collection of cards
                   Telephone directory

                 Advantages of collection:
                   It groups multiple elements into a common set.

                   It increases the performance of the program.





                                                                                  More on MakeCode Arcade     103
   100   101   102   103   104   105   106   107   108   109   110