freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

自考java語言程序設(shè)計(jì)(一)課后習(xí)題答案與源代碼(第八章)-展示頁

2025-06-16 21:52本頁面
  

【正文】 button)。 (this)。 i++) thread[i] = new Thread(this)。 for (int i = 0。 begin_button = new JButton(開始買票)。 text = new JTextArea()。 public BuyTicketFrame() { super(第八章,第六題,線程模擬購票)。 private JButton begin_button, replay_button。 private Thread thread[] = new Thread[number]。 private int array[] = { 10, 10, 5, 20, 50, 5, 5, 5, 5, 5, 5, 10, 20, 10, 5, 10, 20, 5 }。/** * 線程實(shí)現(xiàn),購票規(guī)則,由于我想的算法太過復(fù)雜,只寫到50元面值的 * author 黎明你好 */public class BuyTicketFrame extends JFrame implements ActionListener, Runnable{ private static final long serialVersionUID = 1L。import .*。 }},球票5元,購票者持有5,10,20,50元的,售票員手里開始沒有零錢。 } /** * 用參數(shù)方程方法,計(jì)算坐標(biāo)的方法 * param r 圓的半徑,橢圓的兩個(gè)半軸 * param loc Y坐標(biāo)的相對(duì)偏移量 * param angle 旋轉(zhuǎn)的角度,單位為角度 * return 計(jì)算后的坐標(biāo)值 */ public int getY(int r, int angle, int locY) { int y = locY + (int) (r * ( / * angle))。 } catch( InterruptedException e ) { } } } } /** * 用參數(shù)方程方法,計(jì)算坐標(biāo)的方法 * param r 圓的半徑,橢圓的兩個(gè)半軸 * param loc x坐標(biāo)的相對(duì)偏移量 * param angle 旋轉(zhuǎn)的角度,單位為角度 * return 計(jì)算后的坐標(biāo)值 */ public int getX(int r, int angle, int locX) { int x = locX + (int) (r * ( / * angle))。 (x, y, 10, 10)。 y = getY(radius2_blue, blue_angle, 100)。 if (blue_angle = 360) blue_angle = 0。 (x, y, 10, 10)。 int y = getY(radius2_blue, blue_angle, b_blue)。// 繪制橢圓的邊框。// 使用當(dāng)前顏色填充外接指定矩形框的橢圓 try { (10)。 ()。 x = getX(80, red_angle, 100)。// 用白色畫一次,可以擦出痕跡 red_angle += 3。 ()。x,y,width,height int x = getX(radius_red, red_angle, a_red)。 } public void run() { while (true) { if (() == red_thread) { (25, 25, 160, 160)。 } public void start() { ()。 setBackground()。 redPen = getGraphics()。 public void init() { red_thread = new Thread(this)。 /**圓形半徑*/ private int radius_red = 80。 /** 紅色畫的圖案的中心坐標(biāo) */ private int a_red = 100, b_red = 100。 /** 紅色畫筆、藍(lán)色畫筆 */ private Graphics redPen, bluePen。/** * 用一個(gè)紅色筆畫圓,同時(shí)用一個(gè)藍(lán)色筆畫橢圓 */public class Work8_3 extends Applet implements Runnable{ private static final long serialVersionUID = 1L。import 。第八章,一個(gè)畫圓,一個(gè)畫橢圓。程序運(yùn)行結(jié)果:Applet的源文件:import 。import 。 /** 兩個(gè)線程,紅筆線程,和藍(lán)筆線程 */ private Thread red_thread, blue_thread。 /** 藍(lán)、紅筆畫時(shí)需要旋轉(zhuǎn)角度 */ private int blue_angle = 0, red_angle = 0。 /** 藍(lán)色畫的圖案的中心坐標(biāo) */ private int a_blue = 300, b_blue = 100。 /**橢圓的兩個(gè)半徑*/ private int radius1_blue = 150, radius2_blue = 100。 blue_thread = new Thread(this)。 bluePen = getGraphics()。 setSize(470, 240)。// 兩個(gè)線程開始 ()。// 繪制圓的邊框。 int y = getY(radius_red, red_angle, b_red)。 (x, y, 10, 10)。 if (red_angle = 360) red_angle = 0。 y = getY(80, red_angle, 100)。 (x, y, 10, 10)。 } catch( InterruptedException e ) { } } else if (() == blue_thread) { (a_blue / 2 + 5, b_blue / 2 45, radius1_blue * 2, radius2_blue * 2)。x,y,width,height int x = getX(radius1_blue, blue_angle, a_blue)。 ()。// 擦除痕跡 blue_angle += 3。 x = getX(radius1_blue, blue_angle, 300)。 ()。// 擦除痕跡 try { (20)。 return x。 return y。
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)教案相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1