Sei sulla pagina 1di 13

Supplementary Course on Computer and

Systems Sciences (SUPCOM)

Programming
What is Programming?
Programming Languages
●  High Level Languages
–  Java, Python, C++

●  Low Level Languages


–  Assembly, Machine Code
High vs. Low
Making a Computer Understand

●  Computers only understand machine


code

●  But there are a few different ways to get


there
Interpreter vs. Compiler
Making a Computer Understand

●  Computers only understand machine


code

●  But there are a few different ways to get


there
Java
How Java Works
What is a Program?
Statements (Instructions)

●  Input (Keyboard, File, Device…)

●  Output (Screen, File, Device…)

●  Math (Addition, Multiplication, …)

●  Testing (If a condition is met take the appropriate action)

●  Repetition (Do the same action repeatedly)


Debugging
●  Three types of errors:

–  Syntax
–  Run-Time
–  Semantic
Debugging: Syntax Errors
●  When the statement doesn’t follow the
rules of the language.

–  Missing punctuation (;)


–  Non-Matching parenthesis ({)}
–  Mispellink or miScapAtalisng names
Debugging: Run Time
●  When the program starts to run, but
does something illegal

–  Called Exceptions in Java


–  Reading memory that it shouldn’t
–  Trying to use variables or files that
don’t exist
Debugging: Semantic Errors
●  When the program works, but doesn’t do
what you wanted it to.

–  Errors in Logic
–  But it is only doing what you told it to
–  The most difficult to find

Potrebbero piacerti anche