Top Banner
COMPUTER PROGRAMMING by: Trisha Faye Gamboa Karl Albert Balolong
24
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: Computer Programming

COMPUTERPROGRAMMING

by: Trisha Faye Gamboa Karl Albert Balolong

Page 2: Computer Programming

The Computer Programming and Analysis program provides an opportunity to establish a basic foundation in computer programming in scientific, commercial, industrial and government information technology applications. Graduates are prepared for positions as entry-level application programmers, programmer specialists, computer programmers and programmer analysts.

COMPUTER PROGRAMMING AND ANALYSIS

Page 3: Computer Programming

Computer programming is a process that leads from an original formulation of a computing problem to executable computer programs. Programming involves activities such as analysis, developing understanding, generating algorithms, verification of requirements of algorithms including their correctness and resources consumption, and implementation (commonly referred to as coding) of algorithms in a target programming language. Source code is written in one or more programming languages (such as C, C++, C#, Java, Python, Ruby, Smalltalk, JavaScript, etc.). The purpose of programming is to find a sequence of instructions that will automate performing a specific task or solving a given problem.

Page 4: Computer Programming

Introduction to Programming Program is a set of step-by-step

instruction that tells or directs the computer what to do.

Programming Language is a set of rules that tells the computer what to perform is through it.

Programmer is the person who designs and tests a program. Also decides which of the programs or set of instruction to use.

Page 5: Computer Programming

The process of programming thus often requires expertise in many different subjects, including knowledge of the application domain, specialized algorithms and formal logic.

Identifying – Planning – Coding – Testing - Documentation

Page 6: Computer Programming

Identifying the Problem

- First step. To determine the requirement of the program.Planning the Solution

- Two ways of planning the soluti0n to a problem. 1. Flowcharting2. Pseudo Code Flowcharting is a step-by-step instruction.Psuedo Code is listing down the set of instructions to be used in the program.

Page 7: Computer Programming

Coding the Program Designing the solution. This step

needs to use Visual Basic as it’s programming language. Programming language have their own set of rules to follow, this is called syntax. Also used in a certain program will produce an error called syntax error.

Testing the Program After coding the program, it is important to test if it is running.

Page 8: Computer Programming

Three phases of Testing:1. Desk checking- in these phase the

programmer just mentally traces or checks the logic of the program. To make sure if it’s error free.

2. Translation- these phase uses a translator to ensure that the programmer did not violate any language rules by the chosen programming language. It translates the program line by line to locate any syntax error.

Page 9: Computer Programming

Documentation

3. Debugging- this means detecting, locating and correcting bugs ( an error or mistake).

-In this step, the programmer makes a detailed description on how the program was created. It contains a brief narrative process undergone by a program. - Codes used for the next programmer who will upgrade the designed program.

Documentation

Page 10: Computer Programming

Modern Programming

Page 11: Computer Programming

Qualities in modern programming:Reliability: how often the results of a program are correct. This depends on conceptual correctness of algorithms, and minimization of programming mistakes, such as mistakes in resource management (e.g., buffer overflows and race conditions) and logic errors (such as division by zero or off-by-one errors).Robustness: how well a program anticipates problems due to errors (not bugs). This includes situations such as incorrect, inappropriate or corrupt data, unavailability of needed resources such as memory, operating system services and network connections, user error, and unexpected power outages.

Page 12: Computer Programming

Usability: the ergonomics of a program: the ease with which a person can use the program for its intended purpose or in some cases even unanticipated purposes. Such issues can make or break its success even regardless of other issues. This involves a wide range of textual, graphical and sometimes hardware elements that improve the clarity, intuitiveness, cohesiveness and completeness of a program's user interface.

Portability: the range of computer hardware and operating system platforms on which the source code of a program can be compiled/interpreted and run. This depends on differences in the programming facilities provided by the different platforms, including hardware and operating system resources, expected behavior of the hardware and operating system, and availability of platform specific compilers (and sometimes libraries) for the language of the source code

Page 13: Computer Programming

Maintainability: the ease with which a program can be modified by its present or future developers in order to make improvements or customizations, fix bugs and security holes, or adapt it to new environments. Good practices during initial development make the difference in this regard. This quality may not be directly apparent to the end user but it can significantly affect the fate of a program over the long term.

Efficiency/performance: the amount of system resources a program consumes (processor time, memory space, slow devices such as disks, network bandwidth and to some extent even user interaction): the less, the better. This also includes careful management of resources, for example cleaning up temporary files and eliminating memory leaks

Page 14: Computer Programming

Different programming languages support different styles of programming (called programming paradigms). The choice of language used is subject to many considerations, such as company policy, suitability to task, availability of third-party packages, or individual preference. Ideally, the programming language best suited for the task at hand will be selected.

Programming language and List of programming

languages

Page 15: Computer Programming

Trade-offs from this ideal involve finding enough programmers who know the language to build a team, the availability of compilers for that language, and the efficiency with which programs written in a given language execute. Languages form an approximate spectrum from "low-level" to "high-level"; "low-level" languages are typically more machine-oriented and faster to execute, whereas "high-level" languages are more abstract and easier to use but execute less quickly. It is usually easier to code in "high-level" languages than in "low-level" ones.

Page 16: Computer Programming

The details look different in different languages, but a few basic instructions appear in just about every language:

Input: Gather data from the keyboard, a file, or some other device.

Output: Display data on the screen or send data to a file or other device.

Arithmetic: Perform basic arithmetical operations like addition and multiplication.

Conditional Execution: Check for certain conditions and execute the appropriate sequence of statements.

Repetition: Perform some action repeatedly, usually with some variation.

Page 17: Computer Programming

Levels of programming language There are five levels of programming

language. Used in their respective generation. Each generation is an improvement of the latter generation.

1. Machine Language ( 1st Generation

Prog. Language- Lowest level programming language. It’s represented by 1s and 0s. A very tedious task for just a simple task, the program code required would be very long.

Page 18: Computer Programming

2. Assembly Language or 2nd Generation Prog. Language -Also considered as low level language. This language is easier to use than Machine language. Instead of using 1s and 0s, this language use mnemonic codes( abbreviations that are easy to remember).3. High Level Language or 3rd Generation Prog. Language - this language transformed programming in the early 1960s. It’s easier since the language is now written in English like matter. Third generation prog. Language uses translator.

Page 19: Computer Programming

4. Very High Level Language or 4th Generation Language ( 4 GL)

It simplifies further the third level generation language (3GL) because there is a reduction in the number of instructional statements. One hundred (100) lines of instruction in 3GLs can be reduced to five (5) to twenty (20) lines of instruction in 4GLs.5. Natural Language This language are considered to be the fifth gen. prog. language. Natural language have their resemblance to English language. This language have the capability to translate human instructions into code that a computer understands.

Page 20: Computer Programming

Procedural and Non-Procedural Language

Page 21: Computer Programming

Procedural Language PROGRAMMING LANGUAGES WHICH ARE

CONSIDERED PROCEDURAL USES A SERIES OF INSTRUCTIONS OR STATEMENTS WHICH ARE SEQUENTIAL FROM THE BEGINNING TO THE END. THIS MEANS THAT EXECUTION OF INSTRUCTIONS IS LINE BY LINE AND IT IS TERMINATED AFTER THE LAST INSTRUCTION.

Examples:• BASIC (Beginner’s All-Purpose Symbolic

Instruction Code)• COBOL(Common Business Oriented

Language)• FORTRAN (Formula Translator)• C• PL1 (Programming Language 1)

Page 22: Computer Programming

Non-Procedural Languages

So called as 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: VISUAL BASIC C++ JAVA DELPHI

Page 23: Computer Programming

Many computer languages provide a mechanism to call functions provided by shared libraries. Provided the functions in a library follow the appropriate run time conventions (e.g., method of passing arguments), then these functions may be written in any other language.

Page 24: Computer Programming

END OF OUR

PRESENTATION