Jumat, 08 April 2011

TUGAS LATIHAN PEMETAAN ARAY DIMENSI 3

Nama    :               karyono
NIM       :               18101730
Kelas     :               12.2C.14

1.            Terdapat aray float A[5][4] dan lokasi awal terletak dialamat 00F (H) maka lokasi A[3][4] secara kolom       d an baris adalah:
2.            Terdapat aray long double A[50][75] awal yang terletak di alamat 00F(H) maka lokasi A[40] [60] secara    kolom dan baris adalah :
3.            Terdapat aray double A [25] [50] dan lokasi awal terletak di alamat 009F (H)  maka lokasi  A[17] [48] secara kolom dan baris adalah ;
4.            Deklarasi  Aray X adalah double A [2] [4] [5] dengan alamat awal index A [0] [0] [0]  berada di 0021 (H)       tentukan berapa alamat aray di A [2] [2] [2] adalah

Jawab:
1.      1. Diket:    A[5][4]                                                 Peny: M[i][j]=@M[0] [0] +{(i-1)*N+(j-1)*L
M[3][4]= 00F(H)+{(3-1)*4+(4-1)}*4
M= 00F(H)                                                                    =00F(H)+(8+3)*4
L= 4                                                                                = 00F(H)+44(D)
                @M[i][j]=A[3][4]                                                          = 00F(H)+2C(H)
                i= 3                                                                                 = 03B(H) (BARIS)
                j= 4                                                                    M[i][j]= M[i][j]=@M[0] [0] +{(i-1)*K+(j-1)*L
                K=5        N=4
 00F(H)+{(4-1)*5+(3-1)}*4            
                                                                                                     = 00F(H) +17*4
                                                                                       = 00F(H)+68(D)          
                                                                                                      =00F(H)+44(H)
                                                                                                      =053(H) (KOLOM)

2.      2. Diket:    A[50][75]                                                 Peny: M[i][j]=@M[0] [0] +{(i-1)*N+(j-1)*L
              M[48][60]= 00FF(H)+{(48-1)*75+(61)}*1
M= 00FF(H)                                                                    =00FF(H)+(3525+59)*10
L= 10                                                                                = 00FF(H)+8C00(H)
                i= 48                                                                                 = 8CFF(H) (BARIS)
                j= 60                                                                    M[i][j]=@M[0] [0] +{(i-1)*N+(j-1)*L
3.                                                                                                                       M[i][j]=@M[0] [0] +{(i-1)*K+(j-1)*L

M[i][j]= 00FF(H)+{(4-1)*5+(3-1)}*4            
                K= 50                                                                               = 00FF(H) +17*4
                N=75                                                                                = 00FF(H)+68(D)          
                                                                                                      =00FF(H)+44(H)
                                                                                                      =053(H) (KOLOM)

4.      3. Diket:    A[25][50]                                                 Peny: M[i][j]=@M[0] [0] +{(i-1)*N+(j-1)*L

 M[17][48]= 009F(H)+{(17-1)*50+(48-1)}*8
M= 009F(H)                                                                    =009F(H)+(800+4733)*8
L= 8                                                                                = 009F(H)+6776(D)
                @m[i][j]=A[17][48]                                                          = 09F(H)+6776(D)
                i= 17                                                                                 = 1B17(H) (BARIS)
                j=48
                K=25                                                                  M[i][j]= M[i][j]=@M[0] [0] +{(i-1)*K+(j-1)*L
                N=50
 00F(H)+{(48-1)*25+(17-1)}*8            
                                                                                                              = 009F(H) +9528*8
                                                                             = 009F(H)+2538(H)          
                                                                                                              =2507(H)  (kolom)


4.      4. Diket:    A=[2][4] [5]                                                Peny: [M][N][P]= A[2][2][2]
A=[0][0][0]                                                             =0021(H)+{(12-1)*2+(2-1)*4+(2-1)*5}*8
L= 8                                                                         =0021(H)+{2+4+5}*8
                                                                                              =0021(H)+88(D)
                                                                                              =0021(H)+58(H)
                                                                                              =0079(H)

Tidak ada komentar:

Posting Komentar