<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>Nhóm 9 - CE Java - Java 13/10 by </title>
      <link>https://padlet.com/nhatmy159/java1310</link>
      <description></description>
      <language>en-us</language>
      <pubDate>2021-10-13 06:43:44 UTC</pubDate>
      <lastBuildDate>2025-04-26 14:25:23 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url></url>
      </image>
      <item>
         <title>Dự án: Quản lý thông tin bệnh nhân</title>
         <author>nhatmy159</author>
         <link>https://padlet.com/nhatmy159/java1310/wish/1813107887</link>
         <description><![CDATA[<div>Phân chia công việc:<br>Câu 1: Thanh Hoa&nbsp;<br>Câu 2: Quỳnh Châu<br>Câu 3: Như Anh<br>Câu 4: Nhật My<br>Câu 5: Minh Nhật</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1361626468/35175fddae70f57fb31691d06b4ee5b2/quan_ly_cong_viec.png" />
         <pubDate>2021-10-13 06:56:03 UTC</pubDate>
         <guid>https://padlet.com/nhatmy159/java1310/wish/1813107887</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>3120220223</author>
         <link>https://padlet.com/nhatmy159/java1310/wish/1813129504</link>
         <description><![CDATA[<div>&nbsp;<strong>Có 4 loại câu lệnh if chính đó là: </strong><strong><em>if</em></strong>,<strong> if lồng nhau, </strong><strong><em>if else</em></strong>, <strong><em>if else if</em></strong><strong>, </strong>và ngoài ra còn có<strong>&nbsp; </strong><strong><em>?:( toán tử Tam nguyên)<br>&nbsp; &nbsp;CÂU LỆNH if: </em></strong>&nbsp;<em>thực hiện các tập lệnh được viết ở bên trong cặp dấu “{}” nếu thoả điều kiện. </em><strong><em><br></em></strong><em>* </em><strong>Cú pháp</strong> <strong>:</strong></div><pre><strong>if (biểu_thức_điều_kiện) 
{     các_câu_lệnh;     }</strong></pre><div>- <strong><em>biểu_thức_điều_kiện</em></strong> là một biểu thức trả về kết quả là 1 giá trị <strong><em>boolean</em></strong>. <br>- <strong><em>các_câu_lệnh</em></strong> sẽ được thực thi khi <strong><em>biểu_thức_điều_kiện</em></strong> trả về giá trị <strong><em>true</em></strong>.<br><strong>VD</strong> <strong>:</strong><br><em>Khaosat khaosat = new Khaosat(System.in);</em></div><div><em>System.out.println("Nhập số tuổi của bạn: ");</em></div><div><em>int tuoi = khaosat.nextInt();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</em></div><div><em>if (tuoi &lt; 18) <br>{&nbsp; &nbsp; System.out.printf("Bạn không được tiêm vacxin!");&nbsp; &nbsp; &nbsp;}<br></em>&nbsp;<strong>CÂU LỆNH IF LỒNG NHAU : </strong>Khi một câu ĐK nằm bên trong một câu ĐK khác thì ta gọi đó là câu điều kiện lồng.<br><strong>Cú pháp :</strong></div><div><em>if(condition_1)&nbsp;<br>{&nbsp; &nbsp; // do something</em></div><div><em>&nbsp; &nbsp;</em><strong><em>if</em></strong><em>(condition_2)&nbsp;<br>&nbsp; &nbsp; {&nbsp; &nbsp; &nbsp; // do something&nbsp; &nbsp; }</em></div><div><em>}</em></div><div><em>- Khi điều kiện </em><strong><em>condition_1</em></strong><em> thoả, java sẽ thực hiện code bên trong thân mệnh đề if đầu tiên và sẽ kiểm tra tiếp điều kiện </em><strong><em>condition_2</em></strong><em> nếu điều kiện </em><strong><em>condition_2</em></strong><em> thoả sẽ tiếp tục thực hiện code bên trong mệnh đề if.</em></div><div><strong><em>VD: </em></strong><em><br>Cho một số thực a, kiểm tra nếu a &gt; 0.08 thì xuất ra “Lớn hơn 0.01" và tiếp tục kiểm tra nếu a &gt; 1.2 thì xuất ra “Dương tính”<br></em><br></div><div><em>public </em><strong><em>class</em></strong><em> Main <br>{&nbsp; &nbsp; public static </em><strong><em>void</em></strong><em> main(String[] args)&nbsp;<br>&nbsp; &nbsp; &nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; int a = 0.16;</em></div><div><em>&nbsp; &nbsp; &nbsp; &nbsp; </em><strong><em>if</em></strong><em> (a &gt; 0.08)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{&nbsp; &nbsp; &nbsp; System.out.println("Lớn hơn 0.01");</em></div><div><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</em><strong><em>if</em></strong><em> (a &gt; 1.2)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.out.println("Dương tính");&nbsp; &nbsp; &nbsp; &nbsp; } }</em> }}&nbsp;</div><div><strong>CÂU LỆNH if else</strong></div><div><strong>*</strong> <strong>Cú pháp :</strong></div><pre><strong>if (biểu_thức_điều_kiện) 
  {    các_câu_lệnh_1;   } 
else {   các_câu_lệnh_2;   }</strong></pre><div>- <strong><em>biểu_thức_điều_kiện</em></strong> trả về kết quả là 1 giá trị <strong><em>boolean</em></strong>. <br>- <strong><em>các_câu_lệnh_1</em></strong> được thực thi khi <strong><em>biểu_thức_điều_kiện</em></strong> là <strong><em>true</em></strong>. <br>- <strong><em>các_câu_lệnh_2</em></strong> sẽ được thực thi khi <strong><em>biểu_thức_điều_kiện</em></strong> là <strong><em>false</em></strong>.<br><strong>VD:</strong></div><div><strong>if</strong> (tuoi &lt; 18)<br>&nbsp; &nbsp; &nbsp;{&nbsp; &nbsp; System.out.printf("Bạn không thể tiêm vacxin!"); &nbsp; } <br><strong>else<br></strong>&nbsp; &nbsp; &nbsp;{&nbsp; &nbsp; System.out.printf("Bạn có thể tiêm vacxxin!");&nbsp; &nbsp; &nbsp; &nbsp; }<br><strong>CÂU LỆNH if else if </strong><strong><em>:</em></strong><em> Khi mệnh đề điều kiện của bạn có hơn 2 trường hợp thì bắt buộc chúng ta sẽ cần đến mệnh đề if – else – if&nbsp;</em></div><div><strong>* Cú pháp :</strong></div><pre><strong>if (biểu_thức_điều_kiện_1) 
   {  các_câu_lệnh_1;   } 
else if (biểu_thức_điều_kiện_2) 
   {  các_câu_lệnh_2;   } 
else 
   {  các_câu_lệnh_n;   }</strong></pre><div>Là dạng mở rộng của <strong><em>if else</em></strong>. <br><em>- </em><strong><em>biểu_thức_điều_kiện_1 </em></strong><em>trả về kết quả là giá trị </em><strong><em>boolean<br>-</em></strong><em> </em><strong><em>các_câu_lệnh_1</em></strong><em> được thực thi khi </em><strong><em>biểu_thức_điều_kiện_1</em></strong><em> là </em><strong><em>true</em></strong><em> nếu </em><strong><em>biểu_thức_điều_kiện_1</em></strong><em> trả về </em><strong><em>false</em></strong><em>, hệ thống sẽ kiểm tra tiếp </em><strong><em>biểu_thức_điều_kiện_2</em></strong><em>.<br>- </em><strong><em>các_câu_lệnh_2</em></strong><em> được thực thi khi </em><strong><em>biểu_thức_điều_kiện_2</em></strong><em> là </em><strong><em>true</em></strong><em>. Nếu </em><strong><em>bieu_thuc_dieu_kien_2</em></strong><em> trả về </em><strong><em>false</em></strong><em>, mọi thứ sẽ được kiểm tra tiếp tục… cho đến khi không còn thỏa bất kỳ </em><strong><em>biểu_thức_điều_kiện</em></strong><em> nào cả (không thằng nào trả về </em><strong><em>true</em></strong><em>) thì </em><strong><em>các_câu_lệnh_n</em></strong><em> sẽ được thực thi.</em><br><strong>VD :</strong></div><div><em>Khaosat khaosat = new Khaosat(System.in);</em></div><div><em>System.out.println("Vui lòng nhập ngày nhập viện trong tuần(1 là Thứ 2): ");</em></div><div><strong><em>int</em></strong><em> ngay = khaosat.nextInt();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</em></div><div><strong><em>if</em></strong><em> (ngay == 1)<br>&nbsp; &nbsp; &nbsp; {&nbsp; &nbsp; System.out.printf("Thứ 2");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} <br></em><strong><em>else</em></strong><em> </em><strong><em>if</em></strong><em> (ngay == 2) <br>&nbsp; &nbsp; &nbsp; {&nbsp; &nbsp; System.out.printf("Thứ 3");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} <br></em><strong><em>else</em></strong><em> </em><strong><em>if</em></strong><em> (ngay == 3)<br>&nbsp; &nbsp; &nbsp; {&nbsp; &nbsp; System.out.printf("Thứ 4");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} <br></em><strong><em>else</em></strong><em> </em><strong><em>if</em></strong><em> (ngay == 4)<br>&nbsp; &nbsp; &nbsp; {&nbsp; &nbsp; System.out.printf("Thứ 5");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br> </em><strong><em>else</em></strong><em> </em><strong><em>if</em></strong><em> (ngay == 5)<br>&nbsp; &nbsp; &nbsp; {&nbsp; &nbsp; System.out.printf("Thứ 6");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} <br></em><strong><em>else</em></strong><em> </em><strong><em>if</em></strong><em> (ngay == 6)<br>&nbsp; &nbsp; &nbsp; {&nbsp; &nbsp; System.out.printf("Thứ 7");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} <br></em><strong><em>else</em></strong><em> </em><strong><em>if</em></strong><em> (ngay == 7) <br>&nbsp; &nbsp; &nbsp; {&nbsp; &nbsp; System.out.printf("Chủ nhật");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } <br></em><strong><em>else</em></strong><em> <br>&nbsp; &nbsp; &nbsp; {&nbsp; &nbsp; System.out.printf("Số không hợp lệ!"); &nbsp; }</em><br><strong>CÂU LỆNH ?:</strong><br><strong>*</strong> <strong>Cú pháp :</strong></div><pre><strong>[kết_quả =] biểu_thức_điều_kiện ? câu_lệnh_nếu_true : câu_lệnh_nếu_false;</strong></pre><div><em>- </em><strong><em>kết_quả</em></strong><em> có thể </em><strong><em>có</em></strong><em> hoặc </em><strong><em>không</em></strong><em>, lưu giá trị là kết quả của câu lệnh, kiểu dữ liệu của </em><strong><em>câu_lệnh_nếu_true</em></strong><em> và </em><strong><em>câu_lệnh_nếu_false</em></strong><em>. <br>- </em><strong><em>biểu_thức_điều_kiện</em></strong><em> tương tự câu lệnh </em><strong><em>if.<br>- câu_lệnh_nếu_true</em></strong><em> sẽ thực thi khi </em><strong><em>biểu_thức_điều_kiện</em></strong><em> trả về </em><strong><em>true</em></strong><em>, vế này sẽ trả 1 kết quả về cho </em><strong><em>kết_quả</em></strong><em>, có thể là kiểu </em><strong><em>String</em></strong><em>, </em><strong><em>boolean</em></strong><em>, </em><strong><em>int</em></strong><em>,… Ngược lại </em><strong><em>câu_lệnh_nếu_false</em></strong><em> sẽ thực thi khi </em><strong><em>biểu_thức_điều_kiện</em></strong><em> trả về </em><strong><em>false</em></strong><em>, và vế này cũng sẽ trả kết quả về cho </em><strong><em>kết_quả</em></strong><em>.</em><br><strong>VD :</strong><br><em>Khaosat khaosat = new Khaosat(System.in);</em></div><div><em>System.out.println("Nhap kết quả xét nghiệm axit nucleic: ");</em></div><div><strong><em>int</em></strong><em> chiso = khaosat.nextInt(); &nbsp;</em></div><div><em>System.out.printf((chiso &lt; 0.08) ? "Bạn không bị nhiễm covid" : "Bạn đã bị nhiễm covid!");</em></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1361625485/affeb02f1804b31d8def6c185e1259fb/jjj.PNG" />
         <pubDate>2021-10-13 07:08:17 UTC</pubDate>
         <guid>https://padlet.com/nhatmy159/java1310/wish/1813129504</guid>
      </item>
      <item>
         <title>Câu3: Nêu cú pháp,cách dùng và cho ví dụ về cách sử dụng cấu trúc lặp For </title>
         <author>nhuanh9488</author>
         <link>https://padlet.com/nhatmy159/java1310/wish/1813147593</link>
         <description><![CDATA[<div><strong>Có 3 kiểu của vòng lặp for trong Java:<br></strong><br></div><ul><li>Vòng lặp for đơn giản</li><li>Vòng lặp for cải tiến</li><li>Vòng lặp for gán nhãn</li></ul><div><strong><mark>Vòng lặp for đơn giản</mark></strong><br>Cách dùng : giống như trong C/C++, chúng ta có thể khởi tạo biến, kiểm tra điều kiện và tăng/giảm giá trị của biến.<br>Cú pháp:</div><pre><strong>for</strong> (khoi_tao_bien ; check_dieu_kien ;tang/giam_bien) 
{  
     //Khối lệnh được thực thi
}</pre><div>Ví dụ:<br>public <strong>class</strong> QLTT_BenhNhan {</div><div><br></div><div>&nbsp; &nbsp; public static <strong>void</strong> main(String[] args) {</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <strong>for</strong>(int i = 1; i &lt;= 3; i++) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Benh nhan thu " + i);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>}</div><div><br><strong><mark>Vòng lặp for cải tiến</mark></strong><br>Cách dùng: Được sử dụng để lặp mảng(array) hoặc collection trong java,sử dụng dễ dàng, dễ hơn cả vòng lặp for đơn giản. Bởi vì bạn không cần phải tăng hay giảm giá trị của biến rồi check điều kiện, bạn chỉ cần sử dụng ký hiệu hai chấm ":"<br>Cú pháp:</div><pre><strong>for</strong> (Type var : array)
{
     //Khối lệnh được thực thi
} </pre><div>Ví dụ: <strong>public</strong> <strong>class</strong> QLTT_BenhNhan {</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("Benh nhan thu " +i );</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>}</div><div><br><strong><mark>Vòng lặp for gán nhãn</mark></strong><br>Cách dùng:Đặt tên cho mỗi vòng lặp for bằng cách gán nhãn trước vòng lặp for. Điều này rất hữu dụng khi chúng ta muốn thoát/tiếp tục(break/continues) chạy vòng lặp for.<br>Cú pháp:</div><pre>ten_nhan:<strong>for</strong> (khoi_tao_bien ; check_dieu_kien ; tang/giam_bien) 
{  
    // Khối lệnh được thực thi
}</pre><div>Ví dụ:<br><strong>public</strong> class QLTT_BenhNhan {</div><div>&nbsp; &nbsp; <strong>public</strong> <strong>static</strong> <strong>void</strong> main(String[] args) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; benhnhan1: <strong>for</strong> (<strong>int</strong> i = 1; i &lt;= 3; i++) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; benhnhan2: <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> benhnhan1;</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/1037620685/a0722cd33a53e8ae5ec863c3ecdcb78d/vong_lap_for_trong_java.jpg" />
         <pubDate>2021-10-13 07:18:29 UTC</pubDate>
         <guid>https://padlet.com/nhatmy159/java1310/wish/1813147593</guid>
      </item>
      <item>
         <title>Câu 2: Cú pháp, cách sử dụng và ví dụ về cách sử dụng cú pháp switch case</title>
         <author>nguyenthiquynhchau410402</author>
         <link>https://padlet.com/nhatmy159/java1310/wish/1813149337</link>
         <description><![CDATA[<div>Cú pháp:<br>// 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>Cách sử dụng:<br>TH1: có case thỏa mãn:<br>public class QLBenhNhan {</div><div>&nbsp; &nbsp; public static void main(String[] args) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; int STTBenhNhan = 2;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; switch (STTBenhNhan) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 1:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là bệnh nhân số 1");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 2:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là bệnh nhân số 2");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 3:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là bệnh nhân số 3");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 4:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là bệnh nhân số 4");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 5:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là bệnh nhân số 5");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; default:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Chạy vào khối default");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }<br>=&gt;kết quả in ra màn hình: Đây là bệnh nhân số 2<br>TH2: không có case nào thỏa mãn:<br>public class QLBenhNhan {</div><div>&nbsp; &nbsp; public static void main(String[] args) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; int STTBenhNhan = 6;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; switch (STTBenhNhan) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 1:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là bệnh nhân số 1");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 2:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là bệnh nhân số 2");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 3:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là bệnh nhân số 3");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 4:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là bệnh nhân số 4");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 5:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là bệnh nhân số 5");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; default:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Chạy vào khối default");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }<br>=&gt;kết quả in ra màn hình: chạy vào khối default<br>TH3: Switch case không sử dụng break:<br>public class QLBenhNhan {</div><div>&nbsp; &nbsp; public static void main(String[] args) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; int STTBenhNhan = 2;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; switch (STTBenhNhan) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 1:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là bệnh nhân số 1");</div><div>&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 2:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là bệnh nhân số 2");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 3:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là bệnh nhân số 3");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 4:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là bệnh nhân số 4");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 5:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là bệnh nhân số 5");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; default:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Chạy vào khối default");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }<br>=&gt;kết quả in ra màn hình:&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; Đây là bệnh nhân số 2<br>&nbsp; &nbsp; &nbsp; &nbsp; Đây là bệnh nhân số 3<br>&nbsp; &nbsp; &nbsp; &nbsp; Đây là bệnh nhân số 4<br>&nbsp; &nbsp; &nbsp; &nbsp; Đây là bệnh nhân số 5<br>&nbsp; &nbsp; &nbsp; &nbsp; Chạy vào khối Default<br>Giải thích: 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. Ví dụ ở đây mình cho STTBenhNhan = 2. Thì đầu tiên gặp case 1, không thỏa mãn. 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="" />
         <pubDate>2021-10-13 07:19:30 UTC</pubDate>
         <guid>https://padlet.com/nhatmy159/java1310/wish/1813149337</guid>
      </item>
      <item>
         <title>Câu 4: Cấu trúc lặp While, Do...White</title>
         <author>nhatmy159</author>
         <link>https://padlet.com/nhatmy159/java1310/wish/1813154500</link>
         <description><![CDATA[<div><strong><mark>Cấu trúc lặp While:&nbsp; </mark></strong>Trong<strong> vòng lặp WHILE</strong>, ta sẽ tạo một điều kiện cho vòng lặp, nếu điều kiện đúng thì khối lệnh lặp sẽ thực hiện cho đến khi điều kiện sai.</div><div><strong>Cú pháp:</strong></div><pre><strong>while </strong>(<strong>&lt;Biểu thức điều kiện&gt;</strong>) {
    &lt;Khối lệnh lặp lại&gt;
}</pre><div><strong>Ý nghĩa:</strong></div><div>Nếu <strong>&lt;Biểu thức điều kiện&gt; </strong>trả về <strong>true </strong>thì sẽ thực hiện &lt;Khối lệnh lặp lại&gt; cho đến khi <strong>&lt;Biểu thức điều kiện&gt;</strong> trả về <strong>false</strong>.<br><br></div><pre>public class<strong> QLTT_BenhNhan</strong> {
  public static void main(String[] args) {
    while(!find) {
System.out.println("Nhập mã bệnh nhận cần sửa:");
String mabenhnha=sc.nextLine();
benhnhan=this.Tim(mabenhnha);if(benhnhan!=null){
if(benhnhan instanceof BENHNHANBAOHIEMYTE) {
benhnhan=(BENHNHANBAOHIEMYTE)benhnhan;
loaibaohiem='t';
}
else {
benhnhan=( BENHNHANBAOHIEMXAHOI)benhnhan;
loaibaohiem='x';
}
find=true;
}
else
System.out.println("Không tìm thấy mã bệnh nhân");
}//end while
}
<br></pre><div><br><strong><mark>Cấu trúc lặp Do...While: <br></mark></strong><strong>Cú pháp:</strong></div><blockquote><pre><strong>do </strong>{   
 &lt;Khối lệnh lặp lại&gt;

} <strong>while </strong>(<strong>&lt;Biểu thức điều kiện&gt;</strong>)</pre></blockquote><div><strong>Ý nghĩa:</strong></div><div>Khi đến dạng vòng lặp thì ngay lập tức sẽ thực hiện &lt;Khối lệnh lặp lại&gt;. Sau đó sẽ kiểm tra nếu <strong>&lt;Biểu thức điều kiện&gt;</strong> trả về <strong>true </strong>thì sẽ thực hiện lại &lt;Khối lệnh lặp lại&gt; cho đến khi <strong>&lt;Biểu thức điều kiện&gt;</strong> trả về <strong>false</strong>.<br><br></div><div><br><br></div><div><strong><mark><br></mark></strong><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1361626468/0163dd224aef1fe8c026a61785fbdf85/while_loop.png" />
         <pubDate>2021-10-13 07:22:25 UTC</pubDate>
         <guid>https://padlet.com/nhatmy159/java1310/wish/1813154500</guid>
      </item>
      <item>
         <title>Câu 5: Cú pháp, cách sử dụng và ví dụ về cách sử dụng Break, Continue</title>
         <author>nhat09122002</author>
         <link>https://padlet.com/nhatmy159/java1310/wish/1813216916</link>
         <description><![CDATA[<div><strong><br>&nbsp; *Từ khóa break trong java</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 đó.<br>Ví dụ sử dụng break với vòng lặp for: Hình trên<br><br><br><strong>Từ khóa continue trong java</strong> đượ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 đó.<br>Ví dụ về cách dùng từ khóa continue trong vòng lặp for<br>public class QLBenhNhan {</div><div>public class ContinuteEx{<br>&nbsp; &nbsp; public static void main(String[] args) {<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 1; i &lt;= 5; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (i == 2) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Đây là bệnh nhân số" + i);<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; }<br>}<br>KQ là :<br>Đây là bệnh nhân số 1<br>Đây là bệnh nhân số 3<br>Đây là bệnh nhân số 4<br>Đây là bệnh nhân số 5</div><div><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1361625150/e2550bccf279029fad8bca356a4523f5/image.png" />
         <pubDate>2021-10-13 07:55:33 UTC</pubDate>
         <guid>https://padlet.com/nhatmy159/java1310/wish/1813216916</guid>
      </item>
      <item>
         <title>Dự án: Quản lý thông tin bệnh nhân</title>
         <author>nhatmy159</author>
         <link>https://padlet.com/nhatmy159/java1310/wish/1813278354</link>
         <description><![CDATA[<div>Câu 1: Thanh Hoa<br>Câu 2: Quỳnh Châu<br>Câu 3: Như Anh<br>Câu 4: Nhật My<br>Câu 5: Minh Nhật</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1361626468/ccb5efc2826f7a58792f1a7c47a576ec/quan_ly_cong_viec.png" />
         <pubDate>2021-10-13 08:27:59 UTC</pubDate>
         <guid>https://padlet.com/nhatmy159/java1310/wish/1813278354</guid>
      </item>
   </channel>
</rss>
