CS101 Programming.

Slides:



Advertisements
Similar presentations
Programming for Beginners
Advertisements

Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 1.
CS105 INTRODUCTION TO COMPUTER CONCEPTS INTRO TO PROGRAMMING Instructor: Cuong (Charlie) Pham.
 Introduction to Programming History of programming.
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.
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.
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.
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.
SOFTWARE SYSTEMS SOFTWARE APPLICATIONS SOFTWARE PROGRAMMING LANGUAGES.
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.
Introduction to Programming End Show. Resource Team R.P Ranjan-Lecturer, SPICTEC, Galle. W.M.A.S. Wijesekara-Centre manager,CRC Hali-Ela H.P.U.S Indra.
 Lesson 03: Computer Programming. The Algorithm A List of Well-Defined Instructions for Completing a Task.
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.
CSC425 - Introduction To Computer Programming 1. 2 Generation Of Programming Languages A set of rules that telling a computer what to do. There are over.
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
Chapter 14 Programming and Languages McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
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.
CS101 Programming. Congratulations, you are a programmer!
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.
3/5/2002e-business and Information Systems1 Introduction Computer System Hardware Software HW Kernel/OS API Application Programs SW.
Programming Languages and Data Organization
CSC235 Computer Organization & Assembly Language
Why don’t programmers have to program in machine code?
Introduction to Computers and C++ Programming
Programming what is C++
Topic: Programming Languages and their Evolution + Intro to Scratch
Programming Languages
Computer Programming (BCT 1113)
Problem Identification
CSCI-235 Micro-Computer Applications
Key Ideas from day 1 slides
GENERAL OOPs CONCEPTS.
Chapter 1. Introduction to Computers and Programming
A451 Theory – 7 Programming 7A, B - Algorithms.
Entry Ticket: High and Low Level Languages
Programming Languages and Translators
CS101 Programming.
Developing Applications
TRANSLATORS AND IDEs Key Revision Points.
Teaching Computing to GCSE
CS190/295 Programming in Python for Life Sciences: Lecture 1
a small object oriented programming language.
High Level Programming Languages
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.
Translators & Types of Languages
CS105 Introduction to Computer Concepts Intro to programming
The Programming Process
A programming language
ICT Programming Lesson 1:
ICT Gaming Lesson 2.
An Introduction to Programming with C++ Fifth Edition
Chapter 6 Programming the basic computer
1.3.7 High- and low-level languages and their translators
CS105 Introduction to Computer Concepts Intro to programming
Computer Programming (CS101) Lecture-02
Presentation transcript:

CS101 Programming

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)

Congratulations, you are a programmer!

How do we write instructions for non computer tasks? We usually use normal human language in a step by step manner. For example: 1 Turn to your left 2 Take 5 steps 3 Go to whiteboard 4 Pick up pen 5 Write President’s name on board Etc. .

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

Program Languages are for humans! 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): value = getBlue(p) setBlue(p,value*0.7) Another program (compiler or interpreter) turns the Python code into the binary code the computer can run: 10101100001101000011001011001110001110000001110101010111010101010101010101000010000101100111110110001011011100100000010101010010100010001010101110010100001010111110100000011111010101010101010110000110100001100101100111000111000000111010101011101010101010101010100001000010110011111011000101101110010000001010101001010001000101010111001010000101011111010000001111101010101010101011000011010000110010110011100011100000011101010101110101010101010101010000100001011001111101100010110111001000000101010100101000100010101011100101000010101111101000000111110101010101010100100 > then>

To hard to write binary instructions so instead we use programming languages John Backus created the first programming language, FORTRAN, at IBM in 1957 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

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” Program Written In A 1st Generation Machine Language 10101100001101000011001011001110001110000001110101010111010101010101010101000010000101100111110110001011011100100000010101010010100010001010101110010100001010111110100000011111010101010101010110000110100001100101100111000111000000111010101011101010101010101010100001000010110011111011000101101110010000001010101001010001000101010111001010000101011111010000001111101010101010101011000011010000110010110011100011100000011101010101110101010101010101010000100001011001111101100010110111001000000101010100101000100010101011100101000010101111101000000111110101010101010101100001101000011001011001110001110000001110101010111010101010101010101000010000101100111110110001011011100100000010101010010100010001010101110010100001010111110100000011111010101010101010110000110100001100101100111000111000000111010101011101010101

“Hello World” Program Written In A 2nd Generation Assembly Language .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 = @ltoffx(.HW), r1 ;; ld8.mov r14 = [r14], .HW st8 [r34] = r14 ld8 r36 = [r34] br.call.sptk.many b0 = puts# mov r1 = r35

“Hello World” Program Written In The 3rd Generation Language C++ // Hello World in C++ (pre-ISO) #include <iostream.h> main() { cout << "Hello World!" << endl; return 0; }

“Hello World” Program Written In The 4th Generation Language Python print("Hello World")

Someday “Star Trek” https://www.youtube.com/watch?v=5LgwAD-IioY

Hello World In Other Program Languages http://helloworldcollection.de

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

How to create a program 1 Program Specification 2 Program Design 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