Programming Introduction November 9 Unit 7. What is Programming? Besides being a huge industry? Programming is the process used to write computer programs.

Slides:



Advertisements
Similar presentations
1 Copyright © 2002 Pearson Education, Inc.. 2 Chapter 1 Introduction to Perl and CGI.
Advertisements

compilers and interpreters
Creating a Program In today’s lesson we will look at: what programming is different types of programs how we create a program installing an IDE to get.
How do we make our Welcome.java program do something? The java in our Welcome.java file won’t do anything by itself. We need to tell the computer to execute.
Python Programming Chapter 1: The way of the program Saad Bani Mohammad Department of Computer Science Al al-Bayt University 1 st 2011/2012.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Russell Taylor Lecturer in Computing & Business Studies.
Programming Concepts and Languages Chapter 12 – Computers: Understanding Technology, 3 rd edition 1November
Assembler Compiler Interpreter ASSEMBLER To convert the assembly language into machine code. Translate mnemonic operation codes to their machine language.
1 CS101 Introduction to Computing Lecture 19 Programming Languages.
C++ Crash Course Class 1 What is programming?. What’s this course about? Goal: Be able to design, write and run simple programs in C++ on a UNIX machine.
PYTHON: LESSON 1 Catherine and Annie. WHAT IS PYTHON ANYWAY?  Python is a programming language.  But what’s a programming language?  It’s a language.
Computer Science 101 Introduction to Programming.
Programming Languages Lecture 12. What is Programming?  The process of telling the computer what to do  Also known as coding.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Name: Md. Iqbal Hossain Roll : Computer programming  Programming is a lot of fun and extraordinarily useful. While you learn to program,
CCSA 221 Programming in C CHAPTER 2 SOME FUNDAMENTALS 1 ALHANOUF ALAMR.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
Python Programming, 2/e1 Python Programming: An Introduction to Computer Science Chapter 1 Computers and Programs.
Topics Introduction Hardware and Software How Computers Store Data
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
Introduction to Python
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 09/03/2010.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming 1.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Introduction to Computers and Programming – Computer Programming.
©Xiaoying Gao, Peter Andreae First Java Program COMP 102 #2 2014T2 Xiaoying Sharon Gao Computer Science Victoria University of Wellington.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 1 Introduction to Computers and Programming.
Introduction to Programming Peggy Batchelor.
Computer Science 101 Introduction to Programming.
CS101 Introduction to Computing Lecture Programming Languages.
First Java Program COMP 102 #2 2015T2 Xiaoying Sharon Gao Computer Science Victoria University of Wellington.
Programming With C.
Java Programming, Second Edition Chapter One Creating Your First Java Program.
Python From the book “Think Python”
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Robert Crawford, MBA West Middle School.  Explain how the binary system is used by computers.  Describe how software is written and translated  Summarize.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
1 Computer Science of Graphics and Games MONT 105S, Spring 2009 Session 1 Simple Python Programs Using Print, Variables, Input.
I Power Higher Computing Software Development Development Languages and Environments.
Introduction to Python Lesson 1 First Program. Learning Outcomes In this lesson the student will: 1.Learn some important facts about PC’s 2.Learn how.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
CSC 1010 Programming for All Lecture 2 Introduction to Python Some material based on material from Marty Stepp, Instructor, University of Washington.
Programming and Languages Dept. of Computer and Information Science IUPUI.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
1. COMPUTERS AND PROGRAMS Rocky K. C. Chang September 6, 2015 (Adapted from John Zelle’s slides)
Alexandria University Faculty of Science Computer Science Department Introduction to Programming C++
Chapter 1: Introduction to Computers and Programming.
Software Engineering Algorithms, Compilers, & Lifecycle.
Part 1 Learning Objectives To understand that variables are a temporary named location to store data and that programmers work with different data types.
Topic 2: Hardware and Software
Development Environment
Topics Introduction Hardware and Software How Computers Store Data
Topics Introduction to Repetition Structures
A451 Theory – 7 Programming 7A, B - Algorithms.
TRANSLATORS AND IDEs Key Revision Points.
Assembler, Compiler, Interpreter
Do you know this browser?...
Lecturer: Mukhtar Mohamed Ali “Hakaale”
First Python Program Professor Hugh C. Lauer CS-1004 — Introduction to Programming for Non-Majors (Slides include materials from Python Programming: An.
Topics Introduction Hardware and Software How Computers Store Data
BSc in Digital Media, PSUIC
Assembler, Compiler, Interpreter
Introduction In today’s lesson we will look at: why Python?
General Computer Science for Engineers CISC 106 Lecture 03
Presentation transcript:

Programming Introduction November 9 Unit 7

What is Programming? Besides being a huge industry? Programming is the process used to write computer programs Computer programs are basically a list of instructions for your computer to execute –Programs are written for some task –As simple as adding up a bunch of numbers –As complicated as your operating system

Programming Languages A programming language is a specific way of telling a computer how to do what you want It is a language –Has grammar rules –Key words There are many different programming languages –C–C –C++ –Java –Visual Basic –Lisp –Perl –Python

Programming Languages, cont. Programming languages are often created for specific purposes or to solve specific problems There are many different types or families of programming languages In general, all programming languages in the same family share similar properties –Once you know one language it’s easy to learn another

Markup Language vs. Programming Language HTML is a markup language Python is a programming language So what’s the difference? –Markup languages are used to create documents –Programming languages are used to create programs –Programs provide instructions for your computer to execute –Markup languages describe documents Programming allows us to add extra functions to our web pages that HTML simply cannot support Programming languages support the use of variables, conditional statements (like “if”), and iterative statements (like “for-each”)

Why Learn to Program? Because it’s fun!!! Programming is a challenge But, –Once you know how to program a bit it can be very useful –Not just for computer scientists –Especially useful in the sciences –Sometimes it’s faster to write a program than to do the work by hand Summing up all the numbers in a file

So Why Python? Other more well-known languages like C, C++, and Java are more for creating desktop applications –Not very suitable for the Web Python is a high-level language (like C, C++ and Java) Because it’s a high-level language it’s portable –Python runs on most types of computers

High vs. Low-Level So what is meant by high-level and low-level languages? High-level languages have to actually be converted into low-level languages in order to be executed Low-level languages are also known as assembly languages or machine languages Low-level languages are not portable –They have to be re-written for each different type of computer High-level languages are more human-readable High-level languages are more widely-used –Low-level is for very specialized tasks like embedded items, microcontrollers,

High -> Low-Level Languages High-level languages must be converted into low-level languages in order to be executed Two types of translations: –Using a compiler –Using an interpreter Compilers completely translate your program before executing it –Your program is called source code and the translation the compiler produces is called object code or the executable Interpreters do it a bit at a time –Alternately read and execute your file

So What’s it Good for With python, and most languages, we can do quite a lot User input –“enter your name” –“enter a number between 1 and 100” We can output information –“You are over your limit” –“The sum of 2 and 2 is 4”

Behind the Scenes Between input and output (if we have input) there is a lot going on “behind the scenes” We can do pretty much any math –Add, subtract, divide, square, etc. We can compare one item to another –Is the password you entered the same password for you login? If you dream it, you can probably program it –With enough lines of code

Beginning with Python You should download python –Available from the course website under “course software” –It is available on the ACS computers You can write python in a text editor and save it with the extension “.py” –Or you can use IDLE Integrated DeveLopment Environment for Python Comes with the installation Better choice Lastly, you can type commands directly into the python interpreter –The python interpreter is what you get when run the python program (usually a black window with white text)

Hello World The “Hello, world!” program is often the first program anyone writes in a new language It’s tradition, so we’ll start with it too. Writing a program that displays “Hello, world!” is typically the simplest program to write in any language Basically, what we want is for the program to display the output “Hello, world!”

“Hello, world!” in Python When you run the interpreter you’ll get something like: “Python 24 (#60, Nov 30, 2004, 11:49:19) Type “help”, “copyright”, “credits”, or “license” for more information >>>” This “>>>” is referred to as the prompt >>>print “Hello, world!”

Hello, world in a File We can also put “print ‘Hello, world!’” into a file and run it this way –This is what you will typically be doing Easiest to do in IDLE –In IDLE you’ll get an interpreter window and a window where you can write, edit, and save your python program –In the editing window simply type: print “Hello, world!” –Then you can run the file by pressing F5 ( you will need to also save it) –In the interpreter window you should see Hello, world!

Questions? Enjoy your long weekend!