Programming Language.pdf
Document Details
Uploaded by AudibleOrange
Tags
Full Transcript
PROGRAMMING LANGUAGE Mr. Enides Pech CS105: Programming Concepts Corozal Junior College CS105: Mr. Enides Pech 2 Objectives: Basic Terms: Hardware, Software, Computer, Information Processing Cycle, and Programming How a program and computer communicates Programming...
PROGRAMMING LANGUAGE Mr. Enides Pech CS105: Programming Concepts Corozal Junior College CS105: Mr. Enides Pech 2 Objectives: Basic Terms: Hardware, Software, Computer, Information Processing Cycle, and Programming How a program and computer communicates Programming Languages: The generations Examples of programming languages Programming Paradigm CS105: Mr. Enides Pech 3 Basic Terms: What is a hardware component? What is software? What is a computer? Information Processing Cycle? Mr. Enides Pech 4 What is a Computer? Electronic device operating under the control of instructions stored in its own memory Accepts data Processes data into information Raw facts, figures, Data that is organized, and symbols meaningful, and useful Produces and stores results CS105: Mr. Enides Pech 5 Information Processing Cycle CS105: Mr. Enides Pech 6 What is a program? a set of instructions that tell a computer how to perform a particular task. It describes the data, process data, and outputs the results. CS105: Mr. Enides Pech 7 What is programming? Programming can be considered as the production effort in coming up with a set of instructions that describe how a ‘problem’ can be solved. CS105: Mr. Enides Pech 8 Two perspectives of a program The one perceived by the user An executable file that can be run repeatedly to perform a task The one perceived by the programmer The text file that contains the instructions for the program. CS105: Mr. Enides Pech 9 Major difference between humans & computers.. Humans have judgement & free will. They will not follow any instruction they determine not required or essential. Computers will do EXACTLY what is told with no judgement. CS105: Mr. Enides Pech 10 So how does a program tell the computer what needs to be done? Computer understands is called binary or machine language. Programs interact with the computer using machine language. CS105: Mr. Enides Pech 11 Programming Languages is an artificial language, similar to human language, designed to communicate instructions to a computer. Can be used to create programs to control the behaviour of a machine. CS105: Mr. Enides Pech 12 Machine Language (1GL) consists of 0s and 1s. Used in ancient machines Poor readability Hard to code CS105: Mr. Enides Pech 13 Assembly Language (2GL) Easier for humans to understand – English-like phrases. The code is then translated into object code, using a translator called an assembler. Fast CS105: Mr. Enides Pech 14 Assembly code Assembler Object code CS105: Mr. Enides Pech 15 The Evolution of Programming Languages - Higher-Level Languages Higher-level languages are more powerful than assembly language and allow the programmer to work in a more English-like environment. Higher-level programming languages are divided into three "generations," each more powerful than the last: Third-generation languages Fourth-generation languages Fifth-generation languages CS105: Mr. Enides Pech 16 Third Generation (3GL) A third generation language (3GL) is a programming language designed to be easier for a human to understand, including things like named variables. A fragment might be: let b = c + 2*d Most "modern" languages (BASIC, C, C++, Delphi, Java, and including COBOL, Fortran, ALGOL) are third generation. Most 3GLs support structured programming. CS105: Mr. Enides Pech 17 Fourth Generation (4GL) are programming languages closer to human languages. Example: MySQL 4GLs are designed to reduce the overall time, effort and cost of software development. Most 4GLs are used to access databases. For example, a typical 4GL command is FIND ALL RECORDS WHERE NAME IS "SMITH" CS105: Mr. Enides Pech 18 Fifth Generation (5GL) Are designed to make the computer solve the given problem without the programmer. Used mainly in artificial intelligence research. Mercury, Prolog, and OPS5 are the best known fifth-generation languages. CS105: Mr. Enides Pech 19 CS105: Mr. Enides Pech 20 Translating High Level Languages to Machine Code 1) The programmer generates the source code 2) The compiler or interpreter generates the object code (machine code) Two ways to generate object code: A compiler translates the entire program into machine code before running the program An interpreter translates the high-level instructions into machine code, line by line, as the program is running CS105: Mr. Enides Pech 21 The need for different programming Languages: Web Languages: used for creating and editing pages on the web. HTML, CSS, JAVA, PHP, Ruby Software Languages: used for creating executable programs. C, C++, QT, Visual Basic, JAVA CS105: Mr. Enides Pech 22