Introduction to Programming
with Java, for Beginners
Welcome
Course Information

Instructor:


Teaching Assistants:




Diana Palsetia ([email protected])
Junshi Lu ([email protected])
Yu Tazawa ([email protected])
Andrew Xue ([email protected])
Meeting Times:



MWTR: 1-2 pm in Moore 207
TR: 10-12 pm in Moore 207
F: 2-4pm in Moore 204 (Robotics/Engineering Lab)
1
Our Web Site

This site is our primary communication vehicle:
http://www.seas.upenn.edu/~pfpcse
 Become familiar with it! :)
 Visit the Resources page

For homework/lab work submission (BlackBoard)
https://courseweb.library.upenn.edu
2
Logistics

Attendance



Required: daily lecture/lab
Optional: office hours, quiz review sessions
Grades




Attendance and participation: 10%
Labwork: 20%
Homework:30%
Quizzes: 40% (2-3 quizzes)

Late Policy for labwork and homework: 20% off up to 24
hrs.

No makeup quizzes are scheduled. Conflict? Schedule
in advance
3
Computer Science (CS)

Computer Programming is sub-field of
Computer Science

It involves learning how to translate a complex
problem/simulation/game in to a computing
solution
4
Computing Examples
Digital Special
Effects
User information
Assurance
Information Security
Databases
High Performance Simulation
5
Computing

Formal Definition:
 The use of a computer
process data or
perform calculations

Early computers were
people

Advancement in
electronics enabled
computing devices that
were faster than man
Copyright:
http://cannon.sfsu.edu/~gmarcy/cswa/history/pick.html
6
CS in General
Computer Science is the study of
 What we can do with computers?
Automate a known solution
 How we can best do it
 Investigate things we don’t know

 Example:
The Blue Brain Project by EPFL & IBM
started in July 2005
•
Understand the brain function and dysfunction to solve
intractable problems in mental health and neurological
disease.
7
Three themes in Computing

Modularity
 Break big problems into simpler sub-problems
 Solve big problems by composing the solutions of
the sub-problems

Algorithmically
 Having a finite list of well-defined instructions for
accomplishing some task

Abstraction
 Find common features and express solutions in
terms of those features
8
How does CS fit with Engineering?

Computer Science partners well with many fields:
finance, engineering, graphics, linguistics, genetics,
multimedia, etc.

Its theoretical foundation lies in mathematics


Discrete math, probability, and statistics and logic
Another foundational in electrical engineering

Building block is electronic hardware (computer
architecture)
9
Computer Programming & Programming Languages

Computer Programming



Is telling the computer how to do something
Wikipedia Definition: Applies specific programming
languages to solve specific computational problems
with solutions
Programming Languages

Unlike human languages
Designed for instructing computers to solve problems
The listener (the compiler) is exacting &
unforgiving (grr!)

Like human languages
They have a grammar that has evolved
10
Programming Language Syntax

Syntax is the grammar of the language

The Listener a.k.a Compiler will point out
every syntax error
E.g. Baking Cake Recipe: Preheat Oven
 missing temperature

Error messages may be helpful
Often, they are not
You gain experience with error messages after a
while
11
Program

When you write a computational solution in a
programming language it is known as



When you ask the computer to carry out your
solution it is known as



Writing a program
E.g. Directions from point A to point B
Running or Executing a program
E.g. Actually traveling from point A to point B
Computer Software

Is made of one or more programs
12
Semantics

Semantics is the meaning of the program


We learn the semantics after we run or execute the program
Basically we observe the output

After the executing program, the semantics of the
program may or may be correct

Semantic errors cause your answers to be wrong

E.g. Baking a Cake Recipe: Add the juice of three onions
 Compiler does not find anything wrong with the above statement

You may or may not get error messages


E.g. Error Message – Dividing a number by zero
If your program is not doing what you want it to do, though it
runs, the error is semantic
13
Programming -The Craft

People have different tastes in programming, but
many values are held in common

Programming is an art as well as a craft

There are concepts fundamental to all
programming languages


We will practice the fundamentals using Programming
Language called Java
Java also has additional feature called Object Oriented
Programming (OOP) model
Design problems/programs such that they
correspond to real world entities
14
Descargar

CSE 120 9/8/05 - Penn Engineering