Office hours: see online schedule - also by appointment or whenever I'm in
basic goal of course:
problem solving using computer
Java programming
prerequisite: none
In particular: no expectation that you have programmed before
review rest of syllabus
labs: bring notes, book, laptop
roll call
Read: Ch. 1, 3
Ch. 1: background material, basics of programming (this lecture)
know difference between types of storage
a first program, but note we will use IntelliJ to run programs
Ch. 3: Java Basics
Note skipping Ch. 2 for the moment
Discuss Emergency Response Plan
Evacuating room; shelter-in-place, outdoor, indoor assembly areas
Emergency equipment: telephone, pull alarm, first aid, fire
extinguisher
Last person to leave room needs to close the door
Overview
Focus of course:
programming in Java
problem solving
developing algorithms to solve problems
What's an algorithm?
a description of how to solve a problem
examples:
directions for baking a cake or assembling a Big Mac
washing hair: lather, rinse, repeat
Is there a problem with these directions?
musical score: how to put notes together to achieve an effect
Key: alogithms describe how to solve a problem
This is similar to the difference between driving someone to State
Street in Madison and showing them how to use the web to get directions
- the algorithm is more like what is produced by the web tool.
Desirable characteristics:
specific
unambiguous (clear)
terminating
[less important at this point:]
easy to understand
don't waste resources
[others...]
Programs:
Algorithms can't be run on a computer; they're too abstract.
Computer instructions: add, sub, test, branch, copy simple data
Each instruction is very simple, but the computer is useful because it
can execute these so quickly.
However, these instructions are very difficult to use directly.
Each instruction is really just a numeric code inside the machine;
people used to program by typing long lists of numbers.
These instructions are known as machine code.
Even with more readable descriptions, it's too hard to program this way.
High-level languages (like Java, C++, Fortran, Pascal): an intermediate form
between the machine code and algorithms.
How to write and run a program:
Develop the algorithm (the plan for solving a problem).
Write the program in Java
Translate the program into machine code: [Draw picture:
edit/compile/run]
Example:
public class Hello {
static void main(String[] args)
{
System.out.println("Hello, Sailor!");
}
}
This week's lab: compiling and running a simple program.