SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

Similar documents
Low-Level Languages. Computer Programs and Programming Languages

Lecture 01 & 02 Computer Programming

1) What is the first step of the system development life cycle (SDLC)? A) Design B) Analysis C) Problem and Opportunity Identification D) Development

CS2900 Introductory Programming with Python and C++ Kevin Squire LtCol Joel Young Fall 2007

Discovering Computers 2008

What is a programming language?

Software Development. Integrated Software Environment

Chapter 1: Why Program? Main Hardware Component Categories 8/23/2014. Main Hardware Component Categories: Why Program?

Compilation I. Hwansoo Han

Principles of Programming Languages. Lecture Outline

COP4020 Programming Languages. Compilers and Interpreters Robert van Engelen & Chris Lacher

CHAPTER 1 Introduction to Computers and Java

Why are there so many programming languages? Why do we have programming languages? What is a language for? What makes a language successful?

Högnivåspråk och översättning

Chapter 1: Introduction to Computers and Programming

LECTURE 2. Compilers and Interpreters

Principles in Programming: Orientation & Lecture 1. SWE2004: Principles in Programming Spring 2014 Euiseong Seo

Discovering Computers Chapter 13 Programming Languages and Program Development

Outline. Introduction to Programming (in C++) Introduction. First program in C++ Programming examples

8/16/12. Computer Organization. Architecture. Computer Organization. Computer Basics

Chapter 1: Introduction to Computers and Java

8/23/2014. Chapter Topics. Introduction. Java History. Why Program? Java Applications and Applets. Chapter 1: Introduction to Computers and Java

Computer Components. Software{ User Programs. Operating System. Hardware

INFS 214: Introduction to Computing

Introduction to Programming: Variables and Objects. HORT Lecture 7 Instructor: Kranthi Varala

Question No: 1 ( Marks: 1 ) - Please choose one One difference LISP and PROLOG is. AI Puzzle Game All f the given

Introduction Objectives: 1) differentiate between high-level, low-level, and machine language; 2) explain why it is necessary to translate a program

Concepts of Programming Languages

Chapter 1. Preview. Reason for Studying OPL. Language Evaluation Criteria. Programming Domains

Programs are: CMPSCI 105/119/120: Programming, Flowchar<ng, and Running Program Flowcharts

Elements of Computers and Programming Dr. William C. Bulko. What is a Computer?

Chapter 5. Names, Bindings, and Scopes

Chapter 1: Why Program? Computers and Programming. Why Program?

C H A P T E R 1. Introduction to Computers and Programming

Programming 1. Lecture 1 COP 3014 Fall August 28, 2017

BITG 1113: Introduction To Computers And Programming Language LECTURE 1 LECTURE 1 1

Chapter 1. Preliminaries

Programming Languages

General Concepts. Abstraction Computational Paradigms Implementation Application Domains Influence on Success Influences on Design

Chapter 1 Preliminaries

Chapter 1. Preliminaries

Identifiers. Identifiers are the words a programmer uses in a program Some identifiers are already defined. Some are made up by the programmer:

Computers in Engineering COMP 208. Computer Structure. Computer Architecture. Computer Structure Michael A. Hawker

Programming 1 - Honors

An Introduction to Python (TEJ3M & TEJ4M)

Objective: To learn meaning and concepts of programming. Outcome: By the end of this students should be able to describe the meaning of programming

Introduction to Java Programming


Why study Programming Language Concepts? Chapter One. Language Evaluation Criteria. Programming Domains. Readability Writability Reliability Cost

Computer Components. Software{ User Programs. Operating System. Hardware

Early computers (1940s) cost millions of dollars and were programmed in machine language. less error-prone method needed

CS2303 C14 Systems Programming Concepts. Bob Kinicki

Programming. leads to programming languages. leads to operating systems

A Set Of Machine Language Instructions For A Program Is Called Source Code >>>CLICK HERE<<<

Introduction to Computers and Java. Objectives. Outline. Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich.

Introduction to Computers and Java

Basic Concepts. Computer Science. Programming history Algorithms Pseudo code. Computer - Science Andrew Case 2

Introduction to Computers and Java

Computer Basics 1/24/13. Computer Organization. Computer systems consist of hardware and software.

Unit. Programming Fundamentals. School of Science and Technology INTRODUCTION

Principles in Programming: Orientation & Lecture 1. SWE2004: Principles in Programming Spring 2015 Euiseong Seo

Lecture 1. Introduction to course, Welcome to Engineering, What is Programming and Why is this the first thing being covered in Engineering?

Why are there so many programming languages?

Chapter 11 Introduction to Programming in C

Introduction to Computers and Java. Objectives. Outline. Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich.

Computer Principles and Components 1

ENGR/CS 101 CS Session Lecture 3

CSC 326H1F, Fall Programming Languages. What languages do you know? Instructor: Ali Juma. A survey of counted loops: FORTRAN

Introduction. A. Bellaachia Page: 1

Chapter 5 Names, Binding, Type Checking and Scopes

Programming Languages and Program Development

UNIVERSITI TEKNIKAL MALAYSIA MELAKA FACULTY INFORMATION TECHNOLOGY AND COMMUNICATION (FTMK) BITE 1513 GAME PROGRAMMING I.

C++ Programming Language Lecture 1 Introduction

Computer Basics 1/6/16. Computer Organization. Computer systems consist of hardware and software.

COMP 201: Principles of Programming

Introduction. Arizona State University 1

Organization of Programming Languages (CSE452) Why are there so many programming languages? What makes a language successful?

Chapter 11 Program Development and Programming Languages

Winter 2019 CISC101 1/17/2019

CSI32 Object-Oriented Programming

Getting Started. Chapter 1. Java Programming FROM THE BEGINNING. Chapter 1: Getting Started

CS187 - Science Gateway Seminar for CS and Math

Technology in Action. Alan Evans Kendall Martin Mary Anne Poatsy. Tenth Edition. Copyright 2014 Pearson Education, Inc. Publishing as Prentice Hall

Game keystrokes or Calculates how fast and moves a cartoon Joystick movements how far to move a cartoon figure on screen figure on screen

CS 231 Data Structures and Algorithms, Fall 2016

Lecture 1 - Introduction (Class Notes)

Chapter Twelve. Systems Design and Development

CS Prof J.P.Morrison

Programmiersprachen (Programming Languages)

Compilers. Prerequisites

Programming Languages, Summary CSC419; Odelia Schwartz

Compiling and Interpreting Programming. Overview of Compilers and Interpreters

Chapter 9. Introduction to High-Level Language Programming. INVITATION TO Computer Science

assembler Machine Code Object Files linker Executable File

Technology in Action. Chapter Topics. Scope creep occurs when: 3/20/2013. Information Systems include all EXCEPT the following:

Chapter 1. Introduction to Computers and Programming. M hiwa ahmad aziz

! Learn how to think like a computer scientist. ! Learn problem solving. ! Read and write code. ! Understand object oriented programming

Introduction. Introduction to OOP with Java. Lecture 01: Introduction to OOP with Java - AKF Sep AbuKhleiF -

Introduction to Computer Programming Using FORTRAN 77

CSCI 3136 Principles of Programming Languages

Transcription:

SKILL AREA 304: Review Programming Language Concept Computer Programming (YPG)

304.1 Demonstrate an Understanding of Basic of Programming Language 304.1.1 Explain the purpose of computer program 304.1.2 Define the terms of programs and programming language 304.1.3 Explain types of programming language and translators

Computer Programs Software refers to programs that make the computer perform some task. A program is a set of instructions that tells the computer what to do. When you have written a program, the computer will behave exactly as you have instructed it. It will do no more or no less than what is contained in your specific instructions.

Writing Programs Learning to write programs requires two skills. You need to use specific terminology and punctuation that can be understood by the machine; that is, you need to learn a programming language. You need to develop a plan for solving a particular problem. This plan or algorithm is a sequence of steps that, when followed, will lead to a solution of the problem.

Solving Problems Initially, you may think that learning a language is the more difficult task because your problems will have relatively easy solutions. Nothing could be further from the truth! The single most important thing you can do as a student of computer science is to develop the skill to solve problems. Once you have this skill, you can learn to write programs in several different languages.

What Is a Program? Program A list of instructions written in a special code, or language. The program tells the computer which operations to perform, and in what sequence to perform them. Garbage In, Garbage Out (G.I.G.O.) Get what you asked for, not necessarily what you want.

Why Programming? To Develop Problem Solving Skills It is very important to develop problem solving skills. Programming is all about solving problems. Requires creativity and careful thought. Analyze the problem and break it down into manageable parts (modules, procedures, functions) It s also rewarding!

What Is a Computer Language? A microprocessor is designed to understand a set of commands called an instruction set All instructions must be provided to the CPU in its native language, called machine language. All data transmission, manipulation, storage, and retrieval is done by the machine using electrical pulses representing sequences of binary digits. If eight-digit binary codes are used, there are 256 numbered instructions from 00000000 to 11111111.

Machine Language Instructions for adding two numbers would consist of a sequence of these eight-digit codes from 00000000 to 11111111. Instructions written in this form are referred to as machine language. It is the native language that the CPU speaks and understands. It is possible to write an entire program in machine language. However, this is very time consuming and difficult to read and understand.

Programming Languages Fortunately, special languages have been developed that are more easily understood (than machine language). These special languages are called programming languages. These languages provide a way to write computer programs that are understood by both computers and people. Programming languages have their own vocabulary and rules of usage. Some languages are very technical, while others are similar to English.

Common Programming Languages Visual Basic Python Javascript Java C# C C++ PHP Visual Basic is not just a programming language It s a programming environment with tools to: Create screen elements Write programming language statements

Assembly Language The programming language that is most like machine language is assembly language. Assembly language uses letters and numbers to represent machine language instructions. An assembler is a program that reads the codes the programmer writes in assembly language and assembles a machine language program based on those codes. However, assembly language is still difficult to read.

Comparing Machine Language & Assembly Language For example, the machine code for adding two integers might be: 010000110011101000111101010000010010101101000010 While the assembly language code might be: LOAD A ADD B STORE C This causes the number in A to be added to the number in B, and the result is stored for later use in C.

Low Level Languages Machine Language and Assembly Language are both called low-level languages. In a low-level language, it is necessary for the programmer to know the instruction set of the CPU in order to program the computer. Each instruction in a low-level language corresponds to one or only a few microprocessor instructions.

High Level Languages A high-level language is any programming language that uses words and symbols to make it relatively easy to read and write a computer program. In a high-level language, instructions do not necessarily correspond one-to-one with the instruction set of the CPU. One command in a high-level language may correspond to many microprocessor instructions.

High Level Languages cont Many high-level languages have been developed. These include: FORTRAN, COBOL, BASIC, Logo, Pascal, C, C++, Java, and others. These languages simplify even further the terminology and symbolism necessary for directing the machine to perform various manipulations of data.

Advantages Of High Level Languages High Level Languages: Reduce the number of instructions that must be written. Allow programs to be written in a shorter amount of time than a low-level language would take. Reduce the number of errors that are made, because The instructions are easier to read. Are more portable (the programs are easier to move among computers with different microprocessors).

Advantages Of Low Level Languages Low Level Languages: Instructions can be written to enable the computer to do anything that the hardware will follow. Require less memory Run more quickly

High Level Language Examples Consider the following programs that add two numbers together: BASIC 10 I = 3 20 J = 2 30 K = I + J Pascal program AddIt; var i, j, k : integer; begin i := 3; j := 2; k := i + j; end. C++ int main( ) { } int i, j, k; i = 3; j = 2; k = i + j; return 0; LOGO to add :I :J :K MAKE I :3 MAKE J :2 MAKE K :I + :J end

Interpreters and Compilers Programmers writing in a high-level language enter the program s instructions into a text editor. The files saved in this format are called text files. A program written in a high-level language is called source code. The programs are translated into machine language by interpreters or compilers. The resulting machine language code is known as object code.

Interpreters An interpreter is a program that translates the source code of a highlevel language into machine language. Each instruction is interpreted from the programming language as needed (line by line of code). Every time the program is run, the interpreter must translate each instruction again. In order to run the program, the interpreter must be loaded into the computer s memory.

Compilers A compiler is another program that translates a high-level language into machine language. A compiler makes the translation once so that the source code don t have to be translated each time the program is run. The source code is translated into a file called an object file. A program called a linker is used to create an executable program. Most modern compilers let you compile and link in a single operation, and have an IDE (Integrated Development Environment) to enter text, debug, compile, link, and run programs.

Compiler vs. Interpreter (1/5) Compilers: Translate a source (human-writable) program to an executable (machine-readable) program Interpreters: Convert a source program and execute it at the same time.

Compiler vs. Interpreter (2/5) Ideal concept: Source code Compiler Executable Input data Executable Output data Source code Input data Interpreter Output data

Compiler vs. Interpreter (3/5) Actually, no sharp boundary between them. General situation is a combo: Source code Translator Intermed. code Intermed. code Input Data Virtual machine Output

Compiler vs. Interpreter (4/5) Most languages are usually thought of as using either one or the other: Compilers: FORTRAN, COBOL, C, C++, Pascal, PL/1 Interpreters: Lisp, scheme, BASIC, APL, Perl, Python, Smalltalk BUT: not always implemented this way

Compiler vs. Interpreter (5/5) Examples of fuzzy boundary: Preprocessor to interpreter (e.g. BASIC) Sometimes can both compile and interpret C++ -> C conversion (AT&T compiler) Linking of executables at runtime Pascal and P-code Java and bytecode Just-in-time compiling

Thank You! Any More Questions?