Weeks 5 and 6 Objects, events, buttons, mouse-clicks and functions. Random numbers Random numbers: from 1 to 7 or evaluating a random number generator Another legal consideration -- Linking rights (by Brad Templeton, this "frames" the issue in a reasonable context.) |
![]() |
![]() |
![]() |
![]() |
Upcoming events:
Quiz: Thursday February 28th-- concerning all topics covered to date: HTML, Beginning JavaScript, images, random numbers, copyright.
Other matters noteworthy:
If you take a look at the pages contained at http://srufaculty.sru.edu/david.dailey/javascript/intro/index.htm, you will see much of the material that will be covered in this course, as well as some example exercises. Some of these exercises are similar to assignments for this class, and may provide additional guidance.
Pedestrian approach to assignment #4
And a new assignment to be thinking about:
Assignment #5, due February 28th
Two choices:Build a web page in which the user can type or paste a paragraph or more of text. When done, the user can press a button which "analyzes" the text. The analysis consists of two tabulations: the frequency of occurrence of every letter and punctuation mark (lowercase and uppercase letters are considered the same so that "a" and "A" are identified) and the frequency of occurrence of every character pair (or digraph -- in which "ab" is not the same as "ba") is tabulated and presented on the page.
Finally, when a second button is pressed, new random text is generated and placed somewhere else on the page. The newly generated text should be generated with the probabilities of letters' occurrences matching the frequency of occurrence within the user's text. That is, if the occurrence of "e" accounts for 12% of the characters used, then the probability of generating an "e" should be 0.12.
For additional extra credit, make it so that the probabilities associated with digraphs match their observed frequencies. (Another button should be deployed on the page for this feature.)
Old broken link: when is linking allowed? (an extensive bibliography)