Microsoft Word - CPFinal2011SpringSolution

Size: px
Start display at page:

Download "Microsoft Word - CPFinal2011SpringSolution"

Transcription

1 通識計算機程式設計期末考參考解答, 6/24/ 參考如下的 UML 類別圖, 撰寫 C# 敘述達成下列要求 : ( 假設 using System; 敘述已經包含於程式中 ) (a) 撰寫類別程式 Circle 代表圓形, 其中宣告私有 int 變數 radius 及 double 變數 area, 分別代表半徑及面積 ; 另有預設建構式設定 radius 為 1, 同時設定對應之 area 值 ; 正規建構式輸入 radius, 同時決定對應之 area 值, 屬性 Radius Area 分別傳回 radius area 之值, 此處不需處理例外情況 (6%) class Circle private int radius; private double area; 1/24

2 public Circle() radius = 1; area = Math.PI*radius*radius; public Circle(int radius) this.radius = radius; area = Math.PI * radius * radius; public int Radius get return radius; public double Area get return area; (b) 撰寫結構 Color, 包含三個公有 byte 變數 r g b, 及正規建構式分別設定 r g b 之值 (3%) struct Color public byte r; public byte g; public byte b; public Color(byte r, byte g, byte b) this.r = r; this.g = g; this.b = b; (c) 撰寫類別 ColoredCircle 繼承類別 Circle, 並宣告私有 Color 變數 color, 同時在宣告敘述中呼叫 Color 建構式 Color(0, 0, 0) 設 2/24

3 定 color 之初值 (6%) class ColoredCircle : Circle private Color color = new Color(0, 0, 0); (d) 撰寫類別 ColoredCircle 之正規建構式, 記得呼叫父類別之建構式 (6%) public ColoredCircle(int radius, Color c) : base(radius) color = c; (e) 撰寫類別 ColoredCircle 之成員函式 GetColor, 傳回 color (3%) public Color GetColor() return color; (f) 寫一段測試主程式, 設定顏色 red 之 r g b 為 (255, 0, 0), ColoredCircle 物件之 radius 為 2,color 為 red, 再利用它與繼承來的屬性 函式及結構之公開變數, 輸出其半徑 面積 與顏色的 r g b 值如下圖 (6%) Color red = new Color(255, 0, 0); ColoredCircle cc = new ColoredCircle(2, red); Console.WriteLine("Colored circle cc is with " + "radius 0, area 1", cc.radius, cc.area); Color color = cc.getcolor(); 3/24

4 Console.WriteLine("Colored circle cc is with "+ "color: (0, 1, 2)", color.r, color.g, color.b); 2. 找出以下程式片段之錯誤, 並予更正. (a) (3%) 一個錯誤 class A private int i; public A(int i) this.i = i; public static int Func() return i; 靜態成員函式 Func 不應使用非靜態成員變數 i 改正 : 將成員函式 Func 改成非靜態 class A private int i; public A(int i) this.i = i; public int Func() return i; (b) (3%) 一個錯誤 class A 4/24

5 private int i; public A(int i) this.i = i; // 要把成員變數 i 乘以 2 public void Func(int i) i *= 2; 成員函式 Func 中乘以 2 的 i 是輸入的型式參數, 不是成員變數 i 所以成員變數 i 在 Func 中並未改變 改正 : 去掉成員函式 Func 的輸入參數 class A private int i; public A(int i) this.i = i; public int I get return i; // 要把成員變數 i 乘以 2 public void Func() i *= 2; 5/24

6 (c) (3%). 一項錯誤 class A private int i; public A(int i) this.i = i; public int I get return i; class B : A private int j; public B(int i, int j) : base(i) this.j = j; public int J get return j; public void Func() j = i; 類別 B 的成員函式 Func 不能使用父類別 A 的私有成員變數 i 改正 : 將類別 A 中的成員變數 i 改宣告為 protected, 或改寫類別 B 的成員函式 Func 內容為 j = I; class A 6/24

7 protected int i; public A(int i) this.i = i; public int I get return i; class B : A private int j; public B(int i, int j) : base(i) this.j = j; public int J get return j; public void Func() j = i; 或 class A private int i; public A(int i) this.i = i; 7/24

8 public int I get return i; class B : A private int j; public B(int i, int j) : base(i) this.j = j; public int J get return j; public void Func() j = I; (d) (3%) 一個錯誤 class A private int i; public A(int i) this.i = i; public virtual int Func() return i; 8/24

9 class B : A private int j; public B(int i, int j) : base(i) this.j = j; // 要作為多型之用 public int Func() return j; 子類別欲作為多型之用的成員函式需加上 override 字樣 改正 :Func 宣告時加上 override class A private int i; public A(int i) this.i = i; public virtual int Func() return i; class B : A private int j; public B(int i, int j) : base(i) 9/24

10 this.j = j; // 要作為多型之用 public override int Func() return j; (e) (3%) 一組錯誤 abstract class A public abstract int FunA(); abstract class B public abstract int FuncB(); class C : A, B int i; public C(int i) this.i = i; public int FuncA() return i; public int FuncB() return i; 10/24

11 只有 interface 才可多重繼承, 因此類別 B 不可同時繼承抽象類別 A B 改正 : 將抽象類別 A B 改宣告為 interface, 其中的函式去除 public abstract 修飾詞 interface A int FuncA(); interface B int FuncB(); class C : A, B private int i; public C(int i) this.i = i; public int FuncA() return i; public int FuncB() return i; 3. 試寫出下列程式的輸出 (12%) using System; namespace Final2011Problem3 11/24

12 class Program static void Main(string[] args) // 建立資料庫 Book[] book = new Book[7]; book[0] = new Book(" 紅樓夢 ", " 曹雪芹 ", " ", " 好讀 ", "2007", " b v1"); book[1] = new Book(" 雪國千鶴古都 ", " 川端康成 ", " 高慧勤 ", " 桂冠 ", "1994", " "); book[2] = new Book(" 人鼠之間 ", " 史坦貝克 ", " 湯新楣 ", " 金楓 ", "1987", " "); book[3] = new Book(" 夢的解析 ", " 佛洛伊德 ", " 賴其萬 ", " 志文 ", "1985", " "); book[4] = new Book(" 國富論 ", " 亞當. 史密斯 ", " 謝宗林 ", " 先覺 ", "2000", " "); book[5] = new Book(" 天演論 ", " 赫胥黎 ", " 嚴復 ", " 台灣商務 ", "1967", " "); book[6] = new Book(" 社會契約論 ", " 盧梭 ", " 何兆武 ", " 唐山 ", "1987", " "); DataBase db = new DataBase(book); // 資料搜尋 db.processquerybyauthor(" 川端康成 "); db.processquerybytitle(" 社會契約論 "); db.processquerybycallnumber(" "); class DataBase private Book[] book; public DataBase() book = null; 12/24

13 public DataBase(Book[] book) this.book = book; public void ProcessQueryByTitle(string title) for (int i = 0; i < book.length; ++i) if (book[i].title == title) book[i].displaydata(); Console.WriteLine(); public void ProcessQueryByAuthor(string author) for (int i = 0; i < book.length; ++i) if (book[i].author == author) book[i].displaydata(); Console.WriteLine(); public void ProcessQueryByCallNumber(string callnumber) for (int i = 0; i < book.length; ++i) if (book[i].callnumber == callnumber) book[i].displaydata(); 13/24

14 Console.WriteLine(); class Book private string title; private string author; private string translator; private string publisher; private string year; private string callnumber; public Book() title = null; author = null; translator = null; publisher = null; year = null; callnumber = null; public Book(string title, string author, string translator, string publisher, string year, string callnumber) this.title = title; this.author = author; this.translator = translator; this.publisher = publisher; this.year = year; this.callnumber = callnumber; public string Title get return title; public string Author 14/24

15 get return author; public string CallNumber get return callnumber; public void DisplayData() Console.WriteLine(title + "\t" + author + "\t" + translator + "\t" + publisher + "\t" + year + "\t" + callnumber); 4. 試寫出以下程式在下列狀況時的輸出 // 程式 Final2011Problem4 using System; using System.IO; namespace Final2011Problem4 class Program static void Main(string[] args) string filename = "Test.dat"; 15/24

16 int answer = Test(fileName); Console.WriteLine("answer = " + answer); static int Test(string filename) int result = 0; try StreamReader input = new StreamReader(fileName); Console.WriteLine(" 檔案開啟 "); try int ndataperline = int.parse(input.readline()); int i; string line; string[] datastring = new string[ndataperline]; int data; int sum = 0; while (!input.endofstream) line = input.readline(); datastring = line.split(' '); for (i = 0; i < ndataperline; ++i) data = int.parse(datastring[i]); sum += data; result = 105 / sum; catch (FormatException e) Console.WriteLine(" 格式錯誤 "); 16/24

17 catch (DivideByZeroException e) Console.WriteLine(" 除以 0 例外 "); catch (Exception e) Console.WriteLine( " 函式 Test 內層 try-catch 捕捉到例外 "); Console.WriteLine( " 函式 Test 內層 try-catch 再拋出例外 "); throw e; finally input.close(); Console.WriteLine(" 檔案關閉 "); catch(filenotfoundexception e) Console.WriteLine(" 檔案不存在 "); catch (Exception e) Console.WriteLine( " 函式 Test 外層 try-catch 捕捉到例外 "); return result; (a) (3%) 檔案 Test.dat 尚未建立 17/24

18 (b) (3%) 檔案 Test.dat 已在正確位置, 且內容為 (c) (3%) 檔案 Test.dat 已在正確位置, 且內容為 3 1 * (d) (3%) 檔案 Test.dat 已在正確位置, 且內容為 /24

19 5. 依據以下描述及程式框架, 完成指定程式 你在答案卷只需寫下程式註解標示的部份 (6%) 程式描述 : 建立如下視窗介面, 由使用者輸入被加數及加數後, 按下 確定 按鈕, 即於對話盒顯示兩數之和 假設被加數及加數之文字盒分別由視窗設計工具自動設定為 TextBox 物件 textbox1 及 textbox2, 而 確定 按鈕則設為 Button 物件 button1 // 檔案 MainForm.cs using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Final2011Problem5 public partial class MainForm : Form public MainForm() InitializeComponent(); 19/24

20 private void button1_click(object sender, EventArgs e) //******************************************** // 在此加入必要之程式碼 //******************************************** int x = Convert.ToInt32(textBox1.Text); int y = Convert.ToInt32(textBox2.Text); int sum = x + y; MessageBox.Show(" 兩數和為 "+sum.tostring()); 6. 撰寫一個 C# 程式以模擬神奇寶貝 (Pocket Monster) 運動會中的 30 米賽跑 為簡化問題, 只要寫主控台程式, 並在螢幕顯示各個神奇寶貝的位置, 最後顯示最先衝過終點最遠的贏家即可 假設參賽的神奇寶貝有皮卡丘 (Pikachiu) 其每次移動的距離分別為 : 妙蛙種子 (Bulbasaur) 傑尼龜 (Squirtle), 皮卡丘 : rand.next() % 妙蛙種子 :(rand1.next() % 10) + (rand2.next() % 5) + 1 ( 需要兩個亂數產生器 ) 傑尼龜 : (rand.next() % 20-5) % ( 沒錯, 可能往反方向跑 ) 其輸出可能如下圖 ( 殘念!! 皮卡丘先盛後衰, 輸了! 好討厭的感覺呀!): 20/24

21 以上述之測試場景撰寫程式, 不需撰寫額外內容 不使用類別者, 最高得 13 分 ; 使用類別, 不使用多型者, 最高得 20 分 ; 正確使用使用類別及多型者, 最高得 25 分 (25%) using System; namespace Final2011Problem6 class Program static void Main(string[] args) const int TRACK_LENGTH = 30; const int N_MONSTERS = 3; PocketMonster[] monsters = new PocketMonster[N_MONSTERS]; monsters[0] = new Pikachiu(168); monsters[1] = new Bulbasaur(777, 545); monsters[2] = new Squirtle(66); bool finished = false; int i; while(!finished) for(i=0; i<n_monsters; ++i) monsters[i].run(); 21/24

22 Console.WriteLine(monsters[i].Name + " at " + monsters[i].position); if(monsters[i].position >= TRACK_LENGTH) finished = true; Console.WriteLine( " "); // check which monster runs farthest int maxlength = 0; for (i = 0; i < N_MONSTERS; ++i) if (monsters[i].position > maxlength) maxlength = monsters[i].position; // check for all winners (with possible tie // condition) for (i = 0; i < N_MONSTERS; ++i) if (monsters[i].position == maxlength) Console.WriteLine(monsters[i].Name + " wins "); abstract class PocketMonster private string name; protected int position = 0; 22/24

23 public PocketMonster(string name) this.name = name; public string Name get return name; public int Position get return position; abstract public void Run(); class Pikachiu : PocketMonster private Random rand; public Pikachiu(int seed) : base("pikachiu") rand = new Random(seed); public override void Run() position += rand.next() % ; class Bulbasaur : PocketMonster private Random rand1; private Random rand2; public Bulbasaur(int seed1, int seed2) : base("bulbasaur") rand1 = new Random(seed1); rand2 = new Random(seed2); 23/24

24 public override void Run() position += (rand1.next() % 10) + (rand2.next() % 5) + 1; class Squirtle : PocketMonster private Random rand; public Squirtle(int seed) : base("squirtle") rand = new Random(seed); public override void Run() position += (rand.next() % 20-5) % ; 7. ( 額外加分題, 至多 4%) 本課程中, 你覺得 : 甲 那一部份最有趣? 為什麼? 乙 那一部份最困難? 為什麼? 丙 講義有何可改進之處? 丁 怎麼做可以改進教學效果? 24/24

Microsoft Word - CPFinal2012Spring

Microsoft Word - CPFinal2012Spring 通識計算機程式設計期末考試題, 6/22/2012 共 13 頁, 滿分 100 分外加最多 4 分 1. 參考下一頁的 UML 類別圖, 撰寫 C# 敘述達成下列要求 : ( 假設 using System; 敘述已經包含於程式中 ), 均不需處理例外情況 (a) 撰寫結構 Point, 包含兩個公有 int 變數 x y, 代表點座標 (x,y) 另寫正規建構式分別設定 x y 之值 (3%)

More information

Microsoft Word - CPFinal2010Spring

Microsoft Word - CPFinal2010Spring 通識計算機程式設計期末考試題, 6/25/2010 共 12 頁, 滿分 100 分外加最多 4 分 1. 撰寫 C# 敘述達成下列要求 : ( 假設 using System; 敘述已經包含於程式中 ) (a) 撰寫類別程式 Rhombus 代表菱形, 其中宣告私有 double 變數 d1 d2, 分別代表兩互相垂直的對角線長, 另有建構式設定 d1 d2 之值, 屬性 D1 D2 分別傳回與設定

More information

Object-Oriented Programming, Mid-term Test, 11/21/2000

Object-Oriented Programming, Mid-term Test, 11/21/2000 通識計算機程式設計期末考試題參考解答, 6/25/2010 1. 撰寫 C# 敘述達成下列要求 : ( 假設 using System; 敘述已經包含於程式中 ) (a) 撰寫類別程式 Rhombus 代表菱形, 其中宣告私有 double 變數 d1 d2, 分別代表兩互相垂直的對角線長, 另有建構式設定 d1 d2 之值, 屬性 D1 D2 分別傳回與設定 d1 d2 之值, 此處可先不處理例外情況

More information

untitled

untitled 1 Outline 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 A-Z a-z _ () 不 數 0-9 數 不 數 SCHOOL School school 數 讀 school_name schoolname 易 不 C# my name 7_eleven B&Q new C# (1) public protected private params override

More information

CHAPTER VC#

CHAPTER VC# 1. 2. 3. 4. CHAPTER 2-1 2-2 2-3 2-4 VC# 2-5 2-6 2-7 2-8 Visual C# 2008 2-1 Visual C# 0~100 (-32768~+32767) 2 4 VC# (Overflow) 2-1 2-2 2-1 2-1.1 2-1 1 10 10!(1 10) 2-3 Visual C# 2008 10! 32767 short( )

More information

新・解きながら学ぶJava

新・解きながら学ぶJava 481! 41, 74!= 40, 270 " 4 % 23, 25 %% 121 %c 425 %d 121 %o 121 %x 121 & 199 && 48 ' 81, 425 ( ) 14, 17 ( ) 128 ( ) 183 * 23 */ 3, 390 ++ 79 ++ 80 += 93 + 22 + 23 + 279 + 14 + 124 + 7, 148, 16 -- 79 --

More information

Microsoft Word - 第3章.doc

Microsoft Word - 第3章.doc Java C++ Pascal C# C# if if if for while do while foreach while do while C# 3.1.1 ; 3-1 ischeck Test() While ischeck while static bool ischeck = true; public static void Test() while (ischeck) ; ischeck

More information

《大话设计模式》第一章

《大话设计模式》第一章 第 1 章 代 码 无 错 就 是 优? 简 单 工 厂 模 式 1.1 面 试 受 挫 小 菜 今 年 计 算 机 专 业 大 四 了, 学 了 不 少 软 件 开 发 方 面 的 东 西, 也 学 着 编 了 些 小 程 序, 踌 躇 满 志, 一 心 要 找 一 个 好 单 位 当 投 递 了 无 数 份 简 历 后, 终 于 收 到 了 一 个 单 位 的 面 试 通 知, 小 菜 欣 喜

More information

Object-Oriented Programming, Mid-term Test, 11/21/2000

Object-Oriented Programming, Mid-term Test, 11/21/2000 通識計算機程式設計期中考試題參考解答, 4/17/2009 1. 撰寫一或數個 C# 敘述達成下列要求 : ( 假設 using System; 敘述已經包含於程式中 ) (a) 宣告 int 變數 x, bool 變數 b, double 常數 F = 7.0. (3%) int x; bool b; const double F = 7.0; (b) 在螢幕顯示一行字, 要求使用者輸入一個整數.

More information

untitled

untitled 1 Outline ArrayList 類 列類 串類 類 類 例 理 MSDN Library MSDN Library 量 例 參 列 [ 說 ] [] [ 索 ] [] 來 MSDN Library 了 類 類 利 F1 http://msdn.microsoft.com/library/ http://msdn.microsoft.com/library/cht/ Object object

More information

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

KillTest 质量更高 服务更好 学习资料   半年免费更新服务 KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 70-536Chinese(C++) Title : TS:MS.NET Framework 2.0-Application Develop Foundation Version : DEMO 1 / 10 1. Exception A. Data B. Message C.

More information

Microsoft Word - 01.DOC

Microsoft Word - 01.DOC 第 1 章 JavaScript 简 介 JavaScript 是 NetScape 公 司 为 Navigator 浏 览 器 开 发 的, 是 写 在 HTML 文 件 中 的 一 种 脚 本 语 言, 能 实 现 网 页 内 容 的 交 互 显 示 当 用 户 在 客 户 端 显 示 该 网 页 时, 浏 览 器 就 会 执 行 JavaScript 程 序, 用 户 通 过 交 互 式 的

More information

前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii

前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii 前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii C# 7 More Effective C# C# C# C# C# C# Common Language Runtime CLR just-in-time

More information

第一章 章标题-F2 上空24,下空24

第一章 章标题-F2 上空24,下空24 2 C# C# C#.NET ASP.NET C# C# C# 2.1 C# C#.NET.NET C#.NET C# CLR C#.NET 2.1.1 C# C# C++ Visual Basic C# C++ C++ C# C#.NET C# C C++ C#. C# C# C# C# 2.1.2 C# C# 2-01.cs C# 2-01.cs class Hello{ public static

More information

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

KillTest 质量更高 服务更好 学习资料   半年免费更新服务 KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 310-055Big5 Title : Sun Certified Programmer for the Java 2 Platform.SE 5.0 Version : Demo 1 / 22 1. 11. public static void parse(string str)

More information

untitled

untitled 1 MSDN Library MSDN Library 量 例 參 列 [ 說 ] [] [ 索 ] [] 來 MSDN Library 了 類 類 利 F1 http://msdn.microsoft.com/library/ http://msdn.microsoft.com/library/cht/ Object object 參 類 都 object 參 object Boxing 參 boxing

More information

untitled

untitled 1 Outline 類别 欄 (1) 類 類 狀 更 易 類 理 若 類 利 來 利 using 來 namespace 類 ; (2) namespace IBM class Notebook namespace Compaq class Notebook 類别 類 來 類 列 欄 (field) (property) (method) (event) 類 例 立 來 車 類 類 立 車 欄 料

More information

Microsoft Word - CPMidTerm2010SpringSolution

Microsoft Word - CPMidTerm2010SpringSolution 通識計算機程式設計期中考參考解答, 4/23/2010 1. (a) 宣告 double 變數 z, bool 變數 b, int 變數 i (3%) 答 : double z; bool b; (b) 在螢幕顯示一行字, 要求使用者輸入一個浮點數. (3%) 答 : Console.WriteLine(" 輸入一個浮點數 "); (c) 自鍵盤讀入一個浮點數., 並將其值存入已宣告之 double

More information

Microsoft Word - ch04三校.doc

Microsoft Word - ch04三校.doc 4-1 4-1-1 (Object) (State) (Behavior) ( ) ( ) ( method) ( properties) ( functions) 4-2 4-1-2 (Message) ( ) ( ) ( ) A B A ( ) ( ) ( YourCar) ( changegear) ( lowergear) 4-1-3 (Class) (Blueprint) 4-3 changegear

More information

Microsoft Office SharePoint Server MOSS Web SharePoint Web SharePoint 22 Web SharePoint Web Web SharePoint Web Web f Lists.asmx Web Web CAML f

Microsoft Office SharePoint Server MOSS Web SharePoint Web SharePoint 22 Web SharePoint Web Web SharePoint Web Web f Lists.asmx Web Web CAML f Web Chapter 22 SharePoint Web Microsoft Office SharePoint Server MOSS Web SharePoint Web SharePoint 22 Web 21 22-1 SharePoint Web Web SharePoint Web Web f Lists.asmx Web Web CAML f Views.asmx View SharePoint

More information

Chapter 9: Objects and Classes

Chapter 9: Objects and Classes Fortran Algol Pascal Modula-2 BCPL C Simula SmallTalk C++ Ada Java C# C Fortran 5.1 message A B 5.2 1 class Vehicle subclass Car object mycar public class Vehicle extends Object{ public int WheelNum

More information

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

KillTest 质量更高 服务更好 学习资料   半年免费更新服务 KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 310-065Big5 Title : Sun Certified Programmer for the Java 2 Platform, SE 6.0 Version : Demo 1 / 14 1. 35. String #name = "Jane Doe"; 36. int

More information

Microsoft PowerPoint - EmbSys102_JavaOOP [相容模式]

Microsoft PowerPoint - EmbSys102_JavaOOP [相容模式] 嵌入式系統及實驗 Embedded System and Experiment 詹曉龍 長庚大學電機系 Java 的類別與物件 : 宣告類別 建構子 public class Customer { // Customer 類別宣告 private String name; // 成員資料 private String address; public int age; // 建構子 : 使用參數設定成員資料初始值

More information

untitled

untitled Inside ASP.NET 2.0- ASP.NET 1.1 2. 理念 讀 了 了 度 讀 了 理 類 來 來說 流 了 來 來 來 來 理 來 不 讀 不 不 力 來參 流 讀 了 異 行 來了 錄 行 不 了 來 了 來 行 論說 了 更 不 例 來了 力 行 樂 不 說 兩 例 利 來 了 來 樂 了 了 令 讀 來 不 不 來 了 不 旅行 令 錄 錄 來 了 例 來 利 來 ManagerProvide

More information

新版 明解C++入門編

新版 明解C++入門編 511!... 43, 85!=... 42 "... 118 " "... 337 " "... 8, 290 #... 71 #... 413 #define... 128, 236, 413 #endif... 412 #ifndef... 412 #if... 412 #include... 6, 337 #undef... 413 %... 23, 27 %=... 97 &... 243,

More information

投影片 1

投影片 1 資料庫管理程式 ( 補充教材 -Part2) 使用 ADO.NET 連結資料庫 ( 自行撰寫程式碼 以實現新增 刪除 修改等功能 ) Private Sub InsertButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InsertButton.Click ' 宣告相關的 Connection

More information

untitled

untitled 1 7 7.1 7.2 7.3 7.4 7.5 2 7.1 VFT virtual 7.1 3 1 1. 2. public protected public 3. VFT 4. this const volatile 4 2 5. ( ) ( ) 7.1 6. no-static virtual 7.2 7. inline 7.3 5 3 8. this this 9. ( ) ( ) delete

More information

Microsoft Word - CPMidTerm2011Spring

Microsoft Word - CPMidTerm2011Spring 通識計算機程式設計期中考試題, 4/22/2011 共 8 頁, 滿分 100 分 1. 撰寫一或數個 C# 敘述達成下列要求 : ( 假設 using System; 敘述已經包含於程式中 ) (a) 宣告 int 變數 k, bool 變數 b, double 變數 x (3%) (b) 在螢幕顯示一行字, 要求使用者輸入一個整數 (3%) (c) 自鍵盤讀入一個整數., 並將其值存入已宣告之

More information

1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F

1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F 1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET 2.0 2.0.NET Framework.NET Framework 2.0 ( 3).NET Framework 2.0.NET Framework ( System ) o o o o o o Boxing UnBoxing() o

More information

主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new

主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new ListView 自訂排版 主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new int[]{r.drawable.dog1, R.drawable.dog2,

More information

CHAPTER 1

CHAPTER 1 CHAPTER 1 1-1 System Development Life Cycle; SDLC SDLC Waterfall Model Shelly 1995 1. Preliminary Investigation 2. System Analysis 3. System Design 4. System Development 5. System Implementation and Evaluation

More information

3.1 num = 3 ch = 'C' 2

3.1 num = 3 ch = 'C' 2 Java 1 3.1 num = 3 ch = 'C' 2 final 3.1 final : final final double PI=3.1415926; 3 3.2 4 int 3.2 (long int) (int) (short int) (byte) short sum; // sum 5 3.2 Java int long num=32967359818l; C:\java\app3_2.java:6:

More information

untitled

untitled 1 Outline 料 類 說 Tang, Shih-Hsuan 2006/07/26 ~ 2006/09/02 六 PM 7:00 ~ 9:30 聯 ives.net@gmail.com www.csie.ntu.edu.tw/~r93057/aspnet134 度 C# 力 度 C# Web SQL 料 DataGrid DataList 參 ASP.NET 1.0 C# 例 ASP.NET 立

More information

提问袁小兵:

提问袁小兵: C++ 面 试 试 题 汇 总 柯 贤 富 管 理 软 件 需 求 分 析 篇 1. STL 类 模 板 标 准 库 中 容 器 和 算 法 这 部 分 一 般 称 为 标 准 模 板 库 2. 为 什 么 定 义 虚 的 析 构 函 数? 避 免 内 存 问 题, 当 你 可 能 通 过 基 类 指 针 删 除 派 生 类 对 象 时 必 须 保 证 基 类 析 构 函 数 为 虚 函 数 3.

More information

Chapter12 Derived Classes

Chapter12   Derived Classes 继 承 -- 派 生 类 复 习 1. 有 下 面 类 的 说 明, 有 错 误 的 语 句 是 : class X { A) const int a; B) X(); C) X(int val) {a=2 D) ~X(); 答 案 :C 不 正 确, 应 改 成 X(int val) : a(2) { 2. 下 列 静 态 数 据 成 员 的 特 性 中, 错 误 的 是 A) 说 明 静 态 数

More information

Microsoft Word - CPMidTerm2011SpringSolution

Microsoft Word - CPMidTerm2011SpringSolution 通識計算機程式設計期中考參考解答, 4/22/2011 1. (a) 宣告 int 變數 k, bool 變數 b, double 變數 x (3%) 答 : int k; bool b; double x; (b) 在螢幕顯示一行字, 要求使用者輸入一個整數 (3%) 答 : Console.WriteLine(" 輸入一個整數 "); (c) 自鍵盤讀入一個整數., 並將其值存入已宣告之 int

More information

untitled

untitled 1 行 行 行 行.NET 行 行 類 來 行 行 Thread 類 行 System.Threading 來 類 Thread 類 (1) public Thread(ThreadStart start ); Name 行 IsAlive 行 行狀 Start 行 行 Suspend 行 Resume 行 行 Thread 類 (2) Sleep 行 CurrentThread 行 ThreadStart

More information

<4D6963726F736F667420576F7264202D20C8EDC9E82DCFC2CEE7CCE22D3039C9CF>

<4D6963726F736F667420576F7264202D20C8EDC9E82DCFC2CEE7CCE22D3039C9CF> 全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 考 试 2009 年 上 半 年 软 件 设 计 师 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 请 按 下 述 要 求 正 确 填 写 答 题 纸 1. 在 答 题 纸 的 指 定 位 置 填 写 你 所 在 的 省 自 治 区 直 辖 市 计 划 单 列 市 的 名 称 2. 在 答

More information

エスポラージュ株式会社 住所 : 東京都江東区大島 東急ドエルアルス大島 HP: ******************* * 关于 Java 测试试题 ******

エスポラージュ株式会社 住所 : 東京都江東区大島 東急ドエルアルス大島 HP:  ******************* * 关于 Java 测试试题 ****** ******************* * 关于 Java 测试试题 ******************* 問 1 运行下面的程序, 选出一个正确的运行结果 public class Sample { public static void main(string[] args) { int[] test = { 1, 2, 3, 4, 5 ; for(int i = 1 ; i System.out.print(test[i]);

More information

FY.DOC

FY.DOC 高 职 高 专 21 世 纪 规 划 教 材 C++ 程 序 设 计 邓 振 杰 主 编 贾 振 华 孟 庆 敏 副 主 编 人 民 邮 电 出 版 社 内 容 提 要 本 书 系 统 地 介 绍 C++ 语 言 的 基 本 概 念 基 本 语 法 和 编 程 方 法, 深 入 浅 出 地 讲 述 C++ 语 言 面 向 对 象 的 重 要 特 征 : 类 和 对 象 抽 象 封 装 继 承 等 主

More information

The Embedded computing platform

The Embedded computing platform 嵌入式系統及實驗 Embedded System and Experiment 詹曉龍 長庚大學電機系 Java 的類別與物件 : 宣告類別 建構子 public class Customer { private String name; private String address; // Customer 類別宣告 // 成員資料 public int age; // 建構子 : 使用參數設定成員資料初始值

More information

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

KillTest 质量更高 服务更好 学习资料   半年免费更新服务 KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 1Z0-854 Title : Java Standard Edition 5 Programmer Certified Professional Upgrade Exam Version : Demo 1 / 12 1.Given: 20. public class CreditCard

More information

使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款

使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款 JAVA 程 序 设 计 ( 肆 ) 徐 东 / 数 学 系 使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款 使 用 Java class 代 表 保 险 箱 public class SaveBox 类 名 类 类 体 实 现 封 装 性 使 用 class SaveBox 代 表 保

More information

untitled

untitled 3 C++ 3.1 3.2 3.3 3.4 new delete 3.5 this 3.6 3.7 3.1 3.1 class struct union struct union C class C++ C++ 3.1 3.1 #include struct STRING { typedef char *CHARPTR; // CHARPTR s; // int strlen(

More information

EJB-Programming-4-cn.doc

EJB-Programming-4-cn.doc EJB (4) : (Entity Bean Value Object ) JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Session Bean J2EE Session Façade Design Pattern Session Bean Session

More information

(TestFailure) JUnit Framework AssertionFailedError JUnit Composite TestSuite Test TestSuite run() run() JUnit

(TestFailure) JUnit Framework AssertionFailedError JUnit Composite TestSuite Test TestSuite run() run() JUnit Tomcat Web JUnit Cactus JUnit Java Cactus JUnit 26.1 JUnit Java JUnit JUnit Java JSP Servlet JUnit Java Erich Gamma Kent Beck xunit JUnit boolean JUnit Java JUnit Java JUnit Java 26.1.1 JUnit JUnit How

More information

Strings

Strings Polymorphism and Virtual Functions Cheng-Chin Chiang Virtual Function Basics 多 型 (Polymorphism) 賦 予 一 個 函 數 多 種 意 涵, 存 在 於 同 一 類 別 之 內 祖 先 類 別 與 後 代 類 別 間 物 件 導 向 程 式 設 計 基 本 原 理 虛 擬 函 數 (Virtual Function)

More information

untitled

untitled 4.1AOP AOP Aspect-oriented programming AOP 來說 AOP 令 理 Cross-cutting concerns Aspect Weave 理 Spring AOP 來 AOP 念 4.1.1 理 AOP AOP 見 例 來 例 錄 Logging 錄 便 來 例 行 留 錄 import java.util.logging.*; public class HelloSpeaker

More information

<4D6963726F736F667420506F776572506F696E74202D20332D322E432B2BC3E6CFF2B6D4CFF3B3CCD0F2C9E8BCC6A1AAD6D8D4D8A1A2BCCCB3D0A1A2B6E0CCACBACDBEDBBACF2E707074>

<4D6963726F736F667420506F776572506F696E74202D20332D322E432B2BC3E6CFF2B6D4CFF3B3CCD0F2C9E8BCC6A1AAD6D8D4D8A1A2BCCCB3D0A1A2B6E0CCACBACDBEDBBACF2E707074> 程 序 设 计 实 习 INFO130048 3-2.C++ 面 向 对 象 程 序 设 计 重 载 继 承 多 态 和 聚 合 复 旦 大 学 计 算 机 科 学 与 工 程 系 彭 鑫 pengxin@fudan.edu.cn 内 容 摘 要 方 法 重 载 类 的 继 承 对 象 引 用 和 拷 贝 构 造 函 数 虚 函 数 和 多 态 性 类 的 聚 集 复 旦 大 学 计 算 机 科 学

More information

Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0,

Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0, http://debut.cis.nctu.edu.tw/~chi Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0, : POSITIVE_INFINITY NEGATIVE_INFINITY

More information

ASP.NET MVC Visual Studio MVC MVC 範例 1-1 建立第一個 MVC 專案 Visual Studio MVC step 01 Visual Studio Web ASP.NET Web (.NET Framework) step 02 C:\M

ASP.NET MVC Visual Studio MVC MVC 範例 1-1 建立第一個 MVC 專案 Visual Studio MVC step 01 Visual Studio Web ASP.NET Web (.NET Framework) step 02 C:\M ASP.NET MVC Visual Studio 2017 1 1-4 MVC MVC 範例 1-1 建立第一個 MVC 專案 Visual Studio MVC step 01 Visual Studio Web ASP.NET Web (.NET Framework) step 02 C:\MvcExamples firstmvc MVC 1-7 ASP.NET MVC 1-9 ASP.NET

More information

第一章 章标题-F2 上空24,下空24

第一章 章标题-F2 上空24,下空24 Web 9 XML.NET Web Web Service Web Service Web Service Web Service Web Service ASP.NET Session Application SOAP Web Service 9.1 Web Web.NET Web Service Web SOAP Simple Object Access Protocol 9.1.1 Web Web

More information

javaexample-02.pdf

javaexample-02.pdf n e w. s t a t i c s t a t i c 3 1 3 2 p u b l i c p r i v a t e p r o t e c t e d j a v a. l a n g. O b j e c t O b j e c t Rect R e c t x 1 y 1 x 2 y 2 R e c t t o S t r i n g ( ) j a v a. l a n g. O

More information

概述

概述 OPC Version 1.6 build 0910 KOSRDK Knight OPC Server Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOS_Init...5 2.2.2 KOS_InitB...5 2.2.3

More information

第3章.doc

第3章.doc 3 3 3 3.1 3 IT Trend C++ Java SAP Advantech ERPCRM C++ C++ Synopsys C++ NEC C C++PHP C++Java C++Java VIA C++ 3COM C++ SPSS C++ Sybase C++LinuxUNIX Motorola C++ IBM C++Java Oracle Java HP C++ C++ Yahoo

More information

untitled

untitled 1 .NET 利 [] [] 來 說 切 切 理 [] [ ] 來 說 拉 類 類 [] [ ] 列 連 Web 行流 來 了 不 不 不 流 立 行 Page 類 Load 理 Response 類 Write 料 Redirect URL Response.Write("!! ives!!"); Response.Redirect("WebForm2.aspx"); (1) (2) Web Form

More information

JavaIO.PDF

JavaIO.PDF O u t p u t S t ream j a v a. i o. O u t p u t S t r e a m w r i t e () f l u s h () c l o s e () public abstract void write(int b) throws IOException public void write(byte[] data) throws IOException

More information

運算子多載 Operator Overloading

運算子多載 Operator Overloading 多型 Polymorphism 講師 : 洪安 1 多型 編譯時期多型 ( 靜態多型 ) function overloading 如何正確呼叫同名的函數? 利用參數個數與型態 operator overloading 其實同 function overloading 執行時期多型 ( 或動態多型 ) 如何正確呼叫不同物件的相同名稱的成員函數 利用繼承與多型 2 子類別與父類別物件間的指定 (assignment)

More information

java2d-4.PDF

java2d-4.PDF 75 7 6 G r a d i e n t P a i n t B a s i c S t r o k e s e t P a i n t ( ) s e t S t o r k e ( ) import java.awt.*; import java.awt.geom.*; public class PaintingAndStroking extends ApplicationFrame { public

More information

(Microsoft Word - wes _\246p\246\363\250\317\245\316LED\277O\305\343\245\334\252\254\272A.doc)

(Microsoft Word - wes _\246p\246\363\250\317\245\316LED\277O\305\343\245\334\252\254\272A.doc) 作者 Amber 版本 1.0.0 日期 2012/04/25 頁數 1/7 如何使用 LED 燈顯示狀態? 適用於 : 平台 作業系統版本 XPAC utility 版本 XP-8000 系列 N/A N/A XP-8000-Atom 系列 WES2009 所有版本 N/A: Not applicable to this platform and OS. 注意! 欲變更系統的任何設定之前, 請先關閉

More information

Strings

Strings Inheritance Cheng-Chin Chiang Relationships among Classes A 類 別 使 用 B 類 別 學 生 使 用 手 機 傳 遞 訊 息 公 司 使 用 金 庫 儲 存 重 要 文 件 人 類 使 用 交 通 工 具 旅 行 A 類 別 中 有 B 類 別 汽 車 有 輪 子 三 角 形 有 三 個 頂 點 電 腦 內 有 中 央 處 理 單 元 A

More information

任務二 : 產生 20 個有炸彈的磚塊, 放在隨機的位置編輯 Block 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) Write a description of class

任務二 : 產生 20 個有炸彈的磚塊, 放在隨機的位置編輯 Block 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) Write a description of class 踩地雷遊戲 高慧君南港高中 開啟專案 MineSweep 任務一 : 產生 30X20 個磚塊編輯 Table 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) import java.util.arraylist; Write a description of class MyWorld

More information

C 1

C 1 C homepage: xpzhangme 2018 5 30 C 1 C min(x, y) double C // min c # include # include double min ( double x, double y); int main ( int argc, char * argv []) { double x, y; if( argc!=

More information

C++ 程序设计 告别 OJ1 - 参考答案 MASTER 2019 年 5 月 3 日 1

C++ 程序设计 告别 OJ1 - 参考答案 MASTER 2019 年 5 月 3 日 1 C++ 程序设计 告别 OJ1 - 参考答案 MASTER 2019 年 月 3 日 1 1 INPUTOUTPUT 1 InputOutput 题目描述 用 cin 输入你的姓名 ( 没有空格 ) 和年龄 ( 整数 ), 并用 cout 输出 输入输出符合以下范例 输入 master 999 输出 I am master, 999 years old. 注意 "," 后面有一个空格,"." 结束,

More information

untitled

untitled 1 Outline 流 ( ) 流 ( ) 流 ( ) 流 ( ) 流 ( ) 狀 流 ( ) 利 來 行流 if () 立 行 ; else 不 立 行 ; 例 sample2-a1 (1) 列 // 料 Console.Write(""); string name = Console.ReadLine(); Console.WriteLine(" " + name + "!!"); 例 sample2-a1

More information

Microsoft Word - CPMidTerm2012SpringSolution

Microsoft Word - CPMidTerm2012SpringSolution 通識計算機程式設計期中考參考解答, 4/20/2012 1. 撰寫一或數個 C# 敘述達成下列要求 : ( 假設 using System; 敘述已經包含於程式中 ) (a) 宣告 int 變數 k, bool 變數 b, double 變數 x (3%) int k; bool b; double x; (b) 在螢幕顯示一行字, 要求使用者輸入一個浮點數 (3%) Console.WriteLine("

More information

chp6.ppt

chp6.ppt Java 软 件 设 计 基 础 6. 异 常 处 理 编 程 时 会 遇 到 如 下 三 种 错 误 : 语 法 错 误 (syntax error) 没 有 遵 循 语 言 的 规 则, 出 现 语 法 格 式 上 的 错 误, 可 被 编 译 器 发 现 并 易 于 纠 正 ; 逻 辑 错 误 (logic error) 即 我 们 常 说 的 bug, 意 指 编 写 的 代 码 在 执 行

More information

全国计算机技术与软件专业技术资格(水平)考试

全国计算机技术与软件专业技术资格(水平)考试 全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 ) 考 试 2008 年 上 半 年 程 序 员 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 ) 试 题 一 ( 共 15 分 ) 阅 读 以 下 说 明 和 流 程 图, 填 补 流 程 图 中 的 空 缺 (1)~(9), 将 解 答 填 入 答 题 纸 的 对 应 栏 内 [ 说 明

More information

Chapter 9: Objects and Classes

Chapter 9: Objects and Classes Java application Java main applet Web applet Runnable Thread CPU Thread 1 Thread 2 Thread 3 CUP Thread 1 Thread 2 Thread 3 ,,. (new) Thread (runnable) start( ) CPU (running) run ( ) blocked CPU sleep(

More information

软件工程文档编制

软件工程文档编制 实训抽象类 一 实训目标 掌握抽象类的定义 使用 掌握运行时多态 二 知识点 抽象类的语法格式如下 : public abstract class ClassName abstract void 方法名称 ( 参数 ); // 非抽象方法的实现代码 在使用抽象类时需要注意如下几点 : 1 抽象类不能被实例化, 实例化的工作应该交由它的子类来完成 2 抽象方法必须由子类来进行重写 3 只要包含一个抽象方法的抽象类,

More information

詞 彙 表 編 號 詞 彙 描 述 1 預 約 人 資 料 中 文 姓 名 英 文 姓 名 身 份 證 字 號 預 約 人 電 話 性 別 2 付 款 資 料 信 用 卡 別 信 用 卡 號 信 用 卡 有 效 日 期 3 住 房 條 件 入 住 日 期 退 房 日 期 人 數 房 間 數 量 入

詞 彙 表 編 號 詞 彙 描 述 1 預 約 人 資 料 中 文 姓 名 英 文 姓 名 身 份 證 字 號 預 約 人 電 話 性 別 2 付 款 資 料 信 用 卡 別 信 用 卡 號 信 用 卡 有 效 日 期 3 住 房 條 件 入 住 日 期 退 房 日 期 人 數 房 間 數 量 入 100 年 特 種 考 試 地 方 政 府 公 務 人 員 考 試 試 題 等 別 : 三 等 考 試 類 科 : 資 訊 處 理 科 目 : 系 統 分 析 與 設 計 一 請 參 考 下 列 旅 館 管 理 系 統 的 使 用 案 例 圖 (Use Case Diagram) 撰 寫 預 約 房 間 的 使 用 案 例 規 格 書 (Use Case Specification), 繪 出 入

More information

Visual Basic D 3D

Visual Basic D 3D Visual Basic 2008 2D 3D 6-1 6-1 - 6-2 - 06 6-2 STEP 1 5-2 (1) STEP 2 5-3 (2) - 6-3 - Visual Basic 2008 2D 3D STEP 3 User1 6-4 (3) STEP 4 User1 6-5 (4) - 6-4 - 06 STEP 5 6-6 (5) 6-3 6-3-1 (LoginForm) PictureBox1

More information

(6) 要 求 付 款 管 理 员 从 预 订 表 中 查 询 距 预 订 的 会 议 时 间 两 周 内 的 预 定, 根 据 客 户 记 录 给 满 足 条 件 的 客 户 发 送 支 付 余 款 要 求 (7) 支 付 余 款 管 理 员 收 到 客 户 余 款 支 付 的 通 知 后, 检

(6) 要 求 付 款 管 理 员 从 预 订 表 中 查 询 距 预 订 的 会 议 时 间 两 周 内 的 预 定, 根 据 客 户 记 录 给 满 足 条 件 的 客 户 发 送 支 付 余 款 要 求 (7) 支 付 余 款 管 理 员 收 到 客 户 余 款 支 付 的 通 知 后, 检 2016 年 上 半 年 软 件 设 计 师 考 试 真 题 ( 下 午 题 ) 下 午 试 题 试 题 一 ( 共 15 分 ) 阅 读 下 列 说 明 和 图, 回 答 问 题 1 至 问 题 4, 将 解 答 填 入 答 题 纸 的 对 应 栏 内 说 明 某 会 议 中 心 提 供 举 办 会 议 的 场 地 设 施 和 各 种 设 备, 供 公 司 与 各 类 组 织 机 构 租 用 场

More information

Python a p p l e b e a r c Fruit Animal a p p l e b e a r c 2-2

Python a p p l e b e a r c Fruit Animal a p p l e b e a r c 2-2 Chapter 02 變數與運算式 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.2 2.2.1 2.2.2 2.2.3 type 2.2.4 2.3 2.3.1 print 2.3.2 input 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 + 2.4.6 Python Python 2.1 2.1.1 a p p l e b e a r c 65438790

More information

2 WF 1 T I P WF WF WF WF WF WF WF WF 2.1 WF WF WF WF WF WF

2 WF 1 T I P WF WF WF WF WF WF WF WF 2.1 WF WF WF WF WF WF Chapter 2 WF 2.1 WF 2.2 2. XAML 2. 2 WF 1 T I P WF WF WF WF WF WF WF WF 2.1 WF WF WF WF WF WF WF WF WF WF EDI API WF Visual Studio Designer 1 2.1 WF Windows Workflow Foundation 2 WF 1 WF Domain-Specific

More information

1: public class MyOutputStream implements AutoCloseable { 3: public void close() throws IOException { 4: throw new IOException(); 5: } 6:

1: public class MyOutputStream implements AutoCloseable { 3: public void close() throws IOException { 4: throw new IOException(); 5: } 6: Chapter 15. Suppressed Exception CH14 Finally Block Java SE 7 try-with-resources JVM cleanup try-with-resources JVM cleanup cleanup Java SE 7 Throwable getsuppressed Throwable[] getsuppressed() Suppressed

More information

untitled

untitled 1 .NET sln csproj dll cs aspx 說 料 料 利 來 料 ( 來 ) 利 [] [] 來 說 切 切 理 [] [ ] 來 說 拉 類 類 [] [ ] 列 連 Web 行流 來 了 不 不 不 流 立 行 Page 類 Load 理 Click 滑 料 Response 列 料 Response HttpResponse 類 Write 料 Redirect URL Response.Write("!!

More information

用手機直接傳值不透過網頁連接, 來當作搖控器控制家電 ( 電視遙控器 ) 按下按鍵發送同時會回傳值來確定是否有送出 問題 :1. 應該是使用了太多 thread 導致在傳值上有問題 2. 一次按很多次按鈕沒辦法即時反應

用手機直接傳值不透過網頁連接, 來當作搖控器控制家電 ( 電視遙控器 ) 按下按鍵發送同時會回傳值來確定是否有送出 問題 :1. 應該是使用了太多 thread 導致在傳值上有問題 2. 一次按很多次按鈕沒辦法即時反應 專題進度 老師 : 趙啟時老師 學生 : 陳建廷 2013/10/13 用手機直接傳值不透過網頁連接, 來當作搖控器控制家電 ( 電視遙控器 ) 按下按鍵發送同時會回傳值來確定是否有送出 問題 :1. 應該是使用了太多 thread 導致在傳值上有問題 2. 一次按很多次按鈕沒辦法即時反應 程式碼 : package com.example.phone; import java.util.arraylist;

More information

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 Java V1.0.1 2007 4 10 1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 6.2.10 6.3..10 6.4 11 7.12 7.1

More information

OOP with Java 通知 Project 3 提交时间 3 月 29 日晚 9 点 Piazza Project 2 投票

OOP with Java 通知 Project 3 提交时间 3 月 29 日晚 9 点 Piazza Project 2 投票 OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 3 提交时间 3 月 29 日晚 9 点 Piazza Project 2 投票 复习 创建对象 构造函数 函数重载 : 函数 = 函数名 + 参数列表 public class MyType { int i; double d; char c; void set(double x)

More information

Microsoft PowerPoint - P766Ch06.ppt

Microsoft PowerPoint - P766Ch06.ppt PHP5&MySQL 程式設計 第 6 章物件導向 6-1 認識物件導向 物件 (object) 或 案例 (instance) 屬性 (property) 欄位 (field) 或 成員變數 (member variable) 方法 (method) 或 成員函式 (member function) 事件 (event) 類別 (class) 物件導向程式設計 (OOP) 具有下列特點 : 封裝

More information

1 1 大概思路 创建 WebAPI 创建 CrossMainController 并编写 Nuget 安装 microsoft.aspnet.webapi.cors 跨域设置路由 编写 Jquery EasyUI 界面 运行效果 2 创建 WebAPI 创建 WebAPI, 新建 -> 项目 ->

1 1 大概思路 创建 WebAPI 创建 CrossMainController 并编写 Nuget 安装 microsoft.aspnet.webapi.cors 跨域设置路由 编写 Jquery EasyUI 界面 运行效果 2 创建 WebAPI 创建 WebAPI, 新建 -> 项目 -> 目录 1 大概思路... 1 2 创建 WebAPI... 1 3 创建 CrossMainController 并编写... 1 4 Nuget 安装 microsoft.aspnet.webapi.cors... 4 5 跨域设置路由... 4 6 编写 Jquery EasyUI 界面... 5 7 运行效果... 7 8 总结... 7 1 1 大概思路 创建 WebAPI 创建 CrossMainController

More information

Microsoft Word - 投影片ch11

Microsoft Word - 投影片ch11 Java2 JDK5.0 教學手冊第三版洪維恩編著博碩文化出版書號 pg20210 第十一章抽象類別與介面 本章學習目標認識抽象類別學習介面的使用認識多重繼承與介面的延伸 抽象類別與介面 11-2 11.1 抽象類別 抽象類別的目的是要依據它的格式來修改並建立新的類別 11.1.1 定義抽象類別 定義抽象類別的語法如下 : abstract class 類別名稱 { 宣告資料成員 ; // 定義抽象類別

More information

Microsoft Word - C-pgm-ws2010.doc

Microsoft Word - C-pgm-ws2010.doc Information and Communication Technology 資訊與通訊科技 Loops (while/for) C 廻路 姓名 : 班別 : ( ) CS C Programming #1 Functions 函數 : 1 若 n=14, 求以下表示式的值 Expressions 表示式 Value 值 Expressions 表示式 Value 值 A 20 2 * (n /

More information

CC213

CC213 : (Ken-Yi Lee), E-mail: feis.tw@gmail.com 49 [P.51] C/C++ [P.52] [P.53] [P.55] (int) [P.57] (float/double) [P.58] printf scanf [P.59] [P.61] ( / ) [P.62] (char) [P.65] : +-*/% [P.67] : = [P.68] : ,

More information

基于ECO的UML模型驱动的数据库应用开发1.doc

基于ECO的UML模型驱动的数据库应用开发1.doc ECO UML () Object RDBMS Mapping.Net Framework Java C# RAD DataSetOleDbConnection DataGrod RAD Client/Server RAD RAD DataReader["Spell"].ToString() AObj.XXX bug sql UML OR Mapping RAD Lazy load round trip

More information

<ADB6ADB1C25EA8FAA6DB2D4D56432E706466>

<ADB6ADB1C25EA8FAA6DB2D4D56432E706466> packages 3-31 PART 3-31 03-03 ASP.NET ASP.N MVC ASP.NET ASP.N MVC 4 ASP.NET ASP.NE MVC Entity Entity Framework Code First 2 TIPS Visual Studio 20NuGetEntity NuGetEntity Framework5.0 CHAPTER 03 59 3-3-1

More information

Microsoft PowerPoint - L17_Inheritance_v4.pptx

Microsoft PowerPoint - L17_Inheritance_v4.pptx C++ Programming Lecture 17 Wei Liu ( 刘 威 ) Dept. of Electronics and Information Eng. Huazhong University of Science and Technology May. 2015 Lecture 17 Chapter 20. Object-Oriented Programming: Inheritance

More information

單步除錯 (1/10) 打開 Android Studio, 點選 Start a new Android Studio project 建立專案 Application name 輸入 BMI 點下 Next 2 P a g e

單步除錯 (1/10) 打開 Android Studio, 點選 Start a new Android Studio project 建立專案 Application name 輸入 BMI 點下 Next 2 P a g e Android Studio Debugging 本篇教學除了最基本的中斷點教學之外, 還有條件式中斷的教學 條件式中斷是進階的除錯技巧, 在某些特定情況中, 我們有一個函數可能會被呼叫數次, 但是我們只希望在某種條件成立時才進行中斷, 進而觀察變數的狀態 而條件式中斷這項技巧正是符合這項需求 本教學分兩部分 單步除錯 (Page2~11, 共 10) 條件式中斷點 (Page12~17, 共 6)

More information

c_cpp

c_cpp C C++ C C++ C++ (object oriented) C C++.cpp C C++ C C++ : for (int i=0;i

More information

C++ 程序设计 告别 OJ2 - 参考答案 MASTER 2019 年 5 月 3 日 1

C++ 程序设计 告别 OJ2 - 参考答案 MASTER 2019 年 5 月 3 日 1 C++ 程序设计 告别 OJ2 - 参考答案 MASTER 2019 年 5 月 3 日 1 1 TEMPLATE 1 Template 描述 使用模板函数求最大值 使用如下 main 函数对程序进行测试 int main() { double a, b; cin >> a >> b; cout c >> d; cout

More information

Microsoft PowerPoint - ch6 [相容模式]

Microsoft PowerPoint - ch6 [相容模式] UiBinder wzyang@asia.edu.tw UiBinder Java GWT UiBinder XML UI i18n (widget) 1 2 UiBinder HelloWidget.ui.xml: UI HelloWidgetBinder HelloWidget.java XML UI Owner class ( Composite ) UI XML UiBinder: Owner

More information

ASP.NET实现下拉框二级联动组件

ASP.NET实现下拉框二级联动组件 ASP.NET 实现下拉框二级联动组件 namespace WebApplicationDlh using System.Drawing; using System.Web; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using Db; / / Area 的摘要说明 /

More information

Microsoft Word - Learn Objective-C.doc

Microsoft Word - Learn Objective-C.doc Learn Objective C http://cocoadevcentral.com/d/learn_objectivec/ Objective C Objective C Mac C Objective CC C Scott Stevenson [object method]; [object methodwithinput:input]; output = [object methodwithoutput];

More information

OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数

OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数 OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数 复习 类的复用 组合 (composition): has-a 关系 class MyType { public int i; public double d; public char c; public void set(double

More information

untitled

untitled ADF Web ArcGIS Server ADF GeocodeConnection control 4-2 Web ArcGIS Server Application Developer Framework (ADF).NET interop semblies.net Web ADF GIS Server 4-3 .NET ADF Web Represent the views in ArcMap

More information

Mac Java import com.apple.mrj.*;... public class MyFirstApp extends JFrame implements ActionListener, MRJAboutHandler, MRJQuitHandler {... public MyFirstApp() {... MRJApplicationUtils.registerAboutHandler(this);

More information

Ch7_小組研討問題

Ch7_小組研討問題 105A 資管一程式設計實驗 08 陣列與向量謝明哲老師 hmz@nttu.edu.tw 1 程式設計實驗 08 陣列與向量 研討問題 05 5.1 使用 call by value 和 call by reference 進行函式呼叫有何差異? 請舉例說明, 為何 swap() 函式必須使用 call by reference 可以有效地將傳入參數的內容互換 ; 而 call by value 則無法達成

More information

EJB-Programming-3.PDF

EJB-Programming-3.PDF :, JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Value Object Design Pattern J2EE Design Patterns Value Object Value Object Factory J2EE EJB Test Client

More information

ebook39-5

ebook39-5 5 3 last-in-first-out, LIFO 3-1 L i n e a r L i s t 3-8 C h a i n 3 3. 8. 3 C + + 5.1 [ ] s t a c k t o p b o t t o m 5-1a 5-1a E D 5-1b 5-1b E E 5-1a 5-1b 5-1c E t o p D t o p D C C B B B t o p A b o

More information