Programming and Languages - PowerPoint PPT Presentation

1 / 28
About This Presentation
Title:

Programming and Languages

Description:

A program is a detailed set of step by step instructions that directs the ... Why Use OOPs. The main advantage is the ability to build and reuse objects ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 29
Provided by: lsch9
Category:

less

Transcript and Presenter's Notes

Title: Programming and Languages


1
Programming and Languages
  • Telling the Computer What to Do

2
What is a program?
  • A program is a detailed set of step by step
    instructions that directs the computer what to
    do
  • Programs are written in programming languages
    which are a set of rules that allow you to write
    programs

3
What do programmers do?
  • Programmers obviously write programs
  • Main tasks are to convert everyday problems into
    computer instructions
  • Example a programmer might write a program that
    subtracts from your bank account balance when you
    visit the ATM

4
The Programming Process
  • Defining the problem
  • May receive instructions from the systems
    analyst
  • May have to meet with the user
  • Eventually a written agreement is agreed upon
    that spells out the specifics of the program

5
The Programming Process Continued
  • Planning the solution
  • Design an algorithm, which is a detailed, step
    by step solution to the problem
  • Programmer can design this in
  • Pseudocode which is nonstandard English which
    allows the programmer to spell the steps out in
    some detail without using a programming language
  • Flowchart-graphical depiction of the process
    where symbols represent actions and arrows
    represent sequence
  • Programmers may also use desk checking which is a
    process that requires the programmer to run
    through a mock version of the program on paper

6
The Programming Process Continued
  • Coding the project
  • Done in a computer language which has its own set
    of rules called syntax
  • Text is entered into a programming tool or a text
    editor, which may be a part of an integrated
    development environment (IDE)

7
Testing the program
  • Translation is the process of translating the
    instructions into binary so the computer can
    understand it.
  • This is done with a compiler that takes the
    source module (what you wrote) and translates it
    into the object model (the binary version the
    computer understands)
  • Load module is created when there are no more
    detectable errors in the program and the onject
    module is linked to prewritten modules using a
    linkage editor or the linker

8
Testing Continued-Debugging
  • Syntax errors, which are violations of the
    language rules, should be detected and corrected
    before the computer compiles
  • Harder to find and fix, are logic errors, called
    bugs. These errors are generally errors in
    planning or the solution to the problem.
  • Fixing logic errors is called debugging.

9
Documenting the Program
  • Once the program is complete, instructions and
    documentation that has been generated in the
    entire process is combined
  • This can include the flowchart, descriptions of
    problems, narrative descriptions of the program,
    and code listings.

10
Levels of Language
  • Five common levels
  • Machine language
  • Assembly language
  • High-level language
  • Very high-level language
  • Natural language

11
Machine Language
  • Series of 1s and 0s that the computer can
    understand
  • All programs must be translated into machine
    language or binary
  • In early days of computer it was the only way to
    program but was very difficult to read and write

12
Assembly Language
  • Next step up from machine languages but is still
    very basic and hard to understand
  • At the time however it was a great leap from
    machine
  • Allows for abbreviations such as A for add and
    STO for store
  • Also allowed names for storage locations instead
    of the binary address
  • Needs an assembler to translate it to machine
    language

13
High-level language
  • Developed in the early 60s
  • Did not require the programmer to have detailed
    knowledge of the computer hardware
  • Created certain languages for certain types of
    problems
  • Increased productivity greatly
  • Still requires translators to convert to machine
    language

14
Very High-Level Language
  • Also called fourth generation or 4GL
  • First nonprocedural language (did not consist of
    step by step instructions)
  • Programmer specifies the results desired and the
    computer figures out the best solution
  • Productivity greatly increased
  • Query language, which is an iteration of a 4GL
    are used to retrieve data from databases

15
Choosing a Language
  • Many times chosen for you by the business
  • Can be affected if your program will interact
    with other programs or databases already written
  • Generally you will choose the language you are
    most familiar and productive with

16
Major Programming Languages-A Short Intro
  • FORTRAN (FORmula TRANslation)
  • one of the first high-level languages created.
  • Used mostly for mathematic and scientific
    problems because of its ability to represent
    complex mathematical equations.
  • Newer languages are replacing FORTRAN

17
COBOL (COmmon Business Oriented Language)
  • Designed specifically for business applications
  • Very verbose meaning it is very much like
    English
  • Still in use today
  • Easy to understand because it is so verbose but
    many programmers dislike it because it takes
    longer to write

18
BASIC (Beginners All Purpose Symbolic
Instruction Code)
  • Created by professors to teach programming to
    students
  • Became popular with the PC because it is easy to
    understand and the compiler takes very little
    memory
  • Has all but disappeared and been replaced by
    Visual Basic

19
Visual Basic
  • One of the first visual development environments
  • Allows users to design complex interfaces using
    items such as buttons, menus, and scrollbars.
  • Revolution in the way the user interacts with the
    program as compared to other programs. Users can
    select what they want to do using the interface
    instead of being controlled by the program and
    only providing input when asked for.

20
RPG (Report Program Generator)
  • A precursor to the 4GL languages
  • Developed by IBM to allow the rapid creation of
    reports from data
  • Reports can be created much quicker than using
    its business counterpart at the time, COBOL.

21
C
  • Developed in the 70s to write system software but
    has been adapted to be general use
  • Combines efficiency of assembly with the features
    of a high-level language
  • Main selling point is its portability. There are
    compilers for all platforms (hardware and
    software combined)
  • C quickly becoming replaced by its programming
    cousin C

22
Java
  • Lots of media attention
  • Developed by Sun Microsystems to run natively on
    many different platforms
  • Derivative of C
  • Does not require programmer to write to a certain
    platform
  • Because of this can be very popular for internet
    applications

23
Object Oriented Programming (OOP)
  • Relatively new approach to programming
  • What is an object?
  • Example a car can be an object
  • The car has properties such as its color and
    shape
  • The car has functions, to drive, to stop, turn,
    etc.
  • In a programming environment, the object is a
    self-contained unit that contains both data and
    functions
  • Dr. Kirsten Nygaard, a Norwegian computer
    scientist developed the idea of object
    orientation in 1969

24
More on objects
  • The self-contained nature of the object is called
    encapsulation
  • The aspects that describe the object are called
    the attributes
  • The functions or the instructions of the object
    are called methods or operations

25
Even More on Objects
  • Methods are activated by an outside stimulus
    called a message that results in the change of
    the state of an object
  • Classes are groupings of objects that contain
    attibutes that are unique to objects of the
    class
  • Subclasses can be formed also in a hierarchical
    organization
  • All subclasses automatically posses the
    attributes of the class through inheritance

26
Activating the Object
  • The message is sent to the object and relays what
    needs to be done and the methods of the object
    tell the object how to do it.
  • Polymorphism is the ability of an individual
    object to know how, using its methods, to process
    the message in an appropriate way.

27
OOP Languages
  • C, an enhanced version of C which supports
    object-oriented programming is the most popular
    OOP software
  • Java is gaining some support as an OOP which is a
    pure OOP
  • Relatively new on the market is C by Microsoft
    which is optimized for the Windows environment
  • New additions to Visual Basic, including
    inheritance and polymorphism, meet the criteria
    for an object oriented programming language

28
Why Use OOPs
  • The main advantage is the ability to build and
    reuse objects
  • For example, an object that calculates tax can be
    used over and over throughout a sales program
  • Saves time and debugging once the object is
    functional
Write a Comment
User Comments (0)
About PowerShow.com