TOPIC 1 : INTRODUCTION TO PROGRAMMING LANGUAGE
What is a Computer?
A computer is a programmable machine. The two principal characteristics of a computer are:
All general-purpose computers require the following hardware components:
ü mass storage device: allows a computer to permanently retain large amounts of data. Common mass storage devices include disk drives and tape drives.
ü input device: usually a keyboard and mouse, the input device is the conduit through which data and instructions enter a computer.
ü output device: a display screen, printer, or other device that lets you see what the computer has accomplished.
ü central processing unit (CPU): the heart of the computer, this is the component that actually executes instructions.
Computer Classification
Computers can be generally classified by size and power as follows, though there is considerable overlap:
ü personal computer: a small, single-user computer based on a microprocessor. In addition to the microprocessor, a personal computer has a keyboard for entering data, a monitor for displaying information, and a storage device for saving data.
ü workstation: a powerful, single-user computer. A workstation is like a personal computer, but it has a more powerful microprocessor and a higher-quality monitor.
ü minicomputer: a multi-user computer capable of supporting from 10 to hundreds of users simultaneously.
ü mainframe: a powerful multi-user computer capable of supporting many hundreds or thousands of users simultaneously.
ü supercomputer: an extremely fast computer that can perform hundreds of millions of instructions per second.
Hardware
Refers to objects that you can actually touch, like disks, disk drives, display screens, keyboards, printers, boards, and chips. In contrast, software is untouchable.
Hardware System
The hardware system consists of external and internal physical components that enable a computer to accept input, process the input, store data, and produce outputs. The figures below show some external hardware components of a computer.
Software
Software exists as ideas, concepts, and symbols, but it has no substance. Books provide a useful analogy. The pages and the ink are the hardware, while the words, sentences, paragraphs, and the overall meaning are the software. A computer without software is like a book full of blank pages -- you need software to make the computer useful just as you need words to make a book meaningful.
Software is often divided into two categories:
ü systems software : Includes the operating system and all the utilities that enable the computer to function.
ü applications software : Includes programs that do real work for users. For example, word processors, spreadsheets, and database management systems
Software System—Operating System Software and Application Software
The two different types of software programs are (1) operating system software and (2) application software. The diagram below illustrates the levels of interaction among users, application software, operating system software, and the hardware system.
The operating system software serves as the interface between application software and the hardware components. And, the application software interfaces with the users of the computer system.
Operating system software provides instructions to hardware system components. Examples of operating systems are the Microsoft Windows operating system and the Macintosh operating system. When an input is entered, the operating system program provides instructions to send the input to appropriate hardware components for processing. Then, it provides instructions for the result to be sent to the appropriate output device. For example, when a user types using a keyboard, the Microsoft Windows operating system takes the input sent through the keyboard and displays the typed letters on the monitor
Application software provides instructions that enable the user to perform specific tasks such as creating presentations, composing written documents, and editing images. Examples of application software programs are Microsoft Word and Notepad. Application software instructions are handled by the operating system. For instance, when you open a file using Microsoft Word, first the application provides the user-interface for you to specify which file you want to open (for example, the menu bar). Once you have selected the file, the application notifies the operating system that a certain file is needed. The operating system then requests for the file from the hard drive of the computer. You can view the application software currently on your computer by clicking on the Start button and select Programs.
The evolution of programming language
- The first generation languages, or 1GL are low-level languages that are machine language.
- The second generation languages, or 2GL are also low-level languages that consist of assembly languages.
- The third generation languages, or 3GL are high-level languages such as C.
- The fourth generation languages, or 4GL are languages that consist of statements similar to statements in a human language. Fourth generation languages are commonly used in database programming and scripts.
- The fifth generation languages, or 5GL are programming languages that contain visual tools to help develop a program. A good example of a fifth generation language is Visual Basic.
Machine language is a collection of binary digits or bits that the computer reads and interprets. Machine language is the only language a computer is capable of understanding. While easily understood by computers, machine languages are almost impossible for humans to use because they consist entirely of numbers. Programmers, therefore, use either a high-level programming language or an assembly language.
Assembly language closely approximates binary machine code and uses equivalent symbols to communicate with the computer language of a specific machine. It is one step removed from machine language. Programs written in assembly language are converted into machine language by specialized programs called assemblers or compilers for their execution by the machine(computer).
3rd generation language
3rd generation language
A high-level language is an advanced computer programming language that isn't limited by the computer, designed for a specific job, and is easier to understand. Today, there are dozens of high-level languages; some examples include BASIC, C, FORTAN, Java, and Pascal.
The third generation brought refinements to make the languages more programmer-friendly. A third generation language improves over a second generation language by having the computer take care of non-essential details, not the programmer. First introduced in the late 1950s, Fortran, ALGOL, and COBOL are early examples of this sort of language. Most popular general-purpose languages today, such as C, C++, C#, Java, BASIC and Delphi. Most 3GLs support structured programming.
4th generation language is a programming language or programming environment designed with a specific purpose in mind, such as the development of commercial business software. All 4GLs are designed to reduce programming effort, the time it takes to develop software, and the cost of software development. The main domains and families of 4GLs are: database queries, report generators, data manipulation, analysis and reporting, screen painters and generators, GUI creators, mathematical optimization, web development and general purpose languages.
4GLs are more programmer-friendly and enhance programming efficiency with usage of English-like words and phrases, and when appropriate, the use of icons, graphical interfaces and symbolical representations.
4GLs are more programmer-friendly and enhance programming efficiency with usage of English-like words and phrases, and when appropriate, the use of icons, graphical interfaces and symbolical representations.
5th generation language is a programming language based on solving problems using constraints given to the program, rather than using an algorithm written by a programmer. Most constraint-based and logic programming languages and some declarative languages are fifth-generation languages. Fifth-generation languages are designed to make the computer solve a given problem without the programmer. This way, the programmer only needs to worry about what problems need to be solved and what conditions need to be met, without worrying about how to implement a routine or algorithm to solve them. Fifth-generation languages are used mainly in artificial intelligence research. Prolog, OPS5, and Mercury are examples of fifth-generation language.
Terminologies.
A program is an executable binary file stored on disk that contains machine instructions
A programmer is someone who writes programs
Programming is the act of writing instructions that a machine will execute
Assembler
Assembler
Compiler
Programs written in high-level languages are translated into assembly language or machine language by a compiler.
Translator
Object Oriented Programming focuses on representing problems using real-world objects and their behavior. There are several important OOP concepts such as Data abstraction, Encapsulation, Polymorphism. Some of the most popular OOP languages are Java and C#.
Structured Programming deals with organizing the program in a logical structure. A structured program is made up of simple program flow structures, which are hierarchically organized. They are sequence, selection and repetition. Sequence is an order of statements. Selection means selecting a statement from a set of statements based on the current state of the program (e.g. using if statements) and repetition means executing a statement until a certain state is reached (e.g. using for or while statements). Example: ALGOL, Pascal, Ada
No comments:
Post a Comment