Selamat Datang Di Blogger Gerry_ota Berbagi Ilmu

Rabu, 08 Mei 2013

STRUKTUR DATA



1.       Tuliskan semua operator dan contoh hasil operasinya untuk tipe-tipe data berikut:
               Integer, Real, Boolean, String
2.       Tuliskan contoh pendefinisian tipe-tipe berikut pada bahasa pemrograman Pascal, C dan Basic atau bahasa pemrograman lainnya.
                - array
                - record

1.       Operator dan Contoh tipe-tipe :
a.       Tipe integer
 Operator : +
Contoh : 12+4=16
                                Operator : -
                                                Contoh : 5-2 = 3
                                Operator : x
                                                Contoh : 5x3 = 15
Operator : DIV
Contoh : 16 div 5 = 3
                                Operator: MOD
                                                Contoh : 15 mod 4 = 3
                               
b.      Tipe boolean
·         Operator Relasional, yaitu : >, <, >=, <=, <> dan =
Contoh :
6 < 8 = True
9 > 8 = False

·         Operator             : and
Contoh :  
OPR1
OPR2
AND
FALSE
FALSE
FALSE
FALSE
TRUE
FALSE
TRUE
FALSE
TALSE
TRUE
TRUE
TRUE





·         Operator             : OR
        Contoh :
OPR1
OPR2
OR
TRUE
TRUE
TRUE
TRUE
FALSE
TRUE
FALSE
TRUE
TRUE
FALSE
FALSE
FALSE
       
·         Operator             : NOT
        Contoh :
OPR
NOT
TRUE
FALSE
FALSE
TRUE

c.       Real
Operator :  .
Contoh : 
134.24
                1.2345 x 102  (scientific notation)
Contoh :
Di dalam sistem desimal, 123000 = 0.123 * 106
di sini 0.123 adalah mantissa atau pecahan, sedangkan 106 adalah eksponennya.


d.      String           
Operator : LEN
Contoh : (”aku”) = 3
Operator  : CONCAT
                                                Contoh : (“ma”,”in”) = “main”
Operator : SUBSTR
                                                Contoh : (“Tidur”,2,3) = “idu”
Operator :INSERT
                                                Contoh : (“23”,”56”,2) = “2562”
Operetor : DELETE
                                                Contoh : (“MAINBOARD”,3,4) = “MAARD”

               
                               
                               
               













                         


Comments
0 Comments

0 komentar:

Posting Komentar

DAFTAR ISI

IKLAN