Beruflich Dokumente
Kultur Dokumente
INTRODUCTION
Module Goals
Contents
Computer Programs
The Anatomy of a Computer
The Java Programming Language
Becoming Familiar with your Programming
Environment
Analyzing Your First Program
Errors
Problem Solving:
Algorithm Design
Page 3
Page 4
Schematic Design of a PC
Page 6
Java History
Source code
Oracle Tutorials
Page 10
Java Timeline
Output window
Debugger
Page 14
An Example IDE
Editor
Output
Output
Execute
Page 17
Page 18
Page 19
Page 21
Hello
World!
007
00
Omitting Semicolons
In Java, every statement must end in a semicolon.
Forgetting to type a semicolon is a common error. It
confuses the compiler, because the compiler uses the
semicolon to find where one statement ends and the
next one starts. For example, the compiler sees this:
System.out.println("Hello")
System.out.println("World!");
As this:
System.out.println("Hello") System.out.println("World!");
1.6 Errors
2) Run-time Errors
Logic Errors
Program runs, but produces unintended results
Program may crash
Page 25
Syntax Errors
Misspell a word:
Dont Capitalize a word
Leave out a word
Forget a Semicolon after
Dont match a curly brace?
System.ou.println
system.out.println
void
("Hello, World!")
Remove line 6
Logic Errors
System.out.println(1/0);
("Hello, Word!")
Remove line 5
Use a spreadsheet!
Write a formula
Per line, based on line above
Page 29
Pseudocode
Half-way between natural language and a
programming language
Modified Steps
Pseudocode is an informal
description of a sequence of
steps for solving a problem
Algorithm Defined
An algorithm describes a
sequence of steps that is:
Unambiguous
Do not require assumptions
Uses precise instructions
Executable
Can be carried out in practice
Terminating
Will eventually come to an end
Page 32
Summary: Java
Summary: Java
Summary: Java