Introduction to programming

21
Prepared by: Gwyneth Calica Mackenzie Nicole Cuaresma

Transcript of Introduction to programming

Prepared by:

Gwyneth Calica

Mackenzie Nicole Cuaresma

A program is a set of instructions that tell the computer to do various things; sometimes the instruction it has to perform depends on what happened when it performed a previous instruction. This section gives an overview of the two main ways in which you can give these instructions, or “commands” as they are usually called. One way uses an interpreter, the other a compiler. As human languages are too difficult for a computer to understand in an unambiguous way, commands are usually written in one or other languages specially designed for the purpose.

• InterpretersWith an interpreter, the language comes as an environment, where

you type in commands at a prompt and the environment executes them for you. For more complicated programs, you can type the commands into a file and get the interpreter to load the file and execute the commands in it. If anything goes wrong, many interpreters will drop you into a debugger to help you track down the problem.

Program Life Cycle

1. Identifying the program- It involves determining the requirement of the program

2. Planning the solutiona) Flowchart- a graphical re presentation of the step by step

instructions in a program

b) Pseudo code- is listing down the set of instructions to be used in a program

3. Coding the program- It is the process on where you code the program with the

use of a chosen programming language

a) Syntax- own set of rules to follow

b) Syntax error- violation of the set of rules

c) Misspelling- the common cause of syntax error

4. Testing the programa) Desk checking- it mentally traces the logic of the

programb) Translation- languages uses a translator to ensure

that the programmer did not violate any language rules

c) Debugging- this means detecting, locating and correcting errors or mistakes called bugs.

5. Documentation- Contains brief narrative processes, from

Identification of the problem to Testing the program

Procedural Languages

• These are considered procedural uses a series of instructions or statements which are sequential from beginning to the end. This means that execution of instructions is line by line and it is

terminated after the last instruction.

BASIC (Beginner’s All-Purpose Symbolic Instruction Code)

• BASIC• Short for Beginner's All-purpose Symbolic Instruction

Code. Developed in the 1950s for teaching University students to program and provided with every self-respecting personal computer in the 1980s, BASIC has been the first programming language for many programmers. It is also the foundation for Visual Basic.

• The Bywater Basic Interpreter can be found in the Ports Collection as lang/bwbasic and the Phil Cockroft's Basic Interpreter (formerly Rabbit Basic) is available as lang/pbasic.

COBOL(Common Business Oriented Language)

• COBOL is a wordy language;

• programs written in COBOL tend to be much longer than the same programs written in other languages.

• This can be annoying when you program in COBOL, but the wordiness makes it easy to understand programs because everything is spelled out.

PASCAL

• Pascal is a historically influential imperative and procedural programming language, designed in 1968–1969 and published in 1970 by Niklaus Wirth as a small and efficient language intended to encourage good programming practices using structured programming and data structuring.

FORTRAN(Formula Translator)

• FORTRAN was the first high-level language, using the first compiler ever developed. Prior to the development of FORTRAN computer programmers were required to program in machine/assembly code, which was an extremely difficult and time consuming task, not to mention the dreadful chore of debugging the code. The objective during it's design was to create a programming language that would be: simple to learn, suitable for a wide variety of applications, machine independent, and would allow complex mathematical expressions to be stated similarly to regular algebraic notation. While still being almost as efficient in execution as assembly language. Since FORTRAN was so much easier to code, programmers were able to write programs 500% faster than before, while execution efficiency was only reduced by 20%, this allowed them to focus more on the problem solving aspects of a problem, and less on coding.

C Language

• It is a general purpose, imperativecomputer programming language. It supports structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations. By design, C provides constructs that map efficiently to typical machine instructions, and therefore it has found lasting use in applications that had formerly been coded in assembly language, including operating systems as well as various application software for computers ranging from supercomputers to embedded systems.

PL1 (Programming Language 1)

• PL/I "Programming Language One", is a procedural, imperative computer programming language designed for scientific, engineering, business and systems programming applications. It has been used by various academic, commercial and industrial organizations since it was introduced in the 1960s, and continues to be actively used as of 2014.

Non-Procedural Languages

• This programming languages are considered to be object-oriented programming languages. They are event-driven which means that a programmer selects an event that needs to occur before the instruction or statement is executed.

• Examples:

Click

Double Click

Drag and Drop

Mouse over etc.

VISUAL BASIC

• Visual Basic is a third-generation event-driven programming language and integrated development environment (IDE) from Microsoft for its COM programming model first released in 1991. Microsoft intended.

• Visual Basic to be relatively easy to learn and use.

C++

• C++ (pronounced as cee plus plus, /ˈsiː/ /plʌs/ /plʌs/) is a general-purpose programming language. It has imperative, object-oriented and generic programming features, while also providing the facilities for low-level memory manipulation.

JAVA

• Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented and specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA),[ meaning that code that runs on one platform does not need to be recompiled to run on another.[ Java applications are typically compiled to byte code that can run on any Java virtual machine (JVM) regardless of computer architecture.

DELPHI

• Embarcadero Delphi is an integrated development environment (IDE) for console, desktop graphical, web, and mobile applications.

• Delphi's compilers use their own Object Pascal dialect of Pascal and generate native code for 32- and 64-bit Windows operating systems, as well as 32-bit Mac OS X, iOS and Android. As of late 2011 support for the Linux operating system was planned by Embarcadero.[

Flowcharting

• -It is one of the processes used in designing or planning the solution of a problem

• A flowchart is a type of diagram that represents an algorithm, workflow or process, showing the steps as boxes of various kinds, and their order by connecting them with arrows. This diagrammatic representation illustrates a solution model to a given problem.

Symbols used in Flowcharts

RECTANGLE

DIAMOND

PARALLELOGRAM

CIRCLE

HEXAGON

OVAL

LEVELS OF PROGRAMMING

1. Machine Language or first generation programing language

2. Assembly Language or second generation programming language

3. High Level Language or third generation programming language

4. Very High Level Languages or fourth generation programming language

5. Natural Language

Gwyneth M. Calica Mackenzie Nicole D. Cuaresma