Programming in a Nutshell
Tom Kelliher, CS 102
Feb. 12, 2001
Paper due Friday.
Discussion on a variety of technology issues.
- Basic features of Javascript.
- Javascript lab.
Spreadsheets.
- A very primitive language, English-like but adapted for the computer.
- High-level-language compiled to assembly language
which is assembled to machine language (binary code).
- A sequence of simple instructions (statements):
- Calculate this and store the result here.
birthYear = currentYear - age - 1;
- Compare these two values.
if (age >= 30)
document.write("We can't trust you!<br><br>");
else
document.write("I wish I were young again!<br><br>");
- Basic constructs:
- Straight-line execution.
- Conditional execution.
- Repetitive execution --- loops.
for (i = 1; i <= age; i = i + 1)
document.write(i + "<br>");
- Communicating with the world --- input/output statements.
name = prompt("What is your name?", "");
document.write("Hello " + name + "!<br><br>");
Output sent to the browser, so HTML tags can be used!
Thomas P. Kelliher
Sun Feb 11 10:26:51 EST 2001
Tom Kelliher