Presentation is loading. Please wait.

Presentation is loading. Please wait.

I NTRODUCTION TO P ROGRAMMING ICS 3U 1. W HAT I S A P ROGRAM ? A program is a set of instructions that makes the computer do something. There are two.

Similar presentations


Presentation on theme: "I NTRODUCTION TO P ROGRAMMING ICS 3U 1. W HAT I S A P ROGRAM ? A program is a set of instructions that makes the computer do something. There are two."— Presentation transcript:

1 I NTRODUCTION TO P ROGRAMMING ICS 3U 1

2 W HAT I S A P ROGRAM ? A program is a set of instructions that makes the computer do something. There are two ways to supply a program to a computer: 1) Buy a program written by somebody else (Future Shop, Google Play Store, etc.). 2) Write the program yourself! 2

3 H ISTORY OF P ROGRAMMING Computer circuits are in one of two binary states: on when a signal is present or off when there is no signal present. Accordingly, computer programs are represented in binary (1’s and 0’s) at the lowest level. Called machine code, these strings of 1’s and 0’s are long and difficult to understand! Not only are they difficult to read, but they’re just as tough to write! 3

4 A SSEMBLY L ANGUAGES As microprocessor development continued in the 1950s, symbolic machine languages called assembly languages came into the scene. Assembly languages allow the programmer to use symbolic commands rather than cryptic binary to accomplish tasks. A program called the assembler t ranslates the source program (written in assembly) into an object program (encoded in binary) which can then be executed by your computer. 4

5 H IGH -L EVEL L ANGUAGES Problem: Assembly languages are designed to work on certain microprocessors. A program written on one machine will not necessarily work on another. A high-level programming language provides easy-to-use shortcut commands to the programmer with minimal drawbacks. High-level source code needs to be compiled into machine code before execution. The program that does this translation is called a compiler. High- level languages can be compiled to run on the most common types of microprocessor. 5

6 E XAMPLE P ROGRAM 6

7 I NTERPRETED LANGUAGES Problem: If I want my software to run on both Windows and Mac, I have to program and compile for two separate platforms! Solution: Interpreted languages An interpreted language uses a program called an interpreter to translate the source code in machine language statement-by-statement – it is not compiled to run on any one particular platform. 7

8 T HE J AVA P ROGRAMMING L ANGUAGE Released in 1995. An interpreted language, Java source code is compiled into Java bytecode. The Java Virtual Machine (JVM) interprets and runs the Java bytecode regardless of the computer architecture. Supports Object-Oriented Programming (OOP), a programming concept that allows us to represent concepts as “objects” which we can instantiate and use. 8

9 J AVA F UN F ACTS Most Android smartphone apps are written using Java. A large amount of the Android operating system is also written in Java Javascript, commonly used in web-based settings, is nothing like Java. Kind of. The Java syntax is very similar to C/C++. Since Java is platform-independent, it does not permit as much communication with the computer hardware as C/C++. 9

10 J AVA F UN F ACTS Some argue that Java is not efficient in comparison to C/C++. In Java, you can free up memory by simply not using it anymore. In C/C++, memory must be cleared by the programmer. This allows for stronger control over resources. Java has several classes that programmers can override and manipulate for special uses: Applet - programs that are embedded in other applications (commonly in web pages) Servlets – allows programmers to handle web server requests in a custom manner JavaServer Pages (JSPs) – allow for dynamic webpage creation 10

11 W HERE DO I TYPE MY PROGRAMS ? We will be typing our Java programs in one of two IDEs (Integrated Developer Environments): Eclipse by IBM NetBeans, an open source IDE sponsored by Oracle Both IDEs are installed on the lab computers. Last year, students used Eclipse and it was slow. This year, we’ll try NetBeans. A Java program written using Eclipse will work in NetBeans – it’s your choice! 11


Download ppt "I NTRODUCTION TO P ROGRAMMING ICS 3U 1. W HAT I S A P ROGRAM ? A program is a set of instructions that makes the computer do something. There are two."

Similar presentations


Ads by Google