With the examples we have an overview of the following programming concepts.
Memory and variables
Types of variables
Program statements
Functions
Control statements
Example programs
In programming you begin with a given set of objects and a
set of operations that modify those objects. Programming is creating a sequence
of instructions for a person or machine to follow, where the instructions
specify which objects you are to use and with which operations you are to
modify them.
Cooks create recipes. A recipe for chocolate-banna cake is
here. Look at pages 1 and 2.
Objects
Incredients, pots, pans, utensils, stoves, freezers, etc.
Operations
Chop, commbine, heat, cool, etc.
Composers and song writers create instructions for playing music.
The musical score Sciliana by F. Carulli for guitar is
here.
Objects
Symbols for: staffs, notes, ties, rests, repeats, etc.
Operations
Read the symbols for notes, rests, repeats, etc. in the given
sequence, location on the appropriate staff and time duration to
produce music.
A
simple calculator example to show a web page with a form representing
a two number arithmetic calculator and its Javascript program.
Objects
The input and output fields contain numbers.
Operations
Read the numbers in the input fields. Do arithmetic on those numbers.
Write results to the output fields.
The function alert(message_string) displays an alert popup window
containing the message_string. This is a useful way to display
the values of variables when debugging a script
Modify an HTML element — a paragraph with the greeting
Set the paragraph style
Hide — setAttribute("hidden", "true") the result form field
Show a hidden field — removeAttribute("hidden")
Use if then else statement to deal with no name case