<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>5 - Thounsand Sunny - 16/10 by Gia Quyền Trần</title>
      <link>https://padlet.com/giaquyentran365/nuexw252ohqhpfed</link>
      <description>Được tạo bằng một tài năng thiên bẩm</description>
      <language>en-us</language>
      <pubDate>2021-10-16 06:20:38 UTC</pubDate>
      <lastBuildDate>2021-10-19 13:58:30 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url></url>
      </image>
      <item>
         <title>(Trần Gia Quyền) Câu 2. Cấu trúc Switch ... Case</title>
         <author>giaquyentran365</author>
         <link>https://padlet.com/giaquyentran365/nuexw252ohqhpfed/wish/1820853270</link>
         <description><![CDATA[<div>Mệnh đề switch...case trong java được sử dụng để thực thi 1 hoặc nhiều khối lệnh từ nhiều điều kiện.<br><br>Cú pháp : <br>&nbsp; &nbsp;<strong>switch</strong> (bieu_thuc) {&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp;<strong>case</strong> gia_tri_1:</div><div>&nbsp; &nbsp; &nbsp; &nbsp;// Khối lệnh 1</div><div>&nbsp; &nbsp; &nbsp; &nbsp;<strong>break</strong>;&nbsp; //tùy chọn</div><div>&nbsp; &nbsp;<strong>case</strong> gia_tri_2:&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;// Khối lệnh 2</div><div>&nbsp; &nbsp; &nbsp; &nbsp;<strong>break</strong>;&nbsp; //tùy chọn</div><div>&nbsp; &nbsp;......&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp;<strong>case</strong> gia_tri_n:&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;// Khối lệnh n</div><div>&nbsp; &nbsp; &nbsp; <strong>break</strong>;&nbsp; //tùy chọn&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp;<strong>default</strong>:&nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;// Khối lệnh này được thực thi&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;// nếu tất cả các điều kiện trên không thỏa mãn&nbsp;</div><div>}&nbsp; &nbsp;<br><br>Ví dụ :<br>&nbsp; &nbsp;System.out.println("&gt;&gt; Các loại sách &lt;&lt;");<br>&nbsp; &nbsp;System.out.println("+------------------+");<br>&nbsp; &nbsp;System.out.println("|&nbsp; &nbsp; 1.Văn học&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |");<br>&nbsp; &nbsp;System.out.println("|&nbsp; &nbsp; 2.Lịch Sử&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|");<br>&nbsp; &nbsp;System.out.println("|&nbsp; &nbsp; 3.Truyện tranh&nbsp; &nbsp; |");<br>&nbsp; &nbsp;System.out.println("|&nbsp; &nbsp; 0.Kết thúc&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|");<br>&nbsp; &nbsp;System.out.println("+------------------+");<br>&nbsp; &nbsp;System.out.println("&gt;&gt; Chọn loại sách? &lt;&lt;");<br><br>&nbsp; &nbsp;Scanner sc = new Scanner(System.in)<br>&nbsp; &nbsp;System.out.print("Nhập vào STT sách bạn muốn chọn : ");<br>&nbsp; &nbsp;int n = sc.nextInt();<br><br>&nbsp; &nbsp;Switch (int) {<br>&nbsp; &nbsp; &nbsp; case 1 -&gt; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.out.println("Danh sách sách văn học");<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<br>&nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; case 2 -&gt; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.out.println("Danh sách sách lịch sử");<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<br>&nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; case 3 -&gt; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.out.println("Danh sách truyện tranh");<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<br>&nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; case 0 -&gt; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.out.println("Kết thúc");<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.exit(0);<br>&nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp;}<br><br>&nbsp; &nbsp;Input : 3<br>&nbsp; &nbsp;Output : Danh sách truyện tranh<br><br>&nbsp; &nbsp;*Khi không sử dụng từ khóa 'break' trong mệnh đề switch-case. Điều này có nghĩa là các khối lệnh sau case có giá trị phù hợp sẽ được thực thi.<br><br>&nbsp; &nbsp;Input : 2<br>&nbsp; &nbsp;Output :&nbsp; Danh sách sách lịch sử<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Danh sách truyện tranh<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Kết thúc<br>                   Exit // thoát khỏi chương trình</div><div><br><br></div><div><br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-16 07:51:30 UTC</pubDate>
         <guid>https://padlet.com/giaquyentran365/nuexw252ohqhpfed/wish/1820853270</guid>
      </item>
      <item>
         <title>(Phạm Hồng Sơn)-Câu 4. Cấu trúc Lập While,Do...While.</title>
         <author>sonphamcute02</author>
         <link>https://padlet.com/giaquyentran365/nuexw252ohqhpfed/wish/1820855789</link>
         <description><![CDATA[<div>*Cấu Trúc Lập While:<br>– Cú pháp:</div><div><strong>while</strong> (&lt;điều kiện&gt;)</div><div>{</div><div>&nbsp; &nbsp; &lt;khối lệnh&gt;;</div><div>}</div><div>– Cách thức hoạt động của while: Đầu tiên chương trình kiểm tra<strong> điều kiện:<br></strong><br>• Nếu <strong>điều kiện</strong> sai thì thoát khỏi <strong>while</strong></div><div>• Nếu điều kiện đúng thì thực hiện <strong>khối lệnh</strong>, sau đó lại quay về kiểm tra <strong>điều kiện</strong> và làm tương tự như thế cho đến khi <strong>điều kiện</strong> sai thì thoát khỏi <strong>while</strong>.</div><div>– Có thể thấy<strong> while</strong> hoạt động gần giống với <strong>if</strong>, chỉ khác là <strong>if</strong> chỉ kiểm tra <strong>điều kiện</strong> một lần, còn while thì lặp đi lặp lại nhiều lần.<br>– Và cấu trúc<strong> for</strong> ở bài trước tương đương với cấu trúc <strong>while</strong> như sau:<br>&lt;lệnh khởi gán&gt;</div><div><strong>while</strong> (&lt;điều kiện&gt;)</div><div>{</div><div>&nbsp; &nbsp; &lt;khối lệnh&gt;;</div><div>&nbsp; &nbsp; &lt;bước nhảy&gt;;</div><div>}</div><div>*Cấu Trúc Lập Do...While:<br>– Cú pháp:<br><strong>do</strong></div><div>{</div><div>&nbsp; &nbsp; &lt;khối lệnh&gt;;</div><div>}</div><div><strong>while</strong> (&lt;điều kiện&gt;);<br>– Cách thức hoạt động của <strong>do – while</strong> hơi khác so với<strong> while</strong>: Đầu tiên chương trình thực hiện<strong> khối lệnh</strong>, sau đó mới kiểm tra <strong>điều kiện</strong>:</div><div>• Nếu <strong>điều kiện</strong> sai thì thoát khỏi <strong>do-while</strong></div><div>• Nếu điều kiện đúng thì quay lại thực hiện <strong>khối lệnh</strong>, sau đó lại kiểm tra <strong>điều kiện</strong> và làm tương tự như thế cho đến khi <strong>điều kiện</strong> sai thì thoát khỏi <strong>do-while</strong>.</div><div>– Xét một ví dụ: Nhập vào một số nguyên n thuộc đoạn [0; 9].</div><div>• Nếu n nằm ngoài đoạn này thì xuất thông báo yêu cầu nhập lại.<br><br></div><div>• Nếu n nằm trong đoạn này thì xuất thông báo: Bạn vừa nhập số …<br><br></div><div>– Phân tích: có thể dễ dàng nhận thấy, với yêu cầu này thì việc xuất thông báo và việc nhập số nguyên n sẽ được thực hiện <strong>lặp đi lặp lại</strong> nhiều lần trong khi mà n nằm ngoài đoạn [0;9]. Và ta sẽ sử dụng vòng lặp, với khối lệnh là thông báo và nhập số nguyên n, còn điều kiện duy trì vòng lặp là khi n không thuộc đoạn [0; 9]. Ta có thể viết như sau:<br>printf("Nhap so nguyen n (0-9): ");</div><div><strong>do</strong></div><div>{</div><div>&nbsp; &nbsp; scanf("%d", &amp;n);</div><div>&nbsp; &nbsp; <strong>if</strong> ( !(n &gt;= 0 &amp;&amp; n &lt;= 9) )</div><div>&nbsp; &nbsp; &nbsp; &nbsp; printf("Khong hop le. Nhap lai: ");</div><div>}</div><div><strong>while</strong> (!(n &gt;= 0 &amp;&amp; n &lt;= 9) );</div><div>printf("Ban vua nhap so: %d\n", n);</div><div><br><br></div><div><br><br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-16 07:55:26 UTC</pubDate>
         <guid>https://padlet.com/giaquyentran365/nuexw252ohqhpfed/wish/1820855789</guid>
      </item>
      <item>
         <title>(Đoàn Ngọc Thanh)- Câu 1. Cấu trúc câu điều kiện if</title>
         <author>doanngocthanh1811002</author>
         <link>https://padlet.com/giaquyentran365/nuexw252ohqhpfed/wish/1820856582</link>
         <description><![CDATA[<div>&nbsp;<strong>cấu trúc điều khiển IF</strong> trong <strong>lập trình JAVA</strong> được sử dụng để hỗ trợ việc này. Nó sẽ kiểm tra điều kiện: ĐÚNG hay SAI để quyết định thực hiện hành động nào đó.<br>Ví dụ chương trình if trong java:<br><br>public class ifex {<br>	public static void main(String[] args) {<br>	&nbsp; &nbsp; //Khai báo biến "age"<br>	&nbsp; &nbsp; int age = 20;<br>	&nbsp; &nbsp; //Kiểm tra biến age<br>	&nbsp; &nbsp; if( age &gt; 18 ){<br>	&nbsp; &nbsp; &nbsp; &nbsp; System.out.print("Đủ tuổi lái xe máy "); &nbsp;<br>	&nbsp; &nbsp; }<br>	&nbsp; }<br>	}<br>Kết quả: Đủ tuổi lái xe máy</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-16 07:56:53 UTC</pubDate>
         <guid>https://padlet.com/giaquyentran365/nuexw252ohqhpfed/wish/1820856582</guid>
      </item>
      <item>
         <title>(Đinh Thị Kim Anh) Câu 5: Break vs Continue</title>
         <author>3120218008</author>
         <link>https://padlet.com/giaquyentran365/nuexw252ohqhpfed/wish/1820858226</link>
         <description><![CDATA[<div>Các câu lệnh <strong>Break</strong> và <strong>Continue</strong> được dùng trong các vòng lặp như: if, for, while, do...while.</div><ul><li><strong>Break - câu lệnh dừng</strong>: dùng để kết thúc vòng lặp ngay lập tức. Thường sử dụng trong các trường hợp khi không biết chắc về số lần lặp hoặc kết thúc vòng lặp dựa trên một số điều kiện.</li></ul><div>VD: public static void main(String[] args){<br>		for (int i = 1; i &lt;=10; i++) {<br>// Chỉ in ra 4 dãy sách<br>			if (i == 5)<br>				break;<br>			System.out.println("Dãy sách : " + i);<br>		}<br>	}</div><ul><li><strong>Continue - câu lệnh bỏ qua</strong>: dùng để bỏ qua lần lặp hiện tại của một vòng lặp và thực hiện các câu lệnh tiếp . Thường sử dụng khi muốn tiếp tục vòng lặp nhưng không muốn câu lệnh nào đó thực hiện.</li></ul><div>VD:public static void main(String[] args){<br>		for (int i = 1; i &lt;= 10; i++) {<br>// Không in dãy sách số 5<br>			if (i == 5)<br>				continue;<br>			System.out.println("Dãy sách : " + i);<br>		}<br>	}</div><div><br><br><br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-16 07:59:42 UTC</pubDate>
         <guid>https://padlet.com/giaquyentran365/nuexw252ohqhpfed/wish/1820858226</guid>
      </item>
   </channel>
</rss>
