<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>nhóm 1 - có làm mới có ăn- Java 13/10 by Hồ Hoàng Nam</title>
      <link>https://padlet.com/nambolo123/2b3p9rqtx9qh7smi</link>
      <description>lập trình Java</description>
      <language>en-us</language>
      <pubDate>2021-10-13 06:45:10 UTC</pubDate>
      <lastBuildDate>2026-02-12 06:35:24 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url></url>
      </image>
      <item>
         <title></title>
         <author>nambolo123</author>
         <link>https://padlet.com/nambolo123/2b3p9rqtx9qh7smi/wish/1813090716</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1361625126/0d6f60db6924d1af44b4719cf7f9f297/image.png" />
         <pubDate>2021-10-13 06:46:29 UTC</pubDate>
         <guid>https://padlet.com/nambolo123/2b3p9rqtx9qh7smi/wish/1813090716</guid>
      </item>
      <item>
         <title>Câu 3: Cấu trúc lặp for?</title>
         <author>3120220026</author>
         <link>https://padlet.com/nambolo123/2b3p9rqtx9qh7smi/wish/1813099288</link>
         <description><![CDATA[<div><strong>a. Cách sử dụng:</strong> để lặp một phần của chương trình nhiều lần. Với số lần lặp cố định.</div><div><strong>b. Vòng lặp for đơn giản:</strong></div><ul><li><strong>Cú pháp:</strong></li></ul><div><strong>for</strong> (khoi_tao_bien ; check_dieu_kien ; tang/giam_bien) { &nbsp;</div><div>&nbsp; &nbsp; // Khối lệnh được thực thi</div><div>}</div><ul><li><strong>Ví dụ:</strong></li></ul><div><strong>public</strong> <strong>class</strong> ForExample {</div><div>&nbsp; &nbsp; <strong>public</strong> <strong>static</strong> <strong>void</strong> main(String[] args) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; <strong>for</strong> (<strong>int</strong> i = 1; i &lt;= 10; i++) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(i);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>}</div><div><strong>c. Vòng lặp for cải tiến:</strong></div><ul><li><strong>Cú pháp:</strong></li></ul><div><strong>for</strong> (Type var : array) { &nbsp;</div><div>&nbsp; &nbsp; // Khối lệnh được thực thi</div><div>}&nbsp;</div><ul><li><strong>Ví dụ:</strong></li></ul><div><strong>public</strong> <strong>class</strong> ForEachExample {</div><div>&nbsp; &nbsp; <strong>public</strong> <strong>static</strong> <strong>void</strong> main(String[] args) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; <strong>int</strong> arr[] = { 12, 23, 44, 56, 78 };</div><div>&nbsp; &nbsp; &nbsp; &nbsp; <strong>for</strong> (<strong>int</strong> i : arr) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(i);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>}<br><strong>d. Vòng lặp for gán nhãn:</strong></div><ul><li><strong>Cú pháp:</strong></li></ul><div>ten_nhan:</div><div><strong>for</strong> (khoi_tao_bien ; check_dieu_kien ; tang/giam_bien) { &nbsp;</div><div>&nbsp; &nbsp; // Khối lệnh được thực thi</div><div>} &nbsp;</div><ul><li><strong>Ví dụ:</strong></li></ul><div><strong>public</strong> <strong>class</strong> LabeledForExample {</div><div>&nbsp; &nbsp; <strong>public</strong> <strong>static</strong> <strong>void</strong> main(String[] args) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; aa: <strong>for</strong> (<strong>int</strong> i = 1; i &lt;= 3; i++) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bb: <strong>for</strong> (<strong>int</strong> j = 1; j &lt;= 3; j++) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <strong>if</strong> (i == 2 &amp;&amp; j == 2) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <strong>break</strong> aa;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(i + " " + j);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1361627839/6098a4ba9805d625793f0c370f49d6e4/vong_lap_for_trong_java.jpg" />
         <pubDate>2021-10-13 06:51:20 UTC</pubDate>
         <guid>https://padlet.com/nambolo123/2b3p9rqtx9qh7smi/wish/1813099288</guid>
      </item>
      <item>
         <title>Phân công :</title>
         <author>nambolo123</author>
         <link>https://padlet.com/nambolo123/2b3p9rqtx9qh7smi/wish/1813103660</link>
         <description><![CDATA[<div>1. Phan Quang Hiếu<br>2. Nguyễn Đinh Nguyễn Chương<br>3. Đỗ Vạn Phương Nam<br>4. Hồ Hoàng Nam<br>5. Cùng Làm<br>Đề tài: Quản lý tiền ngân hàng<br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-13 06:53:48 UTC</pubDate>
         <guid>https://padlet.com/nambolo123/2b3p9rqtx9qh7smi/wish/1813103660</guid>
      </item>
      <item>
         <title>Câu 4: Cấu trúc lặp While, Do While?</title>
         <author>nambolo123</author>
         <link>https://padlet.com/nambolo123/2b3p9rqtx9qh7smi/wish/1813129176</link>
         <description><![CDATA[<div><strong>a. Vòng lặp While:</strong></div><ul><li><strong>Cú pháp của While:</strong></li></ul><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <strong>while</strong>(điều kiện vòng lập){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;các dòng lệnh<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;};</div><ul><li><strong>Cách sử dụng:</strong> Vòng lập While được sữ dụng để thực hiện các câu lệnh có trong nó. Sau khi thực hiện các câu lệnh xong sẽ tự kiểm tra lại điều kiện vòng lập nếu true sẽ tiếp tục thực hiện vòng lập nếu false thì kết thúc.</li><li><strong>Ví dụ minh họa:</strong></li></ul><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<em>boolean </em>tinhtrangnotientrongnganhang = true;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; <em>float</em> tiennonganhang = 10000;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; <em>float</em> tientrongnganhang = 10000;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; while ((tinhtrangnotientrongnganhang == true) &amp;&amp; (tientrongnganhang &gt; 0))</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tiennonganhang -= tientrongnganhang;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tientrongnganhang -= tientrongnganhang;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><strong>b. Vòng lặp Do - While:</strong></div><ul><li><strong>Cú pháp của Do - While:</strong></li></ul><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <strong>do</strong>{<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;các dòng lệnh<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<strong>while</strong>(điều kiện vòng lập);</div><ul><li><strong>Cách dùng:</strong> Vòng lặp do-while trong java được sử dụng để lặp một phần của chương trình một vài lần. Tương tự như vòng lặp while, ngoại trừ do-while thực hiện lệnh ít nhất một lần ngay cả khi điều kiện là False.</li><li><strong>Ví dụ minh họa:</strong></li></ul><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;do{</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tiennonganhang = tiennonganhang - tientrongnganhang;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tiennonganhang -= tiennonganhang;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; } while ((tientrongnganhang &gt; 0) &amp;&amp; (tiennonganhang &gt; 0));</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1361625126/adb36d4e26660f9f8efcd51bdf2a848e/image.png" />
         <pubDate>2021-10-13 07:08:06 UTC</pubDate>
         <guid>https://padlet.com/nambolo123/2b3p9rqtx9qh7smi/wish/1813129176</guid>
      </item>
      <item>
         <title>Câu 5: Break, Conttinue?</title>
         <author>nambolo123</author>
         <link>https://padlet.com/nambolo123/2b3p9rqtx9qh7smi/wish/1813150969</link>
         <description><![CDATA[<div><strong>a. Break:</strong></div><ul><li>Cú pháp Break:</li></ul><div>&nbsp; &nbsp; while (điều kiện vòng lập){</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//các câu lệnh.</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;}</div><ul><li><strong>Cách sữ dụng:</strong> Từ khóa break trong java<strong> </strong>được sử dụng để dừng thực thi lệnh trong vòng lặp hoặc trong mệnh đề switch tại điều kiện đã được chỉ định. Đối với vòng lặp bên trong vòng lặp khác, thì nó chỉ stop vòng lặp bên trong đó.</li><li><strong>Ví dụ minh họa:</strong></li><li><strong><em>Sử dụng break với vòng lặp for:</em></strong></li></ul><div>public class DemoJava {</div><div>&nbsp; &nbsp; public static void main(String[] args) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; int i;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;for (i=0;i&lt;10;i++){</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (i==5)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp; &nbsp; &nbsp; &nbsp;System.out.println(i);</div><div>&nbsp; &nbsp; }</div><div>}</div><div><strong>b. Conttinue:</strong></div><ul><li><strong>Cú pháp Continue:</strong></li></ul><div>&nbsp; &nbsp; while (điều kiện vòng lập){</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//các câu lệnh.</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;continue;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//Các câu lệnh</div><div>&nbsp; &nbsp; &nbsp; &nbsp;}</div><ul><li><strong>Cách sữ dụng:</strong> Từ khóa continue trong java được sử dụng để tiếp tục vòng lặp tại điều kiện đã được xác định. Với điều kiện đó khối lệnh phía sau từ khóa continue sẽ không được thực thi. Đối với vòng lặp bên trong một vòng lặp khác, continue chỉ có tác dụng với vòng lặp bên trong đó.</li><li><strong>Ví dụ minh họa:</strong></li><li><strong><em>Dùng từ khóa continue trong vòng lặp for:</em></strong></li></ul><div>public class DemoJava {</div><div>&nbsp; &nbsp; public static void main(String[] args) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; for (int i=1;i&lt;10;i++){</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (i%2==0)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(i);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>}</div><div><br>Từ khóa break trong jav</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1361625126/cf2a1ea7e8b1f155f04a3f0aa0c87c3f/image.png" />
         <pubDate>2021-10-13 07:20:27 UTC</pubDate>
         <guid>https://padlet.com/nambolo123/2b3p9rqtx9qh7smi/wish/1813150969</guid>
      </item>
      <item>
         <title>Câu 2: Cấu trúc Switch .. Case?</title>
         <author>nguyenchuong22062002</author>
         <link>https://padlet.com/nambolo123/2b3p9rqtx9qh7smi/wish/1813158711</link>
         <description><![CDATA[<div><strong>1. Cú pháp cấu trúc switch case trong Java:<br></strong>// variable: Một biến để kiểm tra.</div><div>switch ( variable ) {</div><div>&nbsp; &nbsp; case&nbsp; value1:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; // Làm gì đó tại đây ...</div><div>&nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>&nbsp; &nbsp; case&nbsp; value2:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; // Làm gì đó tại đây ...</div><div>&nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>&nbsp; &nbsp; default:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; // Làm gì đó tại đây ...</div><div>}<br><strong>2. Sau đây là ví dụ sử dụng Switch ...Case trong Đề tài : quản lý tiền bạc Ngân hàng:</strong></div><div>public class SwitchCase {</div><div>&nbsp; &nbsp; public static void main(String[] args) {</div><div>&nbsp; &nbsp; Scanner&nbsp; sc = new Scanner(System.in); &nbsp;</div><div>&nbsp; &nbsp; int&nbsp; number&nbsp; = sc.nextInt();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; switch (number) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; case 1:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là số&nbsp; tiền&nbsp; trong tài khoản của khách&nbsp; hàng 1);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; case 2:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là số&nbsp; tiền&nbsp; trong tài khoản của khách&nbsp; hàng 2");<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; case 3:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là số&nbsp; tiền&nbsp; trong tài khoản của khách&nbsp; hàng&nbsp; 3");<br>&nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; case 4:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là số tiền trong tài khoản của khách&nbsp; hàng 4");<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; case 5:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là số&nbsp; tiền&nbsp; trong tài khoản của khách&nbsp; hàng&nbsp; 5");<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; default:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Cảm&nbsp; ơn đã sử dụng default");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>}</div><div>explain example :&nbsp;</div><ul><li><strong>Trường hợp #1: Có case thỏa mãn:</strong></li></ul><div>Ở đây mình cho biến number = 2. Như vậy khi switch chạy xuống case 2, nó thấy thỏa mãn giá trị của case bằng với giá trị của number đang giữ, khi đó nó sẽ thực thi khối lệnh trong case 2.<br>Ở đây là nó sẽ in ra màn hình dòng chữ “Đây là số&nbsp; tiền&nbsp; trong tài khoản của khách&nbsp; hàng 2”. Tiếp theo nó gặp lệnh break, lập tức nó sẽ thoát ra khỏi lệnh switch.</div><ul><li><strong>Trường hợp #2: Không có case nào thỏa mãn:</strong></li></ul><div>Giả sử cũng đoạn code trên, nhưng bạn thay biến number bằng 6 chẳng hạn, khi đó không có giá trị của case nào bằng với giá trị của number.<br>Vì vậy nó sẽ chạy khối default.<br>Ở đây nó sẽ in ra dòng chữ&nbsp; “Chạy vào khối default”&nbsp; và kết thúc lệnh switch.<br>Trong trường hợp mà không có khối default thì nó sẽ không in ra gì cả.</div><ul><li><strong>Trường hợp #3: Switch case không sử dụng break:</strong></li></ul><div>public class SwitchCase {</div><div>&nbsp; &nbsp; public static void main(String[] args) {</div><div>&nbsp; &nbsp; Scanner&nbsp; sc = new Scanner(System.in); &nbsp;</div><div>&nbsp; &nbsp; int&nbsp; number&nbsp; = sc.nextInt();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; switch (number) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; case 1:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là số&nbsp; tiền&nbsp; trong tài khoản của khách&nbsp; hàng 1);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; case 2:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là số&nbsp; tiền&nbsp; trong tài khoản của khách&nbsp; hàng 2");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; case 3:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là số&nbsp; tiền&nbsp; trong tài khoản của khách&nbsp; hàng&nbsp; 3");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; case 4:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là số tiền trong tài khoản của khách&nbsp; hàng 4");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; case 5:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là số&nbsp; tiền&nbsp; trong tài khoản của khách&nbsp; hàng&nbsp; 5");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; default:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Cảm&nbsp; ơn đã sử dụng default");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>}<br>Như mình đã nói ở trên, nếu case không có break thì nó sẽ thực hiện đến hết, khi không còn khối nào thì thôi.<br>Ví dụ ở đây mình cho number = 2. Thì đầu tiên gặp case 1, không thỏa mãn.<br>Chạy tiếp xuống case 2, lúc này nó sẽ chạy khối lệnh trong case 2, nhưng case 2 không có break, nó sẽ tiếp tục chạy xuống case 3, 4, 5 và default.</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1361642514/a2f9015bcb023bbc874cb2bf0151f110/image.png" />
         <pubDate>2021-10-13 07:24:41 UTC</pubDate>
         <guid>https://padlet.com/nambolo123/2b3p9rqtx9qh7smi/wish/1813158711</guid>
      </item>
      <item>
         <title>Câu 1: Cấu trúc điều kiện IF (các dạng đơn giản và phức tạp)?</title>
         <author>phanhieuu0209</author>
         <link>https://padlet.com/nambolo123/2b3p9rqtx9qh7smi/wish/1813200689</link>
         <description><![CDATA[<div><strong>a. Mệnh đề if:</strong></div><ul><li><strong>Cú pháp:&nbsp;</strong></li></ul><div>if (condition) {</div><div>&nbsp; &nbsp; // do something</div><div>}</div><ul><li><strong>Ví dụ :</strong></li></ul><div>public class Main {<br>&nbsp; &nbsp; public static void main(String[] args) {<br>&nbsp; &nbsp; &nbsp; &nbsp; int a = 10;<br>&nbsp; &nbsp; &nbsp; &nbsp; if (a = 5 ) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Số Dư tài khoản là 5");<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; }<br>}</div><div><strong>b. Mệnh đề if lồng nhau:</strong></div><ul><li><strong>Cú pháp:</strong></li></ul><div>if(condition_1) {<br>// do something<br>&nbsp;if(condition_2) {</div><div>// do something<br>&nbsp; }<br>}</div><ul><li><strong>Ví dụ:</strong></li></ul><div>public class Test {<br>&nbsp; &nbsp;public static void main(String args[]){<br>&nbsp; &nbsp; &nbsp; int x = 30;<br>&nbsp; &nbsp; &nbsp; int y = 10;<br>&nbsp; &nbsp; &nbsp; if( x == 30 ){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if( y == 10 ){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.out.print("X = 30 va Y = 10");<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; &nbsp; }<br>}</div><div><strong>c. Mệnh đề if – else</strong><br>-cú pháp: <strong><br></strong>if (condition) {</div><div>&nbsp; &nbsp; // do something</div><div>} <strong>else</strong> {</div><div>&nbsp; &nbsp; // do something</div><div>}</div><ul><li><strong>Ví dụ:</strong></li></ul><div>&nbsp; &nbsp; public double napTien() {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; double nap;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.print("Nhập số tiền bạn cần nạp: ");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; nap = sc.nextDouble();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if (nap &gt;= 0) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; soTienTrongTK = nap + soTienTrongTK;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NumberFormat currencyEN = NumberFormat.getCurrencyInstance();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String str1 = currencyEN.format(nap);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("bạn vừa nạp " + str1 + " vào tài khoản.");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; } else {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Số tiền nạp vào không hợp lệ!");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return nap;</div><div>&nbsp; &nbsp; }</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1401612320/634e7deb881e50f1d56b7df4ebe3e636/download.jfif" />
         <pubDate>2021-10-13 07:47:23 UTC</pubDate>
         <guid>https://padlet.com/nambolo123/2b3p9rqtx9qh7smi/wish/1813200689</guid>
      </item>
   </channel>
</rss>
