tag:blogger.com,1999:blog-35187431746387123612024-02-07T17:16:32.592-08:00Tugas KuliahWahyudihttp://www.blogger.com/profile/18000311052880630427noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-3518743174638712361.post-48996270671097071892010-10-25T12:58:00.000-07:002010-10-25T13:02:10.510-07:00Tugas Logika dan Algoritma Pertemuan 5<div class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"><b>STRUKTUR LOOPING</b> </div><div class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"><br />
</div><div class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;">1.<span style="font: 7pt "Times New Roman";"> </span>Jelaskan pengertian statement</div><ol start="1" style="margin-top: 0in;" type="a"><li class="MsoNormal">While… do… end while</li>
</ol><div class="MsoNormal" style="margin-left: 0.5in;"><i>Jawab :</i></div><div class="MsoNormal" style="margin-left: 0.5in;">Merupakan suatu perulangan penyeleksi kondisi yang digunakan agar program dapat menyeleksi kondisi, sehingga program dapat menentukan tindakan apa yang harus dikerjakan, tergantung dari kondisi yang diseleksi. Atau dengan kata lain merupakan aksi (runtunan aksi) akan dilaksanakan berulang kali selama kondisi bernilai true, jika false maka badan pengulangan tidak akan dilaksanakan yang berarti pengulangan selesai.</div><div class="MsoNormal" style="margin-left: 0.5in;"><br />
</div><ol start="2" style="margin-top: 0in;" type="a"><li class="MsoNormal">Repeat … until</li>
</ol><div class="MsoNormal" style="margin-left: 0.5in;"><i>Jawab :</i></div><div class="MsoNormal" style="margin-left: 0.5in;">Digunakan untuk mengulang statement-statement atau blok statement sampai (until) kondisi yang diseleksi di until tidak terpenuhi.</div><div class="MsoNormal" style="margin-left: 0.5in;"><br />
</div><ol start="3" style="margin-top: 0in;" type="a"><li class="MsoNormal">For… end for</li>
</ol><div class="MsoNormal" style="margin-left: 0.5in;"><i>Jawab :</i></div><div class="MsoNormal" style="margin-left: 0.5in;">Digunakan untuk menghasilkan pengulangan sejumlah yang telah ditentukan sebelumnya. Jumlah pengulangan diketahui atau dapat ditentukan sebelum eksekusi.</div><div class="MsoNormal"><br />
</div><div class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;">2.<span style="font: 7pt "Times New Roman";"> </span>Dari soal No.1 buat masing satu dari contoh algoritma dan flowchartnya</div><div class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;">a.<span style="font: 7pt "Times New Roman";"> </span>While.. do… end while</div><div class="MsoNormal" style="margin-left: 0.5in;">Algoritma cetak angka :</div><div class="MsoNormal" style="margin-left: 0.5in;">{mencetak 1,2, …, 8 ke piranti keluaran}</div><div class="MsoNormal" style="margin-left: 0.5in;">Deklarasi :</div><div class="MsoNormal" style="margin-left: 0.5in;"> k : integer</div><div class="MsoNormal" style="margin-left: 0.5in;">Deskripsi :</div><div class="MsoNormal" style="margin-left: 0.5in;"> k ← 1 {inisiasi}</div><div class="MsoNormal" style="margin-left: 0.5in;">while k <= 8 do</div><div class="MsoNormal" style="margin-left: 0.5in;"> write (k)</div><div class="MsoNormal" style="margin-left: 0.5in;"> k ← k + 1</div><div class="MsoNormal" style="margin-left: 0.5in;">endwhile</div><div class="MsoNormal" style="margin-left: 0.5in;"><br />
</div><div class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;">b.<span style="font: 7pt "Times New Roman";"> </span>Repeat… until</div><div class="MsoNormal" style="margin-left: 0.5in;">Algorima hitung rata-rata :</div><div class="MsoNormal" style="margin-left: 0.5in;">{menghitung rata-rata N buah bilangan bulat yang dibaca dari piranti masukan}</div><div class="MsoNormal" style="margin-left: 0.5in;">Deklarasi :</div><div class="MsoNormal" style="margin-left: 0.5in;"> N : integer {jumlah data > 0}</div><div class="MsoNormal" style="margin-left: 0.5in;"> x : integer {bil. bulat yang dibaca dari papan kunci}</div><div class="MsoNormal" style="margin-left: 0.5in;"> k : integer {pencacah banyaknya pengulangan}</div><div class="MsoNormal" style="margin-left: 0.5in;"> jumlah : integer {pencatat jumlah nilai}</div><div class="MsoNormal" style="margin-left: 0.5in;"> rerata : integer {rata-rata nilai}</div><div class="MsoNormal" style="margin-left: 0.5in;">Deskripsi :</div><div class="MsoNormal" style="margin-left: 0.5in;"> read (N)</div><div class="MsoNormal" style="margin-left: 0.5in;"> jumlah ← 0</div><div class="MsoNormal" style="margin-left: 0.5in;">repeat</div><div class="MsoNormal" style="margin-left: 0.5in;"> read (x)</div><div class="MsoNormal" style="margin-left: 0.5in;"> jumlah ← jumlah + x</div><div class="MsoNormal" style="margin-left: 0.5in;"> k ← k + 1</div><div class="MsoNormal" style="margin-left: 0.5in;">until k > N</div><div class="MsoNormal" style="margin-left: 0.5in;">rerata ← jumlah/N</div><div class="MsoNormal" style="margin-left: 0.5in;">write (rerata)</div><div class="MsoNormal" style="margin-left: 0.5in;"><br />
</div><div class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;">c.<span style="font: 7pt "Times New Roman";"> </span>For.. end for</div><div class="MsoNormal" style="margin-left: 0.5in;">Algoritma cetak kalimat :</div><div class="MsoNormal" style="margin-left: 0.5in;">{mencetak kalimat “C++ dan pascal” sebanyak 5 kali ke piranti keluaran}</div><div class="MsoNormal" style="margin-left: 0.5in;">Deklarasi :</div><div class="MsoNormal" style="margin-left: 0.5in;"> k : integer</div><div class="MsoNormal" style="margin-left: 0.5in;">Deskripsi :</div><div class="MsoNormal" style="margin-left: 0.5in;">for ← k to 5 do</div><div class="MsoNormal" style="margin-left: 0.5in;"> write (‘C++ dan Pascal’)</div><div class="MsoNormal" style="margin-left: 0.5in;">endfor</div><div class="MsoNormal" style="margin-left: 0.5in;"></div><div class="MsoNormal" style="margin-left: 0.5in;"></div><div class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"><span style="font: 7pt "Times New Roman";"></span>3. Dengan menggunakan perintah while… do… end while buatlah contoh algoritma dan flowchart nested loop.</div><div class="MsoNormal" style="margin-left: 0.25in;"><i>Jawab :</i></div><div class="MsoNormal" style="margin-left: 0.25in;">Algoritma menghitung rata-rata nilai yang diinputkan sebanyak N kali</div><div class="MsoNormal" style="margin-left: 0.25in;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="file:///C:/Documents%20and%20Settings/Dwi%20Handoko/My%20Documents/My%20Pictures/Untitled-1%20copy.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><br />
</a></div><div class="MsoNormal" style="margin-left: 0.25in;">USES CRT;</div><div class="MsoNormal" style="margin-left: 0.25in;"><span id="goog_1134298589"></span><span id="goog_1134298590"></span><a href="http://www.blogger.com/"></a>VAR</div><div class="MsoNormal" style="margin-left: 0.25in;"> JData,</div><div class="MsoNormal" style="margin-left: 0.25in;"> J, N : byte;</div><div class="MsoNormal" style="margin-left: 0.25in;"> TotN : integer;</div><div class="MsoNormal" style="margin-left: 0.25in;"> Rata : real;</div><div class="MsoNormal" style="margin-left: 0.25in;">BEGIN</div><div class="MsoNormal" style="margin-left: 0.25in;"> TotN := 0; Rata:= 0; J:= 1;</div><div class="MsoNormal" style="margin-left: 0.25in;"> write (‘Jumlah Data :’); Readln (JData);</div><div class="MsoNormal" style="margin-left: 0.25in;"> while J <= J Data do</div><div class="MsoNormal" style="margin-left: 0.25in;">BEGIN</div><div class="MsoNormal" style="margin-left: 0.25in;"></div><div class="MsoNormal" style="margin-left: 0.25in;"> write (‘Nilai ke ‘,J, ‘:’);</div><div class="MsoNormal" style="margin-left: 0.25in;"> readln(N);</div><div class="separator" style="clear: both; text-align: center;"></div><div class="MsoNormal" style="margin-left: 0.25in;"><div class="separator" style="clear: both; text-align: center;"></div> TotN :=TotN + N;</div><div class="MsoNormal" style="margin-left: 0.25in;"> inc(J);</div><div class="MsoNormal" style="margin-left: 0.25in;"> END;</div><div class="MsoNormal" style="margin-left: 0.25in;"> Rata :=TotN + N;</div><div class="MsoNormal" style="margin-left: 0.25in;"> write (‘Nilai Rata-rata : ‘, Rata :3:0);</div><div class="MsoNormal" style="margin-left: 0.25in;">END</div><div class="MsoNormal" style="margin-left: 0.25in;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj2ZJUdqahH6XpAUKLOJVNthVCgs57IaCEqXS4gi5IyjfhjGax3a-OFZ_D-uYVAVcJu2_wTT39CqMMr6EovdqnY-JMDyi01whdlJanTefxlTTBklqHmFbPD7BN_peQU74DiZHySMYOST8/s1600/Untitled-1+copy.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj2ZJUdqahH6XpAUKLOJVNthVCgs57IaCEqXS4gi5IyjfhjGax3a-OFZ_D-uYVAVcJu2_wTT39CqMMr6EovdqnY-JMDyi01whdlJanTefxlTTBklqHmFbPD7BN_peQU74DiZHySMYOST8/s320/Untitled-1+copy.jpg" width="298" /></a> <br />
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"></div></div><div class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;">4. Dengan perintah for…end for, buatlah algoritma dan flowchart nested loop.</div><div class="MsoNormal" style="margin-left: 0.25in;"><i>Jawab :</i></div><div class="MsoNormal" style="margin-left: 0.25in;">Algoritma mendapatkan nilai maksimal dari sejumlah nilai ujian</div><div class="MsoNormal" style="margin-left: 0.25in;">for i=1 → 10</div><div class="MsoNormal" style="margin-left: 0.25in;">input nilai [i]</div><div class="MsoNormal" style="margin-left: 0.25in;">end for</div><div class="MsoNormal" style="margin-left: 0.25in;">max ← nilai [1]</div><div class="MsoNormal" style="margin-left: 0.25in;">for j=2 → 10</div><div class="MsoNormal" style="margin-left: 0.25in;">if (nilai[j] > max)</div><div class="MsoNormal" style="margin-left: 0.25in;">max = nilai[j]</div><div class="MsoNormal" style="margin-left: 0.25in;">endif</div><div class="MsoNormal" style="margin-left: 0.25in;">endfor</div><div class="MsoNormal" style="margin-left: 0.25in;">print max</div><div class="MsoNormal" style="margin-left: 0.25in;"><br />
</div><div class="MsoNormal" style="margin-left: 0.25in;"><br />
</div>Wahyudihttp://www.blogger.com/profile/18000311052880630427noreply@blogger.com0tag:blogger.com,1999:blog-3518743174638712361.post-30596278966494803382010-10-18T05:53:00.001-07:002010-10-18T05:53:15.554-07:00Tugas Logika & Algoritma Pertemuan 3<meta content="text/html; charset=utf-8" http-equiv="Content-Type"></meta><meta content="Word.Document" name="ProgId"></meta><meta content="Microsoft Word 11" name="Generator"></meta><meta content="Microsoft Word 11" name="Originator"></meta><link href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"></link><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--><style>
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;
mso-font-charset:2;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:0 268435456 0 0 -2147483648 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
h3
{mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
mso-pagination:widow-orphan;
mso-outline-level:3;
font-size:13.5pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:#FF9600;
mso-text-animation:none;
text-decoration:none;
text-underline:none;
text-decoration:none;
text-line-through:none;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;
text-underline:single;}
span.nw
{mso-style-name:nw;}
span.ff1
{mso-style-name:ff1;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:17850224;
mso-list-type:hybrid;
mso-list-template-ids:-170873184 67698703 -1157587274 -1476213062 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level2
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:-;
mso-level-tab-stop:72.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";
mso-ansi-font-weight:bold;}
@list l0:level3
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:117.0pt;
mso-level-number-position:left;
margin-left:117.0pt;
text-indent:-18.0pt;}
@list l1
{mso-list-id:235361879;
mso-list-type:hybrid;
mso-list-template-ids:758803918 67698691 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l1:level1
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:54.0pt;
mso-level-number-position:left;
margin-left:54.0pt;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l2
{mso-list-id:1898393329;
mso-list-type:hybrid;
mso-list-template-ids:429316294 -1476213062 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l2:level1
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:117.0pt;
mso-level-number-position:left;
margin-left:117.0pt;
text-indent:-18.0pt;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style><!--[if gte mso 10]> <style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style> <![endif]--> <br />
<h3 style="margin: 0cm 0cm 0.0001pt;"><span style="font-size: 12pt;"><o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt;"><span style="font-size: 12pt;">KONSEP TIPE DATA<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt;"><span style="font-size: 12pt;"><o:p> </o:p></span></h3><h3 style="line-height: 150%; margin: 0cm 0cm 0.0001pt 18pt; text-indent: -18pt;"><!--[if !supportLists]--><span style="font-size: 12pt; font-weight: normal; line-height: 150%;"><span>1.<span style="font-family: "Times New Roman"; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><!--[endif]--><span style="font-size: 12pt; font-weight: normal; line-height: 150%;">Sebutkan tipe data apa saja yang bisa digunakan dalam pemrograman Pascal.<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 18pt;"><i><span style="font-size: 12pt; font-weight: normal;">Jawab :<o:p></o:p></span></i></h3><h3 style="margin: 0cm 0cm 0.0001pt 18pt;"><span style="font-size: 12pt; font-weight: normal;">Tipe data Char, String, Boolean, Integer, Real, Subrange, Array, Record, Array Record<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 18pt;"><span style="font-size: 12pt; font-weight: normal;"><o:p> </o:p></span></h3><h3 style="line-height: 150%; margin: 0cm 0cm 0.0001pt 18pt; text-indent: -18pt;"><!--[if !supportLists]--><span style="font-size: 12pt; font-weight: normal; line-height: 150%;"><span>2.<span style="font-family: "Times New Roman"; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><!--[endif]--><span style="font-size: 12pt; font-weight: normal; line-height: 150%;">Sebutkan perintah 5 perintah Operasi String dan berikan contohnya<o:p></o:p></span></h3><h3 style="line-height: 150%; margin: 0cm 0cm 0.0001pt 18pt;"><i><span style="font-size: 12pt; font-weight: normal; line-height: 150%;">Jawab :<o:p></o:p></span></i></h3><h3 style="margin: 0cm 0cm 0.0001pt 90pt; text-indent: -72pt;"><!--[if !supportLists]--><span style="font-size: 12pt; font-weight: normal;"><span>-<span style="font-family: "Times New Roman"; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><!--[endif]--><span style="font-size: 12pt;">length </span><span style="font-size: 12pt; font-weight: normal;"><span> </span>: <span> </span>merupakan operasi untuk panjang suatu data.<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 90pt; text-indent: -54pt;"><span style="font-size: 12pt; font-weight: normal;">contoh <span> </span>: <span> </span>S1='Manajemen'<br />
S2='Manajemen Informatika'<br />
length(S1) = 9<br />
length(S2) = 28<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 18pt;"><span style="font-size: 6pt; font-weight: normal;"><o:p> </o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 90pt; text-indent: -72pt;"><!--[if !supportLists]--><span style="font-size: 12pt; font-weight: normal;"><span>-<span style="font-family: "Times New Roman"; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><!--[endif]--><span style="font-size: 12pt;">substr </span><span style="font-size: 12pt; font-weight: normal;"><span> </span>: <span> </span>merupakan sub string dimana operasi mengambil banyaknya huruf pada suatu data sesuai perintah.<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 90pt; text-indent: -54pt;"><span style="font-size: 12pt; font-weight: normal;">contoh <span> </span>:<span> </span>S1='Sistem'<br />
S2='Manajemen Informasi'<br />
substr (S1,4,3) = tem<br />
substr (S2,11,4) = info<br />
Pembacaan perintah :<br />
substr (S1,4,3) = pada data S1, mengambil huruf ke 4 pada data S1, sebanyak 3 huruf<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 90pt; text-indent: -72pt;"><!--[if !supportLists]--><span style="font-size: 12pt; font-weight: normal;"><span>-<span style="font-family: "Times New Roman"; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><!--[endif]--><span style="font-size: 12pt;">concat</span><span style="font-size: 12pt; font-weight: normal;"> <span> </span>: <span> </span>merupakan operasi untuk menggabungkan suatu data dengan data yang lain.<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 90pt; text-indent: -54pt;"><span style="font-size: 12pt; font-weight: normal;">contoh <span> </span>: <span> </span>S1='sistem'<br />
S2='manajemen'<br />
S3='informatika'<br />
concat (S1,S2) = sistemmanajemen<br />
concat (S2,S3) = manajemeninformatika<br />
concat (S1,S2,S3) = sistemmanajemeninformatika<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 90pt; text-indent: -72pt;"><!--[if !supportLists]--><span style="font-size: 12pt; font-weight: normal;"><span>-<span style="font-family: "Times New Roman"; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><!--[endif]--><span style="font-size: 12pt;">insert</span><span style="font-size: 12pt; font-weight: normal;"> <span> </span>: <span> </span>merupakan menyisipkan suatu data pada data lain sesuai perintah.<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 90pt; text-indent: -54pt;"><span style="font-size: 12pt; font-weight: normal;">contoh <span> </span>:<span> </span>S1='sistem'<br />
S2='info'<br />
insert (S1,S2,4) = sisinfotem<br />
insert (S2,S1,4) = infsistemo<br />
<i>Pembacaan perintah :</i><br />
insert (S1,S2,4) = pada data S1, menyisipkan data S2 ke data S1, data S2 disisipkan pada huruf ke 4 di data S1 dan lanjutkan dengan huruf sisa dari data S1<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 90pt; text-indent: -72pt;"><!--[if !supportLists]--><span style="font-size: 12pt; font-weight: normal;"><span>-<span style="font-family: "Times New Roman"; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><!--[endif]--><span style="font-size: 12pt;">delete</span><span style="font-size: 12pt; font-weight: normal;"> <span> </span>: <span> </span>merupakan operasi untuk menghapus suatu data.<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 90pt; text-indent: -54pt;"><span style="font-size: 12pt; font-weight: normal;">contoh <span> </span>:<span> </span>S1='sistem'<br />
S2='informasi'<br />
delete (S1,4,3) = sis<br />
delete (S2,1,2) = formasi<br />
Pembacaan perintah :<br />
delete (S1,4,3) = pada pada data S1, mengambil huruf ke 4 dari data S1, hapus 3 huruf<br />
<!--[if !supportLineBreakNewLine]--><br />
<!--[endif]--><o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 18pt; text-indent: -18pt;"><!--[if !supportLists]--><span style="font-size: 12pt; font-weight: normal;"><span>3.<span style="font-family: "Times New Roman"; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><!--[endif]--><span style="font-size: 12pt; font-weight: normal;">Jelaskan pengertian<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 36pt; text-indent: -18pt;"><!--[if !supportLists]--><span style="font-size: 12pt; font-weight: normal;"><span>a.<span style="font-family: "Times New Roman"; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><!--[endif]--><span style="font-size: 12pt; font-weight: normal;">Array<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 36pt; text-indent: -18pt;"><!--[if !supportLists]--><span style="font-size: 12pt; font-weight: normal;"><span>b.<span style="font-family: "Times New Roman"; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><!--[endif]--><span style="font-size: 12pt; font-weight: normal;">Record<o:p></o:p></span></h3><h3 style="line-height: 150%; margin: 0cm 0cm 0.0001pt 36pt; text-indent: -18pt;"><!--[if !supportLists]--><span style="font-size: 12pt; font-weight: normal; line-height: 150%;"><span>c.<span style="font-family: "Times New Roman"; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><!--[endif]--><span style="font-size: 12pt; font-weight: normal; line-height: 150%;">File<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 18pt;"><i><span style="font-size: 12pt; font-weight: normal;">Jawab :<o:p></o:p></span></i></h3><h3 style="margin: 0cm 0cm 0.0001pt 36pt; text-indent: -18pt;"><!--[if !supportLists]--><span style="font-size: 12pt; font-weight: normal;"><span>a.<span style="font-family: "Times New Roman"; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><!--[endif]--><span style="font-size: 12pt; font-weight: normal;">Array (larik) merupakan tipe data tersetruktur dimana didalamnya terdiri dari komponen-komponen yang mempunyai tipe data yang sama. Didalam suatu larik atau array setiap kompoenen ditunjukan oleh suatu index yang unik. Index dari setiap komponen array menunjukan urutan data atau identitas yang mewakili data yang ada didalamnya.<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 36pt; text-indent: -18pt;"><!--[if !supportLists]--><span style="font-size: 12pt; font-weight: normal;"><span>b.<span style="font-family: "Times New Roman"; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><!--[endif]--><span style="font-size: 12pt; font-weight: normal;">Record dapat diartikan “merekam” atau “rekaman”. Dalam database disebut juga sebagai kumpulan identitas dari satu objek, atau kumpulan dari beberapa field tentang satu objek.<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 36pt; text-indent: -18pt;"><!--[if !supportLists]--><span style="font-size: 12pt; font-weight: normal;"><span>c.<span style="font-family: "Times New Roman"; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><!--[endif]--><span style="font-size: 12pt; font-weight: normal;">Arsip yang disimpan dalam <a href="http://www.total.or.id/info.php?kk=storage"><span style="color: windowtext;">suatu media</span></a>, yang terdiri dari kumpulan <a href="http://www.total.or.id/info.php?kk=character"><span style="color: windowtext;">karakter</span></a>, dan didokumentasikan dalam bentuk <a href="http://www.total.or.id/info.php?kk=digital%20data"><span style="color: windowtext;">data digital</span></a> oleh <a href="http://www.total.or.id/info.php?kk=computer"><span style="color: windowtext;">komputer</span></a>.<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt;"><span style="font-size: 12pt; font-weight: normal;"><o:p> </o:p></span></h3><h3 style="line-height: 150%; margin: 0cm 0cm 0.0001pt 18pt; text-indent: -18pt;"><!--[if !supportLists]--><span style="font-size: 12pt; font-weight: normal; line-height: 150%;"><span>4.<span style="font-family: "Times New Roman"; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><!--[endif]--><span style="font-size: 12pt; font-weight: normal; line-height: 150%;">Sebutkan penggunaan tipe data Boolean dalam pemrograman.<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 18pt;"><i><span style="font-size: 12pt; font-weight: normal;">Jawab :<o:p></o:p></span></i></h3><h3 style="margin: 0cm 0cm 0.0001pt 18pt;"><span style="font-size: 12pt; font-weight: normal;">Tipe data Boolean mempunyai dua nilai yaitu true (benar) dan false (salah), nilai Boolean sangat penting digunakan untuk pengambilan keputusan dalam suatu program.<o:p></o:p></span></h3><h3 style="line-height: 150%; margin: 0cm 0cm 0.0001pt 18pt;"><span style="font-size: 12pt; font-weight: normal; line-height: 150%;"><o:p> </o:p></span></h3><h3 style="line-height: 150%; margin: 0cm 0cm 0.0001pt 18pt; text-indent: -18pt;"><!--[if !supportLists]--><span style="font-size: 12pt; font-weight: normal; line-height: 150%;"><span>5.<span style="font-family: "Times New Roman"; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><!--[endif]--><span style="font-size: 12pt; font-weight: normal; line-height: 150%;">Jelaskan perbedaan tipe data Character dan String<o:p></o:p></span></h3><h3 style="line-height: 150%; margin: 0cm 0cm 0.0001pt 18pt;"><i><span style="font-size: 12pt; font-weight: normal; line-height: 150%;">Jawab :<o:p></o:p></span></i></h3><h3 style="margin: 0cm 0cm 0.0001pt 36pt; text-indent: -18pt;"><!--[if !supportLists]--><span style="font-family: "Courier New"; font-size: 12pt; font-weight: normal;"><span>o<span style="font-family: "Times New Roman"; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><!--[endif]--><span style="font-size: 12pt; font-weight: normal;">Character merupakan <a href="http://www.total.or.id/info.php?kk=symbol"><span style="color: windowtext;">lambang</span></a>-lambang yang terdiri dari huruf, angka, serta lambang-lambang lainnya, dibentuk dari susunan <a href="http://www.total.or.id/info.php?kk=bit"><span style="color: windowtext;">bit</span></a>.<o:p></o:p></span></h3><h3 style="margin: 0cm 0cm 0.0001pt 36pt;"><span style="font-size: 12pt; font-weight: normal;">Sebagai contoh, berapa jumlah karakter "aku r"? Tentu jumlahnya adalah sama dengan 5 byte atau 5 karakter. karena spasi juga merupakan satu bentuk hasil simpanan data 1 byte, yang karakternya dilambangkan dengan spasi itu sendiri.<o:p></o:p></span></h3><div class="MsoNormal"><br />
</div><h3 style="margin: 0cm 0cm 0.0001pt 36pt; text-indent: -18pt;"><!--[if !supportLists]--><span style="font-family: "Courier New"; font-size: 12pt; font-weight: normal;"><span>o<span style="font-family: "Times New Roman"; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span></span></span><!--[endif]--><span style="font-size: 12pt; font-weight: normal;">String adalah sederetan karakter yang disusun dengan urutan tertentu. <o:p></o:p></span></h3><div class="MsoNormal" style="margin-left: 36pt;">Di dalam tipe memori, string ini diartikan sebagai data yang berisi satu atau sekumpulan karakter. <span class="nw">Dengan tipe data string kita bisa menyimpan sebuah kata seperti “</span><span class="ff1">bintang</span><span class="nw">”,</span> <span class="nw">sebuah kalimat seperti “</span><span class="ff1">aku suka makan</span><span class="nw">” atau</span> <span class="nw">deretan simbol-simbol seperti kode “. . . _ _ _ . . .”</span> </div>Wahyudihttp://www.blogger.com/profile/18000311052880630427noreply@blogger.com0tag:blogger.com,1999:blog-3518743174638712361.post-53287066787606577002010-10-11T04:32:00.000-07:002010-10-11T04:36:25.894-07:00Tugas Logika & Algoritma Pertemuan 2<div class="MsoNormal" style="margin: 0cm 0cm 0pt;"><b style="mso-bidi-font-weight: normal;"><span style="color: yellow;">PERTEMUAN 2</span></b></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt;"><b style="mso-bidi-font-weight: normal;"><span style="color: yellow;">KONSEP ALGORITMA</span></b></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt;"><br />
</div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt; mso-list: l2 level1 lfo1; tab-stops: list 18.0pt; text-indent: -18pt;"><span style="color: yellow;"><span style="mso-list: Ignore;">1.<span style="font: 7pt "Times New Roman";"> </span></span>Jelaskan Pengertian :</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 36pt; mso-list: l2 level2 lfo1; tab-stops: list 36.0pt; text-indent: -18pt;"><span style="color: yellow;"><span style="mso-list: Ignore;">a.<span style="font: 7pt "Times New Roman";"> </span></span>Variabel Peubah</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 36pt; mso-list: l2 level2 lfo1; tab-stops: list 36.0pt; text-indent: -18pt;"><span style="color: yellow;"><span style="mso-list: Ignore;">b.<span style="font: 7pt "Times New Roman";"> </span></span>Variabel Konstanta </span></div><div class="MsoNormal" style="line-height: 150%; margin: 0cm 0cm 0pt 36pt; mso-list: l2 level2 lfo1; tab-stops: list 36.0pt; text-indent: -18pt;"><span style="color: yellow;"><span style="mso-list: Ignore;">c.<span style="font: 7pt "Times New Roman";"> </span></span>Variabel Terkini </span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt;"><i style="mso-bidi-font-style: normal;"><span style="color: yellow;">Jawab :</span></i></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo3; tab-stops: list 36.0pt; text-indent: -18pt;"><span style="color: yellow;"><span style="mso-list: Ignore;">a.<span style="font: 7pt "Times New Roman";"> </span></span>Variabel Peubah</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 36pt;"><span style="color: yellow;">Merupakan variabel yang nilainya bukan konstanta / dapat berubah-ubah (tidak tetap) sesuai dengan kondisi variabel terkini. </span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo3; tab-stops: list 36.0pt; text-indent: -18pt;"><span style="color: yellow;"><span style="mso-list: Ignore;">b.<span style="font: 7pt "Times New Roman";"> </span></span>Variabel Konstanta </span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 36pt;"><span style="color: yellow;">Merupakan variabel yang tidak dapat berubah nilainya dan memiliki nilai yang sama/tetap dalam proses.</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo3; tab-stops: list 36.0pt; text-indent: -18pt;"><span style="color: yellow;"><span style="mso-list: Ignore;">c.<span style="font: 7pt "Times New Roman";"> </span></span>Variabel Terkini </span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 36pt;"><span style="color: yellow;">Merupakan variabel yang didapat dari hasil proses pertukaran </span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt;"><br />
</div><div class="MsoNormal" style="margin: 0cm 0cm 0pt;"><br />
</div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt; mso-list: l2 level1 lfo1; tab-stops: list 18.0pt; text-indent: -18pt;"><span style="color: yellow;"><span style="mso-list: Ignore;">2.<span style="font: 7pt "Times New Roman";"> </span></span>A=100, B=200, C=300. Berikan perintah agar nilai A, B, dan C saling bertukar.</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt;"><i style="mso-bidi-font-style: normal;"><span style="color: yellow;">Jawab :</span></i></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt;"><span style="color: yellow;">Diberikan algoritma : A=B, B=C, C=A, maka nilai A=200, B=300 dan C=100.</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt;"><br />
</div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt; mso-list: l2 level1 lfo1; tab-stops: list 18.0pt; text-indent: -18pt;"><span style="color: yellow;"><span style="mso-list: Ignore;">3.<span style="font: 7pt "Times New Roman";"> </span></span>Diketahui Algoritma:</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt;"><span style="color: yellow;">X = 5, Y = 20, Z = 40</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt;"><span style="color: yellow;">A = X + Y + Z</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt;"><span style="color: yellow;">X = Z – Y </span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt;"><span style="color: yellow;">Z = X + Y</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt;"><span style="color: yellow;">Y = X – Z </span></div><div class="MsoNormal" style="line-height: 150%; margin: 0cm 0cm 0pt 18pt;"><span style="color: yellow;">Berapakah nilai terkini dari A, X, Y, Z?</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt;"><i style="mso-bidi-font-style: normal;"><span style="color: yellow;">Jawab :</span></i></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt;"><span style="color: yellow;">X = 5, Y = 20, Z = 40</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt;"><span style="color: yellow;">A = 5 + 20 + 40 = 60</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt;"><span style="color: yellow;">X = 40 – 20 = 20 </span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt;"><span style="color: yellow;">Z = 20 + 20 = 40</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt;"><span style="color: yellow;">Y = 20 – 40 = -20 </span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt;"><span style="color: yellow;">Jadi Nilai terkini A = 60, X = 20, Y = -20, dan Z = 40</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt;"><br />
</div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt; mso-list: l2 level1 lfo1; tab-stops: list 18.0pt; text-indent: -18pt;"><span style="color: yellow;"><span style="mso-list: Ignore;">4.<span style="font: 7pt "Times New Roman";"> </span></span>Sebutkan perintah berikut dalam pemrograman Pascal</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 36pt; mso-list: l2 level2 lfo1; tab-stops: list 36.0pt; text-indent: -18pt;"><span style="color: yellow;"><span style="mso-list: Ignore;">a.<span style="font: 7pt "Times New Roman";"> </span></span>Memasukkan data / Input data </span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 36pt; mso-list: l2 level2 lfo1; tab-stops: list 36.0pt; text-indent: -18pt;"><span style="color: yellow;"><span style="mso-list: Ignore;">b.<span style="font: 7pt "Times New Roman";"> </span></span>Mencetak dalam satu baris</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 36pt; mso-list: l2 level2 lfo1; tab-stops: list 36.0pt; text-indent: -18pt;"><span style="color: yellow;"><span style="mso-list: Ignore;">c.<span style="font: 7pt "Times New Roman";"> </span></span>Mencetak pada lain baris</span></div><div class="MsoNormal" style="line-height: 150%; margin: 0cm 0cm 0pt 36pt; mso-list: l2 level2 lfo1; tab-stops: list 36.0pt; text-indent: -18pt;"><span style="color: yellow;"><span style="mso-list: Ignore;">d.<span style="font: 7pt "Times New Roman";"> </span></span>Mengawali dan mengakhiri program</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt;"><i style="mso-bidi-font-style: normal;"><span style="color: yellow;">Jawab :</span></i></div><ol style="margin-top: 0cm;" type="a"><li class="MsoNormal" style="margin: 0cm 0cm 0pt; mso-list: l1 level1 lfo2; tab-stops: list 36.0pt;"><span style="color: yellow;">Read / Readln</span></li>
<li class="MsoNormal" style="margin: 0cm 0cm 0pt; mso-list: l1 level1 lfo2; tab-stops: list 36.0pt;"><span style="color: yellow;">Write</span></li>
<li class="MsoNormal" style="margin: 0cm 0cm 0pt; mso-list: l1 level1 lfo2; tab-stops: list 36.0pt;"><span style="color: yellow;">Writeln</span></li>
<li class="MsoNormal" style="margin: 0cm 0cm 0pt; mso-list: l1 level1 lfo2; tab-stops: list 36.0pt;"><span style="color: yellow;">Begin & End.</span></li>
</ol>Wahyudihttp://www.blogger.com/profile/18000311052880630427noreply@blogger.com2tag:blogger.com,1999:blog-3518743174638712361.post-57358196379802632102010-10-10T20:15:00.000-07:002010-10-10T20:21:41.259-07:00Algoritma dan Pemrograman I<div class="MsoNormal" style="margin: 0cm 0cm 0pt;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US">Latihan Soal :</span></i></b></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt;"><br />
</div><div class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US">RENTAL DVD ALVATAR</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt;"><br />
</div><div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: windowtext 1pt solid; mso-border-top-alt: solid windowtext .5pt; mso-element: para-border-div; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 1pt;"><div class="MsoNormal" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin: 0cm 0cm 0pt; mso-border-top-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 0cm 0cm 0cm; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm; tab-stops: 135.0pt;"><span lang="EN-US">Input kode film <span style="mso-tab-count: 1;"> </span>:</span></div></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt; tab-stops: 135.0pt;"><span lang="EN-US">Input judul film <span style="mso-tab-count: 1;"> </span>:</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt; tab-stops: 135.0pt;"><span lang="EN-US">Input sutradara <span style="mso-tab-count: 1;"> </span>:</span></div><div class="MsoNormal" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin: 0cm 0cm 0pt; tab-stops: 135.0pt;"><span lang="EN-US">Input produksi <span style="mso-tab-count: 1;"> </span>:</span></div><div class="MsoNormal" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin: 0cm 0cm 0pt; tab-stops: 135.0pt;"><span lang="EN-US">Input tahun produksi <span style="mso-tab-count: 1;"> </span>:</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt; tab-stops: 135.0pt;"><span lang="EN-US">Input harga DVD <span style="mso-tab-count: 1;"> </span>:</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt; tab-stops: 135.0pt;"><span lang="EN-US">Input jumlah peminjaman <span style="mso-tab-count: 1;"> </span>:</span></div><div style="border-bottom: windowtext 1pt solid; border-left: medium none; border-right: medium none; border-top: windowtext 1pt solid; mso-border-bottom-alt: solid windowtext .75pt; mso-border-top-alt: solid windowtext .75pt; mso-element: para-border-div; padding-bottom: 1pt; padding-left: 0cm; padding-right: 0cm; padding-top: 1pt;"><div class="MsoNormal" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin: 0cm 0cm 0pt; mso-border-bottom-alt: solid windowtext .75pt; mso-border-top-alt: solid windowtext .75pt; mso-padding-alt: 1.0pt 0cm 1.0pt 0cm; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm;"><br />
</div></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt; tab-stops: 135.0pt;"><span lang="EN-US">Kode DVD <span style="mso-tab-count: 1;"> </span>:</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt; tab-stops: 135.0pt;"><span lang="EN-US">Judul film <span style="mso-tab-count: 1;"> </span>:</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt; tab-stops: 135.0pt;"><span lang="EN-US">Sutradara <span style="mso-tab-count: 1;"> </span>:</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt; tab-stops: 135.0pt;"><span lang="EN-US">Produksi <span style="mso-tab-count: 1;"> </span>:</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt; tab-stops: 135.0pt;"><span lang="EN-US">Tahun Produksi <span style="mso-tab-count: 1;"> </span>:</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt; tab-stops: 135.0pt;"><span lang="EN-US">Harga DVD <span style="mso-tab-count: 1;"> </span>:</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt; tab-stops: 135.0pt;"><span lang="EN-US">Jumlah peminjaman <span style="mso-tab-count: 1;"> </span>:</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt; tab-stops: 135.0pt;"><span lang="EN-US">Total Harga <span style="mso-tab-count: 1;"> </span>:</span></div><div class="MsoNormal" style="margin: 0cm 0cm 0pt;"><br />
</div><div class="MsoNormal" style="margin: 0cm 0cm 0pt;"><br />
</div><div class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US">Ketentuan : Total harga = Harga DVD x jumlah peminjaman</span></div><br />
<em><strong><u>Jawab :</u></strong></em><br />
<div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"></div><br />
<div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"></div><div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglYff5xsURWfZOws35mmKYq1Ti8EoZCyJiUgcrZEHLLgjpMV4BJ2EUyHQ10u1l5Gqpia8dO6MTbOE8Nmv4w931lXBqtWRnU49XZ56m9-KI7yqHUh6xTIw48_t2e4ur1AJtCy63oni_klQ/s1600/borland1.JPG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" ex="true" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglYff5xsURWfZOws35mmKYq1Ti8EoZCyJiUgcrZEHLLgjpMV4BJ2EUyHQ10u1l5Gqpia8dO6MTbOE8Nmv4w931lXBqtWRnU49XZ56m9-KI7yqHUh6xTIw48_t2e4ur1AJtCy63oni_klQ/s640/borland1.JPG" width="556" /></a></div><br />
<div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"></div><div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi89njMLB74DmZFRSJQIpAoE_2pMa1RujUe5cuFCTYrAxGoYEq3HNYIXEQdYPjrGT-MAWsaHGcAyO_rWwiWBnFZL-2R1tR4DdwkTmfOiMsdsPDVyWUGSfY1nPe6TDBkAdVc8MGfzV5Z0oU/s1600/borland2.JPG" imageanchor="1" style="clear: left; cssfloat: left; float: left; height: 339px; margin-bottom: 1em; margin-right: 1em; width: 441px;"><img border="0" ex="true" height="316" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi89njMLB74DmZFRSJQIpAoE_2pMa1RujUe5cuFCTYrAxGoYEq3HNYIXEQdYPjrGT-MAWsaHGcAyO_rWwiWBnFZL-2R1tR4DdwkTmfOiMsdsPDVyWUGSfY1nPe6TDBkAdVc8MGfzV5Z0oU/s400/borland2.JPG" width="400" /></a></div><br />
<div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"></div>Wahyudihttp://www.blogger.com/profile/18000311052880630427noreply@blogger.com1tag:blogger.com,1999:blog-3518743174638712361.post-17214990231151171482010-10-04T00:52:00.000-07:002010-10-04T00:52:32.229-07:00Tugas Algoritma Pertemuan 1<div class="MsoNormal" style="text-align: justify;"><b style="mso-bidi-font-weight: normal;">PERTEMUAN <span style="mso-spacerun: yes;"> </span>1<o:p></o:p></b></div><div class="MsoNormal" style="text-align: justify;"><b style="mso-bidi-font-weight: normal;">PENGERTIAN DASAR LOGIKA DAN ALGORITMA<o:p></o:p></b></div><div class="MsoNormal" style="text-align: justify;"><br />
</div><div class="MsoNormal" style="line-height: 150%; margin-left: .25in; mso-list: l3 level1 lfo1; tab-stops: list .25in; text-align: justify; text-indent: -.25in;"><span style="mso-list: Ignore;">1.<span style="font: 7.0pt "Times New Roman";"> </span></span>Jelaskan peranan algoritma dalam pembuatan program</div><div class="MsoNormal" style="line-height: 150%; margin-left: .25in; text-align: justify;"><i style="mso-bidi-font-style: normal;"><u>Jawab :<o:p></o:p></u></i></div><div style="line-height: 16.8pt; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 0in; text-align: justify;">Peranan algoritma dalam pembuatan program adalah terbentuknya rancangan-rancangan program yang terstruktur/berurutan dan berintegrasi dalam pengambilan keputusan untuk pemecahan masalah</div><div style="line-height: 16.8pt; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 0in; text-align: justify;"><br />
Peranan Algoritma buat program sangat besar, karena untuk membangun suatu program terlebih dahulu harus membuat algoritmanya lalu diterjemahkan kedalam bahasa-bahasa pemrograman misal : c++ atau pascal. </div><div style="line-height: 16.8pt; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 0in; text-align: justify;">Untuk program-program sederhana boleh saja kita tidak menuliskan algoritmanya, dengan kata lain langsung ditulis dalam bentuk kode program misal : turbo c++ tetapi tetap saja algoritma itu sendiri merupakan kerangka pemrograman.</div><div style="line-height: 16.8pt; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 0in; text-align: justify;"><br />
</div><div class="MsoNormal" style="margin-left: .25in; text-align: justify;"><br />
</div><div class="MsoNormal" style="line-height: 150%; margin-left: .25in; mso-list: l3 level1 lfo1; tab-stops: list .25in; text-align: justify; text-indent: -.25in;"><span style="mso-list: Ignore;">2.<span style="font: 7.0pt "Times New Roman";"> </span></span>Jelaskan pengertian pseudocode dan berikan contohnya</div><div class="MsoNormal" style="line-height: 150%; margin-left: .25in; text-align: justify;"><i style="mso-bidi-font-style: normal;"><u>Jawab :<o:p></o:p></u></i></div><div class="MsoNormal" style="margin-left: .25in; text-align: justify;"><span class="apple-style-span">Pseudocode merupakan algoritma yang menggunakan bahasa sehari-hari, dan rancangan harus jelas dan terstruktur.<o:p></o:p></span></div><div class="MsoNormal" style="margin-left: .25in; text-align: justify;"><br />
</div><div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span class="apple-style-span">Contoh:<o:p></o:p></span></div><div class="MsoNormal" style="background: white; margin-left: .25in; text-align: justify;"><span style="color: black;">Algoritma untuk menghitung faktorial dari N.<o:p></o:p></span></div><div class="MsoNormal" style="margin-left: .5in; mso-list: l2 level2 lfo4; tab-stops: list .5in; text-align: justify; text-indent: -.25in;"><span style="font-family: "Courier New"; mso-bidi-font-style: italic; mso-fareast-font-family: "Courier New";"><span style="mso-list: Ignore;">o<span style="font: 7.0pt "Times New Roman";"> </span></span></span><i>iTampung=1<o:p></o:p></i></div><div class="MsoNormal" style="margin-left: .5in; mso-list: l2 level2 lfo4; tab-stops: list .5in; text-align: justify; text-indent: -.25in;"><span style="font-family: "Courier New"; mso-bidi-font-style: italic; mso-fareast-font-family: "Courier New";"><span style="mso-list: Ignore;">o<span style="font: 7.0pt "Times New Roman";"> </span></span></span><i>for i=1 to N do<o:p></o:p></i></div><div class="MsoNormal" style="margin-left: .5in; mso-list: l2 level2 lfo4; tab-stops: list .5in; text-align: justify; text-indent: -.25in;"><span style="font-family: "Courier New"; mso-bidi-font-style: italic; mso-fareast-font-family: "Courier New";"><span style="mso-list: Ignore;">o<span style="font: 7.0pt "Times New Roman";"> </span></span></span><i>iTampung=iTampung*i<o:p></o:p></i></div><div class="MsoNormal" style="margin-left: .5in; mso-list: l2 level2 lfo4; tab-stops: list .5in; text-align: justify; text-indent: -.25in;"><span style="font-family: "Courier New"; mso-bidi-font-style: italic; mso-fareast-font-family: "Courier New";"><span style="mso-list: Ignore;">o<span style="font: 7.0pt "Times New Roman";"> </span></span></span><i>end for<o:p></o:p></i></div><div class="MsoNormal" style="margin-left: .5in; mso-list: l2 level2 lfo4; tab-stops: list .5in; text-align: justify; text-indent: -.25in;"><span style="font-family: "Courier New"; mso-bidi-font-style: italic; mso-fareast-font-family: "Courier New";"><span style="mso-list: Ignore;">o<span style="font: 7.0pt "Times New Roman";"> </span></span></span><i>display ”Faktorial dari ”,N,” adalah ”,iTampung,NL<o:p></o:p></i></div><div class="MsoNormal" style="margin-left: .5in; text-align: justify;"><br />
</div><div class="MsoNormal" style="text-align: justify;"><br />
</div><div class="MsoNormal" style="line-height: 150%; margin-left: .25in; mso-list: l3 level1 lfo1; tab-stops: list .25in; text-align: justify; text-indent: -.25in;"><span style="mso-list: Ignore;">3.<span style="font: 7.0pt "Times New Roman";"> </span></span>Sebutkan langkah menguji sebuah Algoritma, Jelaskan !</div><div class="MsoNormal" style="line-height: 150%; margin-left: .25in; text-align: justify;"><i style="mso-bidi-font-style: normal;"><u>Jawab :<o:p></o:p></u></i></div><div class="MsoBodyTextIndent3" style="margin-left: .25in; text-align: justify;"><span lang="EN-GB" style="color: black; font-family: "Times New Roman";">Pengujian suatu program yang dilakukan dalam dua fase, yaitu :<o:p></o:p></span></div><div class="MsoNormal" style="line-height: 16.8pt; margin-left: .5in; mso-list: l3 level2 lfo1; tab-stops: list .5in; text-align: justify; text-indent: -.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7.0pt "Times New Roman";"> </span></span></span><strong>Fase Debugging</strong>, </div><div class="MsoNormal" style="line-height: 16.8pt; margin-left: .5in; text-align: justify;">Yaitu fase dari suatu proses program eksekusi yang akan melakukan koreksi terhadap kesalahan dalam bahasa pemrograman (logic & syntax).</div><div class="MsoNormal" style="line-height: 16.8pt; margin-left: .5in; tab-stops: .5in; text-align: justify;">Yang dimaksud adalah koreksi terhadap error atau kesalahan dalam penulisan program baik logika maupun sintaksnya.</div><div class="MsoNormal" style="line-height: 16.8pt; margin-left: 45.0pt; tab-stops: .5in; text-align: justify; text-indent: -9.0pt;"><br />
</div><div class="MsoNormal" style="line-height: 16.8pt; margin-left: .5in; mso-list: l3 level2 lfo1; tab-stops: list .5in; text-align: justify; text-indent: -.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7.0pt "Times New Roman";"> </span></span></span><strong>Fase Profilling</strong>, </div><div class="MsoNormal" style="line-height: 16.8pt; margin-left: .5in; text-align: justify;">Yaitu fase yang akan bekerja jika program tersebut sudah benar (telah melalui proses pada fase debugging). </div><div class="MsoNormal" style="line-height: 16.8pt; margin-left: .5in; text-align: justify;">Fase ini berfungsi untuk melihat dan mengukur waktu tempuh atau running time yang diperlukan serta jumlah memori/storage yang digunakan dalam menyelesaikan suatu algoritma.</div><div class="MsoNormal" style="margin-left: 45.0pt; tab-stops: .5in; text-align: justify; text-indent: -9.0pt;"><br />
</div><div class="MsoNormal" style="text-align: justify;"><br />
</div><div class="MsoNormal" style="margin-left: .25in; mso-list: l3 level1 lfo1; tab-stops: list .25in; text-align: justify; text-indent: -.25in;"><span style="mso-list: Ignore;">4.<span style="font: 7.0pt "Times New Roman";"> </span></span>Buat Algoritma bila seorang mahasiswa akan melakukan pembayaran uang kuliah via ATM</div><div class="MsoNormal" style="text-align: justify;"><br />
</div><div class="MsoNormal" style="line-height: 150%; margin-left: .25in; text-align: justify;"><i style="mso-bidi-font-style: normal;"><u>Jawab :<o:p></o:p></u></i></div><div class="MsoNormal" style="line-height: 150%; margin-left: .25in; text-align: justify;"><b style="mso-bidi-font-weight: normal;">Algoritma Pembayaran Kuliah Via ATM <o:p></o:p></b></div><ol start="1" style="margin-top: 0in;" type="1"><li class="MsoNormal" style="mso-list: l1 level1 lfo3; tab-stops: list .5in; text-align: justify;">Masukkan kartu ATM ke mesin ATM</li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo3; tab-stops: list .5in; text-align: justify;">Ketikkan kode PIN </li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo3; tab-stops: list .5in; text-align: justify;">Pilih Menu Pembayaran/Pemindahbukuan</li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo3; tab-stops: list .5in; text-align: justify;">Masukkan nomor rekening tujuan</li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo3; tab-stops: list .5in; text-align: justify;">Masukkan nomor induk mahasiswa</li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo3; tab-stops: list .5in; text-align: justify;">Isi jumlah uang yang akan ditransfer</li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo3; tab-stops: list .5in; text-align: justify;">Transaksi berhasil/selesai</li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo3; tab-stops: list .5in; text-align: justify;">Ambil kartu ATM.</li>
</ol><div class="MsoNormal" style="text-align: justify;"><br />
</div><div class="MsoNormal" style="text-align: justify;"><br />
</div><div class="MsoNormal" style="line-height: 150%; margin-left: .25in; mso-list: l3 level1 lfo1; tab-stops: list .25in; text-align: justify; text-indent: -.25in;"><span style="mso-list: Ignore;">5.<span style="font: 7.0pt "Times New Roman";"> </span></span>Sebutkan cara menyatakan Algoritma </div><div class="MsoNormal" style="line-height: 150%; margin-left: .25in; text-align: justify;"><i style="mso-bidi-font-style: normal;"><u>Jawab :<o:p></o:p></u></i></div><div class="MsoNormal" style="margin-left: .5in; mso-list: l0 level2 lfo2; tab-stops: list .5in; text-align: justify; text-indent: -.25in;"><span style="mso-list: Ignore;">-<span style="font: 7.0pt "Times New Roman";"> </span></span>Dengan bahasa semu (pseudocode).</div><div class="MsoNormal" style="margin-left: .5in; mso-list: l0 level2 lfo2; tab-stops: list .5in; text-align: justify; text-indent: -.25in;"><span style="mso-list: Ignore;">-<span style="font: 7.0pt "Times New Roman";"> </span></span>Dengan diagram alur atau flowchart.</div><div class="MsoNormal" style="margin-left: .5in; mso-list: l0 level2 lfo2; tab-stops: list .5in; text-align: justify; text-indent: -.25in;"><span style="mso-list: Ignore;">-<span style="font: 7.0pt "Times New Roman";"> </span></span>Dengan statement program/penanggalan program.</div><div class="MsoNormal" style="margin-left: .5in; text-align: justify;"><br />
</div><div class="MsoNormal" style="margin-left: .5in; text-align: justify;"><br />
</div><div class="MsoNormal" style="margin-left: .25in; text-align: justify;"><br />
</div>Wahyudihttp://www.blogger.com/profile/18000311052880630427noreply@blogger.com3tag:blogger.com,1999:blog-3518743174638712361.post-53152450485189468042010-10-02T02:02:00.000-07:002010-10-02T02:02:49.477-07:00Pseudocode Membeli Bensin Kendaraan Roda Dua Di SPBU<ol><li><div class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="IN" style="mso-ansi-language: IN;">Masuk ke dalam SPBU .</span></div></li>
<li class="MsoNormal" style="margin: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt;"><span lang="IN" style="mso-ansi-language: IN;">Antri ditempat yang ditentukan.</span></li>
<li class="MsoNormal" style="margin: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt;"><span lang="IN" style="mso-ansi-language: IN;">Matikan mesin kendaraan.</span></li>
<li class="MsoNormal" style="margin: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt;"><span lang="IN" style="mso-ansi-language: IN;">Buka jok kendaraan.</span></li>
<li class="MsoNormal" style="margin: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt;"><span lang="IN" style="mso-ansi-language: IN;">Buka tutup tangki bahan bakar.</span></li>
<li class="MsoNormal" style="margin: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt;"><span lang="IN" style="mso-ansi-language: IN;">Tentukan jumlah yang akan diisi.</span></li>
<li class="MsoNormal" style="margin: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt;"><span lang="IN" style="mso-ansi-language: IN;">Tunggu pengisian selesai.</span></li>
<li class="MsoNormal" style="margin: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt;"><span lang="IN" style="mso-ansi-language: IN;">Tutup kembali tutup tangki bahan bakar.</span></li>
<li class="MsoNormal" style="margin: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt;"><span lang="IN" style="mso-ansi-language: IN;">Tutup jok kendaraan.</span></li>
<li class="MsoNormal" style="margin: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt;"><span lang="IN" style="mso-ansi-language: IN;">Membayar ke petugas SPBU.</span></li>
<li class="MsoNormal" style="margin: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt;"><span lang="IN" style="mso-ansi-language: IN;">Selesai.</span></li>
</ol>Wahyudihttp://www.blogger.com/profile/18000311052880630427noreply@blogger.com0