CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING INTRODUCTION TO COMPUTERS PROGRAMS
CONTENT A brief history of a computer and programming language. Introduction to programming.
COMPUTER
WHAT KIND OF ACTIVITIES YOU CAN DO WITH A COMPUTER ????...
COMPUTER What is a computer? An electronic machine, operating under the control of instruction stored in its own memory. Machine that obtains data as input, processes the data and produces valuable output. Output will be stored in various storage.
COMPUTER COMPUTER HARDWARE SOFTWARE The electric, electronic and mechanical equipment that makes up a computer The series of instructions that tells the computer hardware how to perform tasks
BASIC OPERATIONS OF A COMPUTER these operations are under the control of instructions stored in the computer’s memory INPUT Accepting data from user PROCESS Manipulating data OUTPUT Producing result STORAGE Storing result
BASIC OPERATIONS OF A COMPUTER Example: ATM program (money withdrawal)
PROGRAM LANGUAGE How human and computer interact?
COMPUTER PROGRAM What is a computer program? Set of instruction that directs computer to perform tasks. Programming language – used to write instructions Programmer – writes and modifies computer program
EVOLUTION OF PROGRAMMING LANGUAGE
Evolution of programming language Machine language Assembly language 3rd Generation language 4th Generation language 5th Generation language
TYPES OF LANGUAGES Low Level Language High Level Language Procedural Machine Language Assembly Language High Level Language 3rd Generation Language 4th Generation Language 5th Generation Language Procedural language Non - Procedural language
MACHINE LANGUAGE Only language computer directly recognizes Uses a series of binary digits (1s and 0s) with a combination of numbers and letters that represent binary digits.
ASSEMBLY LANGUAGE Instructions made up of symbolic instruction codes, meaningful abbreviations and codes Source program contains code to be converted to machine language
3rd Generation Language Uses series of English – like words to write instructions Most widely used are BASIC, COBOL, C++ and C Uses compiler or interpreter to translate to machine language.
4th Generation Language Most of DBMS (Database Management System) is considered as 4th generation language Examples are Microsoft Access, DBASE IV and FoxBase. Main characteristics of this generation is it non procedural, much easier to organize records or data, faster to write programs and easier to design forms or reports.
5th Generation Language Provides visual or graphical interface for creating source code Often used in RAD (rapid application development) environment Available in Visual Studio 2005, Delphi and PowerBuilder. User are not required to understand programming language. Thay are able to communicate with the computer using natural language.
OTHER PROGRAMMING LANGUAGE ADA ALGOL APL BASIC FORTH FORTRAN HYPERTALK LISP LOGO MODULA-2 PASCAL PILOT PL/1 PROLOG SMALLTALK
RELATIONSHIP BETWEEN ASSEMBLER, COMPILERS, INTERPRETERS & COMPUTER PROGRAMS
Computer program Definition: is a list of instructions written in a programming language that is used to control the behavior of a machine.
LANGUAGE TRANSLATOR A Language Translator is a software that translate a program written in 2nd , 3rd or higher – generation language into machine language. 3 types: Assembler Compiler Interpreter
Assembler Translate from assembly language to machine language
COMPILER Program that converts entire source program into machine language before executing it
Compiler
INTERPRETER Programs that translate and executes one program code statement at a time Does not produce object program
Interpreter
THE IMPORTANCE OF PROGRAMMING
PROGRAMMING Allows user to direct computer to execute tasks A skill required of a computer scientist or a software engineer An activity that is central to computer science Improves logical reasoning and critical thinking skills
CRITERIA OF A GOOD PROGRAM
The criteria Accuracy Reliability Usability Maintainability Program that fulfils all the specification, requirement and objectives. Reliability No errors. Usability Easy to use and learn. Maintainability Easily understood, tested and modify
The Criteria Efficiency Readability Fast program execution and quick access to data to generate output Readability Clear and understandable Using meaningful name for variable Have explanations on the program’s function
Example
A good program is a Program that is easy To read and easy to be understood by other programmers
Exercises Give example of three (3) programming language. What is the difference between machine language and assembly language? What is the difference between compiler and assembler? Explain procedural and non procedural language. Give an example of programming language for each.