Top Banner
Introduction to Programming Principles Languages FP101 PROGRAMMING PRINCIPLES
28
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to programming principles languages

Introduction to Programming Principles Languages

FP101 PROGRAMMING PRINCIPLES

Page 2: Introduction to programming principles languages

WEEK 3C

LO 1

Explain the basic computer and programming fundamentals with appropriate examples of language and technology.

Page 3: Introduction to programming principles languages

Group activity:

•Form a group with 6 members.

•List the following:

- Computer components

- Hardware

- Software

-Operating System

- Application

Student will present their answer.

Page 4: Introduction to programming principles languages

1.1 Computer Fundamentals•C

omputer is a device capable of performing computations and making logical decisions at speed millions (even billions) of times faster than human beings can.

•Computer systems will include the computer along with any software and peripheral devices that are necessary to make the computer function.

Page 5: Introduction to programming principles languages

1.1.1 Computer System Environment The peripheral devices

5Keyboard (Input Device)

Speaker (Output Device)

Hard disk (Secondary Storage) Memory i.e. RAM & ROM (Primary Storage)

Floppy disk (Secondary Storage)

CD ROM, DVD ROM (Secondary Storage)

Mouse (Input Device)

Printer (Output Device)

Monitor Screen (Output Device)

Page 6: Introduction to programming principles languages

1.1.1 Computer System EnvironmentThe peripheral devices

Input Devices Capture/receive input from users

Central Processing Unit (CPU) Execute instructions; compute, compare and

transform data Primary Storage or Main Memory

Permanent storage for data/programs Output Devices

Produce output/result Secondary Storage Devices

Temporary storage for data/programs

Page 7: Introduction to programming principles languages

1.1.1 Computer System EnvironmentThe Software's

Computer process data under the control of sets of instructions called computer programs.

Also called as software programs. There are two types of software which

are operating system and application software

Page 8: Introduction to programming principles languages

Operating system consisting of programs and data, that runs

on computers, manages computer hardware resources, and provides common services

for execution of various application software.

For hardware functions such as input and output and memory allocation, the operating system acts as an intermediary between application programs and the computer hardware

Ex: LINUX, UNIX, MICROSOFT WINDOWS

1.1.1 Computer System EnvironmentThe Software's

Page 9: Introduction to programming principles languages

Application software is computer software designed to help

the user to perform singular or multiple related specific tasks.

Ex: Microsoft office, Adobe Photoshop, Windows Media Player

1.1.1 Computer System EnvironmentThe Software's

Page 10: Introduction to programming principles languages

1.2 Evolution of Programming Language•I

n the computer industry, these abbreviations are widely used to represent major steps or "generations" in the evolution of programming languages.

Page 11: Introduction to programming principles languages

1.2 Evolution of Programming Language

Page 12: Introduction to programming principles languages

1.2.1 History of Programming Language and Approaches

•The history of computers starts out about 2000 years ago, at the birth of the abacus, a wooden rack holding two horizontal wires with beads strung on them.

•Babbage with different machine.

•Punch card by Hollerith.

•Electronic digital computer

•“Stored program” EDC

•Advance in 1950’s

•Advance in 1960’s

•Recent Advances

Page 13: Introduction to programming principles languages

Group activity:•F

orm a group of 6 members.•F

ind information on the evolution of programming language.•E

ach group choose from the following topic:

- machine language

- assembly language

- 3rd generation language

- 4th generation language

- 5th generation language

- define terminologies: program, programmer, programming.•C

ombine the information in a power point to be present

Page 14: Introduction to programming principles languages

• In the computer industry, these abbreviations are widely used to represent major steps or "generations" in the evolution of programming languages.

• Various categories of programming language and technology :

a. Machine languagesb. Assembly languagesc. 3rd Generation Languagesd. 4th Generation Languagese. 5th Generation Languages

1.2.2 Various Categories Of Programming Language And Technology

Page 15: Introduction to programming principles languages

1st Generation Language (GL1)

•First-generation language was (and still is) machine language or the level of instructions and data that the processor is actually given to work on (which in conventional computers is a string of 0s and 1s).

•instruct computers to perform their most elementary operations one at a time.

•Example of 1GL:

1.2.2 Various Categories Of Programming Language And Technology

+1300042774+1400593419+1200274927

Page 16: Introduction to programming principles languages

2nd Generation Language

•Second-generation language is assembler (sometimes called "assembly") language.

•A typical 2GL instruction looks like this:

•An assembler converts the assembler language statements into machine language.

1.2.2 Various Categories Of Programming Language And Technology

ADD 12,8

Page 17: Introduction to programming principles languages

3rd Generation Language

•Third-generation language is a "high-level" programming language, such as PL/I, C, or Java.

•Java language statements look like this:

1.2.2 Various Categories Of Programming Language And Technology

public boolean handleEvent (Event evt) { switch (evt.id) {

case Event.ACTION_EVENT: { if ("Try me" .equald(evt.arg)) {

Page 18: Introduction to programming principles languages

•A compiler converts the statements of a specific high-level programming language into machine language.

•(In the case of Java, the output is called byte code, which is converted into appropriate machine language by a Java virtual machine that runs as part of an operating system platform.)

•A 3GL language requires a considerable amount of programming knowledge.

1.2.2 Various Categories Of Programming Language And Technology

Page 19: Introduction to programming principles languages

4th Generation Language

•Fourth-generation language is designed to be closer to natural language than a 3GL language.

•Languages for accessing databases are often described as 4GLs.

•A 4GL language statement might look like this:

EXTRACT ALL CUSTOMERS WHERE "PREVIOUS PURCHASES" TOTAL MORE THAN $1000

1.2.2 Various Categories Of Programming Language And Technology

Page 20: Introduction to programming principles languages

4GL Features:

a) user friendly

b) portable and independent of operating systems

c) usable by non-programmers

d) having intelligent default options about what the user wants

e) allowing the user to obtain results fasts using minimum requirement code generated with bug-free code from high-level expressions

1.2.2 Various Categories Of Programming Language And Technology

Page 21: Introduction to programming principles languages

5th Generation Language

• Fifth-generation language is programming that uses a visual or graphical development interface to create source language that is usually compiled with a 3GL or 4GL language compiler.

•Microsoft, Borland, IBM, and other companies make 5GL visual programming products for developing applications in Java, for example.

•Visual programming allows you to easily envision object-oriented programming class hierarchies and drag icons to assemble program components.

1.2.2 Various Categories Of Programming Language And Technology

Page 22: Introduction to programming principles languages

1.3 Fundamentals of Programming Language

•A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer.

• Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely.

Page 23: Introduction to programming principles languages

1.3.1 Terminologies in Programming Language

Programmer is someone who writes computer software.

The term of computer programmer can refer to a specialist in one area of computer programming or to a generalist who writes code for many kinds of software.

Page 24: Introduction to programming principles languages

1.3.1 Terminologies in Programming Language

•Program is a sequence of instructions written to perform a specified task with a computer.

Page 25: Introduction to programming principles languages

1.3.1 Terminologies in Programming Language

•Programming is the process of designing, writing, testing, debugging, and maintaining the source code of computer programs.

Page 26: Introduction to programming principles languages

1.3.2 Language Translator•A

ssembler

- Assembler for an assembly language, a computer program to translate between lower- level representations of computer programs.

•Compiler

- A compiler is a computer program (or set of program) that transforms source code written in a computer language (the source language) into another computer language (the target language, often having a binary form known as object code).

•Translator/ Interpreter

- many high-level programming languages have the

option of using an interpreter instead of a compiler.

- It converts programs into machine-executable form each time they are executed.

- It analyzes and executes each line of source code, in order, without looking at the entire program.

Page 27: Introduction to programming principles languages

1.3.3 Relate Programming Language in Real Life

•Robot

•Hand phone Application

•ATM Machine

•Online Application

Page 28: Introduction to programming principles languages

1.3.4 Differentiate between Structured and Object Oriented Programming