CS101 Programming. Congratulations, you are a programmer!

Slides:



Advertisements
Similar presentations
CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
Advertisements

 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
Introduction to Programming
زبانهای برنامه سازی برنامه سازی پیشرفته ارائه دهنده دکتر سيد امين حسيني E.mail: Home page:
CS105 INTRODUCTION TO COMPUTER CONCEPTS INTRO TO PROGRAMMING Instructor: Cuong (Charlie) Pham.
 Introduction to Programming History of programming.
PROGRAMMING Introduction To Programming Definition Types Of Programming Languages Programming Language Paradigm Translator
Introducing Programming a general discussion. What is a Program? Sets of instructions that get the computer to do something Programs may be a few lines.
Software. What Is Software? software –Also called Computer programs –Are a list of instructions –Instructions are called code –CPU performs the instructions.
Starting Out with C++, 3 rd Edition 1 Chapter 1. Introduction to Computers and Programming.
McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 14 Programming and Languages.
Program Flow Charting How to tackle the beginning stage a program design.
An Introduction to Programming with C++ Fifth Edition Chapter 1 An Introduction to Programming.
CS 101 Problem Solving and Structured Programming in C Sami Rollins Spring 2003.
Programming and Languages Chapter Competencies (Page 1 of 2) Describe the six steps of programming Discuss design tools including top-down design,
McGraw-Hill Technology Education © 2006 by the McGraw-Hill Companies, Inc. All rights reserved CHAPTER PROGRAMMING AND LANGUAGES.
1414 CHAPTER PROGRAMMING AND LANGUAGES. © 2005 The McGraw-Hill Companies, Inc. All Rights Reserved Competencies Describe the six steps of programming.
ALGORITHMS CSC 171 LECTURE 1. What is “Computer Science”? What is “Science”? What is a “Computer”? What is “Computation”?
SOFTWARE SYSTEMS SOFTWARE APPLICATIONS SOFTWARE PROGRAMMING LANGUAGES.
Your Interactive Guide to the Digital World Discovering Computers 2012.
Activity 1 - WBs 5 mins Go online and spend a moment trying to find out the difference between: HIGH LEVEL programming languages and LOW LEVEL programming.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
Programming Languages CPS120: Introduction to Computer Science Lecture 5.
Intro. to Game Programming Want to program a game?
Invitation to Computer Science 5 th Edition Chapter 9 Introduction to High-Level Language Programming.
1 EMT 101 – Engineering Programming Dr. Farzad Ismail School of Aerospace Engineering Universiti Sains Malaysia Nibong Tebal Pulau Pinang Week 1.
Computing Essentials 2014 Programming and Languages © 2014 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not.
Chapt. 10. What’s a Program? A set of instructions -- that lead to the accomplishment of an objective.
Software Basics. Some Pioneers Charles Babbage Analytical Engine Countess Ada Lovelace First Programmer ? John Von Neumann storing instructions in memory.
The Programming Process Define the problem* Make or buy software? Design the program * Code (write) the program Test (debug) the program Document the.
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
Programming and Languages
 Computer Languages Computer Languages  Machine Language Machine Language  Assembly Language Assembly Language  High Level Language High Level Language.
Chapter 14 Programming and Languages McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
Ch 1 - Introduction to Computers and Programming Hardware Terminology Main Memory Auxiliary Memory Drives Writing Algorithms Using Pseudocode Programming.
Machine Machine language is PL in which program instructions are written in strings of 0s and 1s.The computer circuitry is wired in a manner that it can.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
Software Engineering Algorithms, Compilers, & Lifecycle.
Machine Language Computer languages cannot be directly interpreted by the computer – they are not in binary. All commands need to be translated into binary.
Introduction to Jeroo a small object oriented programming language.
CIS 365: Visual Application Development Introduction to Computers and Programming.
Introduction to Computers and C++ Programming
Computer Programming (BCT 1113)
Problem Identification
CSCI-235 Micro-Computer Applications
Chapter 1. Introduction to Computers and Programming
A451 Theory – 7 Programming 7A, B - Algorithms.
Entry Ticket: High and Low Level Languages
Teaching Computing to GCSE
CS101 Programming.
Developing Applications
TRANSLATORS AND IDEs Key Revision Points.
Teaching Computing to GCSE
a small object oriented programming language.
PROGRAMMING What is it?.
Programming Languages
COMPUTER SOFT WARE Software is a set of electronic instructions that tells the computer how to do certain tasks. A set of instructions is often called.
CS105 Introduction to Computer Concepts Intro to programming
The Programming Process
A programming language
ICT Programming Lesson 1:
An Introduction to Programming with C++ Fifth Edition
1.3.7 High- and low-level languages and their translators
CS105 Introduction to Computer Concepts Intro to programming
Computer Programming (CS101) Lecture-02
CS101 Programming.
Presentation transcript:

CS101 Programming

Congratulations, you are a programmer!

Programming Programming is creating the instructions the computer will follow to accomplish a task. –Augusta Ada King, Countess of Lovelace (10 December 1815 – 27 November 1852)

How do we write instructions for non computer tasks? We usually use normal human language in a step by step manner. For example: –1 Go to whiteboard –2 Pick up pen –3 Take cap off pen –Etc..

What type of instructions do computers need? Very detailed and in binary (also called Machine Language)

To hard to write binary instructions so instead we use programming languages Programmers write instructions for computers using a programming language. After we write the instructions in a program language another program then turns the instructions into the machine language the computers needs. Admiral Grace Hopper

What turns the program language into machine language? Two types of programs can turn program languages into machine language: –Compiler = turns the entire program into machine language and then runs program. –Interpreter = turns one line of instructions into machine language and runs the instruction.

Program Language Example We create instructions using a programming language. For example the below Python code for altering the color of a picture : –def makeSunset2(picture): – reduceGreen30Percent(picture) – reduceBlue30Percent(picture) – –def reduceGreen30Percent(picture): – for p in getPixels(picture): – value = getGreen(p) – setGreen(p,value*0.7) –def reduceBlue30Percent(picture): – for p in getPixels(picture): – value = getBlue(p) – setBlue(p,value*0.7)

Evolution of Program Languages

Many Types of Program Languages Low Level Languages –Machine Languages (1GL) –Assembly Languages (2GL) High Level Languages –Procedural Languages (3GL) –Task Oriented Languages (4GL) –Problem Constraint Languages (5GL) (Someday) Natural Languages “Star Trek”

Hello World in Low Level Machine Language

“Hello World” in Low Level IA64 (Itanium) Assembly Language This would still need to be complied into machine language before a computer could run the program..HW: stringz "Hello World".text.align 16.global main#.proc main# main:.prologue 14, 32.save ar.pfs, r33 alloc r33 = ar.pfs, 0, 4, 1, 0.vframe r34 mov r34 = r12 adds r12 = -16, r12 mov r35 = r1.save rp, r32 mov r32 = b0.body addl r14 r1 ;; ld8.mov r14 = [r14],.HW ;; st8 [r34] = r14 ld8 r36 = [r34] br.call.sptk.many b0 = puts# mov r1 = r35 ;; mov ar.pfs = r33 mov b0 = r32.restore sp mov r12 = r34 br.ret.sptk.many b0

“Hello World” Program Written In High Level C++ Language // Hello World in C++ (pre-ISO) #include main() { cout << "Hello World!" << endl; return 0; } This would still need to be complied into machine language before a computer could run the program.

“Hello World” Program Written In High Level Language Python print("Hello World") This would still need to be complied into machine language before a computer could run the program.

Someday “Star Trek”

Hello World In Other Program Languages

How to create a program 1 Program Specification –Define the problem 2 Program Design –Create an algorithm Can use: –Top-Down Design –OOP (Object Oriented Design) –Logic Structures –Flow Charts –Etc. Create Pseudocode 3 Program Code 4 Program Test 5 Program Documentation 6 Program Maintenance

Nice Intro to Programing code.org is a nice way to get an introduction to programming