Docstoc

Programming Language C Pascal

Document Sample
Programming Language C   Pascal Powered By Docstoc
					 PROGRAMMING LANGUAGE
RECOGNITION Using C / C + +




                     Yudy P.
BASIC CONCEPTS

  • Basic understanding of programming is an
    algorithm analysis.
  • Every algorithm that we arrange is not
    dependent on a particular programming
    language.
  • Every programming language has a
    different characteristic structure, syntax
    and writing code
C + + Programming Language
• C + + was created by Bjarne Stroustrup at Bell labs
  in the early 1980s, as the development of the
  language C and Simula.
• Currently, C + + is one of the most popular language
  for OOP-based software development.
• Examples of products of Borland compilers for C + +
  compiler is Turbo C + +, Borland C + +, Borland C + +
  Builder. While Microsoft is Ms. Visual C + +.
• Although many compilers are available, but at its
  core programming language used was C + +.
STEP BY STEP:
          start


    Writing a program



    Menjalan Program



                         Yes
       Something               Improving program
         wrong

                    no


           end
        PROGRAMMING LANGUAGE
             STRUCTURES
• Declare Section
• Part declaration is part of a program to define the type of data
  a variable, constants, and functions and procedures that will be used
  on the program.

• Statement Section
• Part statement was part program that contains commands that
  will be executed / implemented.
Struktur C/C++
 Some things to note in the writing program is :


• Program Structure
• Writing syntax
• The algorithm of the program
BASIC ELEMENT PROGRAMMING
• Identifier (variable) and Data Type
• Konstanta
• Operator
• Statement Input and Output (I/O)
Identifier (variable) and Data Type
• Identifier (identifier) is the name commonly used for a change
  (variable), constants, functions, or other object that is defined
  by the programmer.

Rules that apply to a general identifier is :
1. Identifier must begin with the letter (A .. Z, a .. z)
2. Can contain letters, numbers (0 .. 9) and underscore character (_)
3. May not use Spaces
4. Long identifiers may consist of more than 32 characters, but
only the first 32 characters are considered significant.
5. Case sensitive Case sensitive or non-dependent bhs programming.
Suppose C and C + + is case sentitive
Example :
• total
• X, y, z
• average
• Total 1, total 2


Variable declare


   How to Declare the variable depends on the structure
   program a programming language
   .
 Example:
 C/C++:        Pascal:             Basic:




int total;    Var                 DIM A As Integer
Cost float;   Total : integer;    DIM X As Single
              Kode : String[5];   DIM Y As Long
                                              or
                                  large#  Double
DATA TYPE
• Understanding data type implies a value that
   can be expressed in terms of constant or
   variable
Data based on the type can be divided into five groups, termed as the
• . data types, namely:
basic
    − Integer (integer)
    − Fractions (float / real) single-precision
    − Fractions (float / real) double-precision
    − Character (character), and
    − No type (void).
Contoh Tipe data di C/C++
Declare:
• Declare the data type variables:
  Type Nama_Variabel;

  Type: Specifies the type of variable
  Nama_Variabel: Specifies the name of the variables
  used in the program, if more than one variable with
  the same type separated by commas.
  Example:
  int count;
  float harga_per_satuan, total_harga;

				
DOCUMENT INFO
Shared By:
Stats:
views:7
posted:1/15/2013
language:
pages:14
Description: Language program for computer.