Download
set and string n.
Skip this Video
Loading SlideShow in 5 Seconds..
SET and String PowerPoint Presentation
Download Presentation
SET and String

SET and String

67 Vues Download Presentation
Télécharger la présentation

SET and String

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. SET and String

  2. Type Nama_set = set of tipe_dasar; Contoh Type Angka = set of 0 .. 9; Type Rupa = (merah, hijau, kuning, biru, ungu); Warna = set of Rupa; Ataubisajugalangsungsebagaiberikut : Type Warna = set of (merah, hijau, kuning, biru, ungu);

  3. Type Mobil = (accord, baleno, charade, civic, corolla, kijang, kuda, panther, vitara, zebra); HimpMobil = set of Mobil; Var Bela, Disa, Kira, Maya, Orak : HimpMobil; Begin Bela := [baleno, civic, vitara]; Disa := [accord .. corolla, vitara]; Kira := [kijang .. zebra]; Maya := [kijang, kuda, panther]; Orak := [];

  4. OperasiHimpunan

  5. Prosedure • Delete(nama_string, indeks, jumlah); Kata := ‘SelamatBelajar’ Delete(Kata, 5,3) hasilnyaadalah ‘SelaBelajar’. • Concat(s1, s2 {,s3,…, sn}); • Copy(nama_string, indeks, jumlah); Kata := ‘UMS Surakarta’ Copy(Kata,5,7) hasilnyaadalah ‘Surakar’

  6. Prosedure • Pos(sub_string, nama_string); Kalimat := ’IkhlasBeramal’ Kata1 := ‘amal’ Kata2 := ‘semu’ Pos(kata1, Kalimat) hasilnyaadalah 11 Pos(kata2, Kalimat) hasilnyaadalah 0 • Length(nama_string);

  7. Prosedure Insert(string_asal,string_tujuan, indeks); Kata1 := ‘Jurusan UMS’ Kata2 := ‘Matematika ’ Insert(Kata2, Kata1, 9) hasilnya ‘JurusanMatematika UMS’