SPM 2102 Programming Language 1
SPM 2102 Programming Language 1
INTRODUCTION TO PROGRAMMING
Computer Systems
Opening Questions
Take a moment to reflect on your experience with a computer and its system. Come up with a positive and a negative example.
(eg : what the positive effect to your daily life) (eg : what the negative impact to copyright issues)
Computer Systems
A computer is a system made of two major components: hardware and software Computer hardware: physical equipments Computer software: the collection of programs that allow hardware to do its job (eg : display text, video on monitor, print out the MS Word documents)
Computer Hardware
The computer hardware consists of five parts: Input devices (mouse / keyboard) Central processing unit (CPU) Primary storage of main memory (RAM) Output devices (Monitor / speaker) Auxiliary storage devices or secondary storage (Pendrive) I.P.O.S Now, name one example for each parts of the components.
Computer Software
Computer software is fall into two broad categories: System software Application software System software manages the computer resources; i.e. OS & system utilities (Windows XP / AVG anti-virus) Application software is responsible for helping users solve their problems; i.e. Microsoft Office (MS Word)
Computer Software
Software Program(s) + Data (input) Program Set of instruction in programming language. Deal with computer / hardware to solve the problem / make a calculation Data Refer to input / source that will be process by computer
Computer Software
Computer Programming
Why do you need to know about programming?
Computer Programming
Programming is used to create the application / software you use everyday (eg ; to calculate your BMI) Application software is the result of the efforts of computer programmers. Knowing at least the basics of the history & practices of the programming will help you to better understand what goes on inside computer. computer
Computer Programming
Important keywords: Computer programming / programming is a multi step process for designing or creating instructions or solution. Programming language is a set of words (or symbols) & rules used to create instructions for computer to perform. Program / Application is a list of instructions that the computer must follow in order to perform specific assigned task. Important keywords:
Computer Programming
Computer Programming
Example :
Programming language
Eg : C, C++, HTML, PHP, Java, Basic, Fotran
Program / Application
Eg : MS Word, S.M.M, S.M.A, Attendance Record.
Computer Languages
Syntax
cout<<"\n\t Skor purata = "; cout<<purata; cout<<"\n\t Enter for release"; cout<<endl; Code - <html><head><body></body></head></html>
Computer Languages
To write a program for a computer, you must use a computer language. Basically, What is a computer language? A computer language is an artificial language that tell the computer what to do. It has the same meaning with programming language .
Computer Languages
Over the year, computer languages have evolved.
an gu ag e -Le ve lL
La ng ua ge ac hin e
As se m
bly
1940s
1950s
1960s
Hi gh
La ng ua ge
Machine Language
1st generation of programming language. The only language understood by a computer without translation. It is a language consists of 0s and 1s that directly correspond to the computers electrical states. Also known as binary or machine code.
Machine Language
Advantage: Very fast in processing data. WHY? Disadvantages: Machine (or hardware) dependent Time-consuming Difficult to create program (less user friendly) (100110101011001)
Assembly Language
2nd generation of programming language. Also known as symbolic language. Assembly language is a language that allows programmers to use symbol or mnemonics (abbreviations), to represent the various machine language. It uses assembler to translate assembly code into machine code.
11110010 01110011 1101 001000010000 0111 11110010 01110011 1101 001000011000 0111 11111110 01100010 1101 001000010010 0111 11110000 01000101 1101 001000010011 0000 111110011 01000011 0111 00000101000 1101 10010110 11110000 0111 000001010100 1100
Assembly Language
Advantage: fast in processing data Program can be write more quickly than in machine language Disadvantages: Machine (or hardware) dependent Time-consuming
High-Level Language
3rd generation of programming language. Also known as procedural language. High-level languages use an English-like language instead of symbols and abbreviations. High-level languages are designed to relieve the programmer from the details of the assembly language. Advantage: Easy to program Machine independent
High-Level Language
Example of high-level languages are C, Fortran and COBOL.
Natural Language
5th generation of programming language. Natural languages use human language to give people a more natural connection with computers. Natural languages allow questions or commands to be framed in a more conversational way.
Natural Language
For example: I WANT THE LIST OF SPM3112 STUDENTS TO BE PRINTED AT 2.00 PM 19/01/2007 Natural languages are part of the field of study known as artificial intelligence (AI). AI are technologies that attempt to develop machine to emulate human-like qualities.