Download presentation
Presentation is loading. Please wait.
1
Introduction to programming
ICS2O Mr. Lane & Mr. Findlay
2
agenda We will learn What is a Program What is a programming language
The difference between source code and machine code The difference between an interpreter and a compiler Working with Java
3
Which Specimen is a Program?
Specimen 1: How to be a Glutton Specimen 2: Binary Buy cookie dough Lay out cookie dough on tray in 5 cm diameter circular goodness Preheat oven to 425 degrees Fahrenheit Place cookie tray with cookies in oven for 15 minutes Remove tray and proceed with gluttony
4
A Program Is… A plan that lays out a sequence of actions to achieve a goal
5
Why Was “How to be a Glutton” More Like a Program than the “Binary”?
It was recipe for how to be a glutton It gave step-by-step actions starting from the beginning to the end After finishing the program you achieve the desired goal: being a glutton The binary was just a bunch of numbers, not a real program. We had no idea if it represented anything or not
6
Let’s Try it out! Objective: What do we notice from this activity?
Try to come up with the steps to Instruct an alien to put on a jacket when they can only understand basic things like colour, material type, Up and Down, etc. What do we notice from this activity? Clearly stating the steps to achieve a task is not easy We cannot make any assumptions
7
What is a Programming Language?
An artificial language similar to English designed to give instructions to a computer This language is made up of special words called Keywords We refer to this collection of keywords as a dictionary, if you try to use a word not in the dictionary you will get an error The use of this language must follow a set of rules, in English we call these rules grammar. IN programming we call this set of rules Syntax Syntax is the set of rules and formatting that govern programming instructions to ensure their validity so they can be recognized by the computer Examples of Programming Languages Turing, C, C#, C++, Java, JavaScript, Basic, HTML, Python, Action Script, etc.
8
Source Code What is source code?
This is the code that you write It usually looks like English words Example: System.out.println(“Hello World!”); Source code is meant to be read by people Easy to understand for computer scientists, and sometimes understandable to non-techies Often times we refer to it simply as code. This is because a code refers to something only readable by the intended audience. Program code is intended to be read by other programmers, not the average person. Therefore it looks like code to them.
9
Machine code What is the problem with source code?
Machines cannot understand source code Imagine a new student shows up in class tomorrow that speaks Russian. The teacher does not. How will the teacher communicate with the student? A translator, someone to convert my English into Russian and vise versa We need something similar for our programs, a translator In programming we call this translator a Compiler Machine code is simply a collection of 1’s and 0’s called binary, this is what a computer can understand Source Code Compiler Machine Code
10
Other Translators A compiler goes through all of the machine code and translates it into machine code all at once There is another type of translator out there called an Interpreter An interpreter works similarly to a compiler but has one major difference, rather than compile all code at once, it compiles it one line at a time. This allows for a faster initial start and easy bug fixing. However it is actually slower as it is executing because it needs to both convert and execute the code Most scripting languages such as HTML, PHP and JavaScript are interpreted languages whereas languages such as C, C#, C++ and Swift are compiled languages. Java is both compiled AND interpreted.
11
Working with Java When writing our programs we use a tool called an Integrated Development Environment (IDE). This tools is very powerful, it allows us to edit, compile, test and fix our code all in a single piece of software The number one IDE for Java is Eclipse, the IDE we will use in our class. Other handy features IDE’s offer are text highlighting, text- completion (called intellisense) and a collection of debugging (code fixing) tools. The next few quests will help you setup and familiarize yourself with the Eclipse IDE for later use in the course.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.