CS105 Introduction to Computer Concepts Intro to programming

Slides:



Advertisements
Similar presentations
What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word processor), it must be given the instructions.
Advertisements

Programming for Beginners
CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
Lecture 1: Overview of Computers & Programming
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
CS105 INTRODUCTION TO COMPUTER CONCEPTS INTRO TO PROGRAMMING Instructor: Cuong (Charlie) Pham.
Programming Creating programs that run on your PC
The Binary Machine Modern high-level programming languages are designed to make programming easier. On the other end, the low level, all modern digital.
The Analytical Engine Module 6 Program Translation.
Computer Concepts 5th Edition Parsons/Oja Page 546 CHAPTER 11 Software Engineering Section A PARSONS/OJA Computer Programming.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Algorithm Design CS105. Problem Solving Algorithm: set of unambiguous instructions to solve a problem – Breaking down a problem into a set of sub- problems.
SOFTWARE SYSTEMS SOFTWARE APPLICATIONS SOFTWARE PROGRAMMING LANGUAGES.
Programming Concepts and Languages Chapter 12 – Computers: Understanding Technology, 3 rd edition 1November
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
Programming In C++ Spring Semester 2013 Programming In C++, Lecture 1.
© Paradigm Publishing Inc Chapter 12 Programming Concepts and Languages.
CCSA 221 Programming in C CHAPTER 2 SOME FUNDAMENTALS 1 ALHANOUF ALAMR.
Programming Languages: Telling the Computers What to Do Chapter 16.
Programming Languages CPS120: Introduction to Computer Science Lecture 5.
Introduction to Programming Language CS105 Programming Language First-generation: Machine language Second-generation: Assembly language Third-generation:
Introduction to Programming Lecture Number:. What is Programming Programming is to instruct the computer on what it has to do in a language that the computer.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
CSC141 Introduction to Computer Programming
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 2.
The Teacher Computing Computer Languages [Computing]
Computer Programs and Programming Languages What are low-level languages and high-level languages? High-level language Low-level language Machine-dependent.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
The Programming Process Define the problem* Make or buy software? Design the program * Code (write) the program Test (debug) the program Document the.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
Course Instructor: Hira Farman Course : BY:HIRA FARMAN.
CONCEPTS OF PROGRAMMING LANGUAGES
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Software Engineering Algorithms, Compilers, & Lifecycle.
Introduction to Software
Chapter 1. Introduction.
Evolution and History of Programming Languages
Computer Languages [Computing] Computing.
Programming Languages
Chapter 1 Introduction.
Introduction to programming
CS 326 Programming Languages, Concepts and Implementation
PROGRAMMING LANGUAGES
CSCI-235 Micro-Computer Applications
Computer Programming.
Chapter 1 Introduction.
Programming Concepts and Languages
Chapter 4 Computer Software.
Assembler, Compiler, Interpreter
Chapter 12 Programming Concepts and Languages.
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
Programming & S/W Development
CS105 Introduction to Computer Concepts Intro to programming
The Programming Process
Assembler, Compiler, Interpreter
and Program Development
PROGRAMMING FUNDAMENTALS Lecture # 03. Programming Language A Programming language used to write computer programs. Its mean of communication between.
ICT Programming Lesson 1:
Lecture 8 Programming Paradigm & Languages. Programming Languages The process of telling the computer what to do Also known as coding.
An Introduction to Programming with C++ Fifth Edition
Chapter 1 Introduction.
1.3.7 High- and low-level languages and their translators
Computer Programming (CS101) Lecture-02
Presentation transcript:

CS105 Introduction to Computer Concepts Intro to programming Instructor: Cuong (Charlie) Pham

Outline Programming Languages Algorithm Design History Implementation Problem Solving Pseudocode CS105 Section 1 - Lecture 8 7/10/2019

Programming Language First-generation: Machine language Second-generation: Assembly language Third-generation: High-level language Fourth-generation (Fifth-generation) CS105 Section 1 - Lecture 8 7/10/2019

1GL: Machine language A set of primitive instructions built into every computer The instructions are in the form of binary code 1101101010011010 CS105 Section 1 - Lecture 8 7/10/2019

2GL: Assembly language Low-level programming language to represent machine-language instructions E.g.: ADDF3 R1, R2, R3 Assembly code need to be converted into machine code by using an assembler Assembly program is platform dependent Combination of mnemonic and machine instruction CS105 Section 1 - Lecture 8 7/10/2019

3GL: High-level language English-like and easy to learn and program. E.g.: Area = 5 * 5 * 3.1415; COBOL, FORTRAN, BASIC, Pascal, Ada, C, Visual Basic, Delphi, C++, C#, Java Source program is compiled into machine code by a compiler and linked to supporting library code by a linker to form an executable file. CS105 Section 1 - Lecture 8 7/10/2019

4GL / 5GL 3GL offered greater power to the programmer, while 4GL open up the development environment to a wider population. (Applications Development Without Programmers) Database query languages: SQL… Data manipulation, analysis, and reporting languages: MATLAB, SPSS… CS105 Section 1 - Lecture 8 7/10/2019

Category (3GL) Windows Application Web Application C, C++, Java, Visual Basic, C# Web Application Server Side PHP, JSP (Java), ASP.NET (Visual Basic, C#), … Client Side JaveScript, VBScript CS105 Section 1 - Lecture 8 7/10/2019

The Binary Machine A modern computer can run programs written in JavaScript, Pascal, Visual Basic, Visual C++, etc. However, computers can only understand one language: the machine language it is not easy to use. The machine language of a Sun workstation is different from a PC (or other platform), however, they can run the same C++ program. CS105 Section 1 - Lecture 8 7/10/2019 9

Two types of Translators (3GL to 1GL) Interpreter: translate and run the source code one line at a time. Easy to write and easy to find the errors in the program, but running very slow. JavaScript, VBScript, PHP, … Compiler: translates the source code once and for all, producing a complete machine language program. Very fast, but when the program fails, difficult to show the programmer where are the errors. C, C++, Java, C#, and so on. CS105 Section 1 - Lecture 8 7/10/2019

Implement a Language Generally, the action of any translating program can be divided into three phases Scanning Parsing Code generation CS105 Section 1 - Lecture 8 7/10/2019 11

Implement a Language - Scanning Scanning process: a long string of characters is broken into tokens. Example: sum = a + b is broken into 5 tokens sum, =, a, +, b A token is the smallest meaningful unit of information. CS105 Section 1 - Lecture 8 7/10/2019 12

Implement a Language - Parsing Parsing: the string of tokens is transformed into a syntactic structure. What happens in a compiler or interpreter is that the list of tokens is converted to a parse tree in memory via a complicated algorithm. = sum + b a CS105 Section 1 - Lecture 8 7/10/2019 13

Parsing a complicated equation CS105 Section 1 - Lecture 8 7/10/2019 14

Parsing a complicated equation CS105 Section 1 - Lecture 8 7/10/2019 15

Problem Solving Algorithm: set of unambiguous instructions to solve a problem Breaking down a problem into a set of sub-problems Example: Clean the house Without instructions – computers cannot do anything at all! CS105 Section 1 - Lecture 8 7/10/2019

Algorithm Design: Basic concepts Instructions – simple and unambiguous Variables – input and temporary Sub procedures – smaller tasks Looping: FOR each variable, WHILE Act of repeating tasks Conditional statements: IF ELSE Selectively execute instructions Instructions are the heart and soul of any algorithms CS105 Section 1 - Lecture 8 7/10/2019

Pseudocode: Flowchart Flowchart: diagram that represents an algorithm Symbols: START , END LOOPS, FLOW OF CONTROL INSTRUCTIONS Instructions are the heart and soul of any algorithms CONDITIONALS CS105 Section 1 - Lecture 8 7/10/2019

Pseudocode: Flowchart Fixing non functioning lamp algorithm CS105 Section 1 - Lecture 8 7/10/2019

Baking a Cake CS105 Section 1 - Lecture 8 7/10/2019