版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、第一章 .Net概述一.填空1. C#語言不允許( ),從而避免了類型定義的混亂。2. 在( )狀態(tài)下,C#語言不能使用指針,而是使用委托(Delegate)來模擬指針的功能。3. 代碼編輯器窗口主要分為3個分區(qū),包括( )、指示器邊距和選定內容邊距。4. 在Visual Studio 2008中,用戶可以從安裝在計算機上的本地幫助以及Internet上的( )訪問產(chǎn)品文檔。5. 類設計器提供了三種功能,分別是設計、( )和重構類和類型。6. 解決方案是一個邏輯上的容器,包含構成應用程序的( )和其它文件。7. C#語言雖然從C/C+語言發(fā)展而來,但是它完全摒棄了C/C+語言中容易出錯的指針和
2、多重繼承等概念,是一種( )的,類型安全的語言。8. 在Visual Studio 2008中,使用“解決方案資源管理器”窗口來( )。9. “服務器資源管理器”窗口中的每個樹節(jié)點代表一個( )。10. “工具箱”窗口中包含了許多( ),使用戶在應用程序中方便快捷地使用它們。解答:1. 多重繼承2. 托管3. 代碼編輯區(qū)4. 聯(lián)機幫助5. 可視化6. 項目7. 完全面向對象8. 管理和監(jiān)視項目9. 服務器10. 可用控件二.簡答題1. C#語言的有何主要特點。2. C#語言的有何主要功能。3. C#集成開發(fā)環(huán)境主要有哪些窗口?4. 解決方案資源管理器窗口的功能。5. 服務器資源管理器窗口的功能
3、。6. 屬性窗口的功能。7. 工具箱窗口的功能。8. 錯誤列表窗口的功能。9. 什么是解決方案?10. 解決方案和項目之間的關系。解答:1. 語法簡潔;面向對象;與Web緊密結合;完全的安全性和錯誤處理;靈活性和兼容性。2. 設計Windows應用程序、設計控制臺應用程序、設計ASP.NET Web應用程序。3. 解決方案資源管理器窗口、服務器資源管理器窗口、工具箱窗口、屬性窗口、“類視圖”窗口、代碼編輯器窗口、任務列表窗口、錯誤列表窗口。4. 使用“解決方案資源管理器”窗口來管理和監(jiān)視項目。5. “服務器資源管理器”窗口負責維護數(shù)據(jù)連接,可對服務器進行管理。6. 在“屬性”窗口可以編輯和查看
4、控件、項目或類的特征屬性,以及在設計時查看并修改窗體設計器中被選中對象的屬性和事件。7. 在“工具箱”窗口中包含了許多可用控件,使用戶在應用程序中方便快捷地使用使用這些控件。8. 顯示在編寫代碼、程序編譯過程和程序運行時發(fā)生的錯誤。9. 解決方案是一個邏輯上的容器,包含構成應用程序的項目和其它文件。10. 包含于被包含的關系;一個解決方案可以包含一個或多個項目。三.讀程序題解答:四.程序題1解答:五.程序題2解答:六.判斷1. C#語言主要面向Windows開發(fā)環(huán)境進行編程。2. C#語言完全支持面向對象編程。3. .NET開發(fā)的語言無關性依賴于其它運行庫的執(zhí)行環(huán)境,稱為COM運行庫。4. C
5、#從C/C+發(fā)展而來,但更具優(yōu)勢,如開發(fā)Web應用程序和NT服務等。5. C#語法簡單,編程靈活,但功能有限,不適合開發(fā)Windows應用程序。6. C#擁有對.NET基類庫的完全訪問權,并易于訪問Windows API。7. Visual Studio 2008是一套完整的開發(fā)工具,可輕松創(chuàng)建混合語言解決方案。8. 在Visual Studio 2008環(huán)境中,Visual Basic、C#和Visual C+分別使用不同的集成開發(fā)環(huán)境。9. 在Visual Studio 2008起始頁中不可以打開已有的項目或創(chuàng)建新項目。10. “服務器資源管理器”主要對服務器的進行管理,并不負責維護數(shù)據(jù)連
6、接。解答:1. X2. 3. X4. 5. X6. 7. 8. X9. X10. X第二章 C#語言基礎一.填空1. 在C#語言中,每條語句都以( )結束。2. 在C#語言中,使用( )進行單行注釋。3. 在C#語言中,使用( )進行多行注釋。4. 在C#語言規(guī)定變量在使用之前必須先( )后使用。5. 在C#語言表達式中,可通過( )改變運算符的運算順序,使表達式更清晰易懂。6. 在C#語言中,使用( )關鍵字聲明符號常量。7. 在代碼中,明確指示將某一數(shù)據(jù)類型轉換為另一種數(shù)據(jù)類型稱為( )。8. 在C#語言中,系統(tǒng)命名空間使用( )關鍵字導入。9. 10. 11. 將命題“a是小于正整數(shù)b的
7、偶數(shù)”用C#表達式可以表示為( )。12. 循環(huán)語句“for(int i=30; i=10; i=i-3)”的循環(huán)次數(shù)為( )。13. 對于do-while循環(huán)結構,當while語句中的條件表達式的值為( )時結束循環(huán)。14. 跳轉語句中的( )語句用于循環(huán)結構中,表示僅從當前循環(huán)迭代中退出,然后執(zhí)行下一次迭代循環(huán)。15. 跳轉語句中的( )語句可以將程序控制直接轉移到標號指定的語句。16. 在C#類型轉換中,不存在向( )類型的隱式轉換。17. 已知str的值為“abcdefgh”,則表達式“str.Substring(1,3)”的值為( )。18. 定義方法時使用的參數(shù)是( )。19. 數(shù)
8、據(jù)類型說明符用來說明方法返回值的類型,如果沒有返回值,則其類型說明符應為( )。20. 委托聲明的關鍵字( )。解答:1. 分號2. /3. /* */4. 聲明5. ()6. const7. 顯式轉換8. using9. false10. true11. 12. 713. false14. continue15. goto16. char17. bcd18. 形參19. void20. delegate二.簡答題解答:三.讀程序題1. int x, y,z;x = 12; y = 16; while(x!=0) z=y%x; y=x; x=z;寫出程序運行完后X,Y,Z的值2. int a=
9、8,b=3,x=1,y; x += b+; if (x = 1 & x 3) y = a + b * x; else if (x = 3) y = a - b % x; else y = a / b / x;寫出程序運行完后X,Y的值3. int i, x = 0, y = 0; for (i = 5; i = 1; i-) y = (x + 1) * 2; x = y; 寫出程序運行完后Y的值4. string s; StringBuilder sb = new StringBuilder(); sb.Append(北運); sb.Insert(1, 京奧); s = sb.ToString
10、(); s = s.Insert(s.Length, 2008); lblShow.Text = + s + 長度為 + s.Length;寫出程序運行后文本框lblShow中的內容.5. int nNum = 90,16,24,65,25 ; int n = nNum0; foreach (int nTmp in nNum) if (nTmp n) n = nTmp; Console.Write(n.ToString();6. for (int i = 100; i 2; Console.WriteLine(y); y = y 2; Console.WriteLine(y); y = y 2
11、; Console.WriteLine(y);寫出程序運行完后屏幕上的結果顯示8. int x = -16; Console.WriteLine(x); int y = x 2; Console.WriteLine(y); y = y 2; Console.WriteLine(y); y = y 2; Console.WriteLine(y);寫出程序運行完后屏幕上的結果顯示9. Console.WriteLine(1 is int); Console.WriteLine(1 is float); Console.WriteLine(1.0 is float); Console.WriteLi
12、ne(1.0 is double);寫出程序運行完后屏幕上的結果顯示10. int a = 24, b = 8; Console.WriteLine(0+1 = 2, a, b, a + b); Console.WriteLine(0-1 = 2, a, b, a - b); Console.WriteLine(0*1 = 2, a, b, a * b); Console.WriteLine(0/1 = 2, a, b, (float)a / b);寫出程序運行完后屏幕上的結果顯示11. int x = 23, y; if (x 0) y = 1; else if (x = 0) y = 0;
13、 else y = -1; Console.WriteLine(Y的值為:0, y);寫出程序運行完后屏幕上的結果顯示12. goto h; w: Console.WriteLine(A); goto e; h: Console.WriteLine(B); goto w; e: Console.WriteLine(C);寫出程序運行完后屏幕上的結果顯示13. long x = 5, i = 1, p = 1; while (i 0) x1 = (x2 + 1) * 2; x2 = x1; d-; Console.WriteLine(x1.ToString();寫出程序運行完后屏幕上的結果顯示1
14、5. long s = 0, p = 1, s1, i = 1, n = 5; while (i = n) s1 = 1; p = 1; while (p = i) s1 = s1 * p; p = p + 1; s = s + s1; i+; Console.WriteLine(s = 0, s);寫出程序運行完后屏幕上的結果顯示16. for (int i = 0; i = 4; i+) for (int j = 1; j 3) goto a; a: Console.WriteLine(End);寫出程序運行完后屏幕上的結果顯示17. int i = 0, s = 1; do s /= s
15、 + 1; i+; while (i = 10); Console.WriteLine(i is 0, i); Console.WriteLine(s is 0, s);寫出程序運行完后屏幕上的結果顯示18. int i = 0, s1 = 0, s2 = 0; while (i = 50) if (i % 2 = 0) s1 += i; else s2 += i; i+; Console.WriteLine(s1 is 0, s1); Console.WriteLine(s2 is 0, s2);寫出程序運行完后屏幕上的結果顯示19. static int fun(int x, int y)
16、 int z = x + y; return z; static double fun(double x, double y) double z = x * y; return z; static void Main(string args) Console.WriteLine(the result is: 0, fun(3.0, 4); Console.ReadKey(); 寫出程序運行完后屏幕上的結果顯示20. static int a = 0; static int fun(int x, int y) a = x + y; return a * a; static void Main(s
17、tring args) int arr1 = 1, 2, 3 ; int arr2 = 2, 4, 6 ; int n = 0; for (int i = 0; i 3; i+) n += fun(arr1i, arr2i); Console.WriteLine(a is: 0, a); Console.WriteLine(n is: 0, n); Console.ReadKey(); 寫出程序運行完后屏幕上的結果顯示21. enum Month Januray, February = 10, March static string fun(Month m) switch (m) case M
18、onth.Januray: return String.Format(Januray = 0, (int)m); case Month.February: return String.Format(February = 0, (int)m); case Month.March: return String.Format(March = 0, (int)m); default: return Month; static void Main(string args) Console.WriteLine(fun(Month.Januray); Console.WriteLine(fun(Month.
19、February); Console.WriteLine(fun(Month.March); Console.ReadKey(); 寫出程序運行完后屏幕上的結果顯示22. int myArray = new int 10, 8, 3, 5, 6, 7, 4, 6, 9 ; for (int j = 1; j myArray.Length; j+) for (int i = 0; i myArray.Length - 1; i+) if (myArrayi myArrayi + 1) int temp = myArrayi; myArrayi = myArrayi + 1; myArrayi +
20、 1 = temp; foreach (int n in myArray) Console.Write(0 , n); Console.ReadKey();寫出程序運行完后屏幕上的結果顯示23. int a, b = 5; char c1 = A; a = c1; float x = 3; x += b; Console.WriteLine(a = 0, a); Console.WriteLine(x = 0, x); Console.ReadKey();寫出程序運行完后屏幕上的結果顯示24. static void Main(string args) Console.WriteLine(0)
21、.GetType(); Console.WriteLine(0U).GetType(); Console.WriteLine(0L).GetType(); Console.WriteLine(0F).GetType(); Console.WriteLine(0D).GetType(); Console.ReadKey(); 寫出程序運行完后屏幕上的結果顯示 25. static void Main(string args) int x = 5; int y = x+; Console.WriteLine(y); y = +x; Console.WriteLine(y); Console.Rea
22、dKey(); 寫出程序運行完后屏幕上的結果顯示 26. static void Main(string args) int a = 0; int b = 6; switch (b) case 1: case 3: case 4: case 8: b = 10; break; case 2: case 5: case 6: case 7: b = 20; break; default: b = 30; break; Console.WriteLine(b); Console.ReadKey(); 寫出程序運行完后屏幕上的結果顯示27. static void Main(string args)
23、 int s = 0; for (int i = 0; i 10) break; if (i % 2 = 0) s += i; Console.WriteLine(s); Console.ReadKey(); 寫出程序運行完后屏幕上的結果顯示28. static void Main(string args) for (int i = 1; i = 5; i+) for (int j = i; j n) m = m - n; while (n m) n = n - m; Console.WriteLine(m); Console.ReadKey(); 寫出程序運行完后屏幕上的結果顯示31. st
24、atic void Main(string args) int move = 0; int y = 68 / 8; if (y 8) move = y / 2 + 5; else int a = y; int b = 6; move = a % b; Console.WriteLine(move); Console.ReadKey(); 寫出程序運行完后屏幕上的結果顯示 32. static void Main(string args) int x = 1, y, total = 0; while (x = 5) y = x * x; total += y; x+; Console.Write
25、Line(total); Console.ReadKey(); 寫出程序運行完后屏幕上的結果顯示 33. static void Main(string args) int i = 4; for (int row = 1; row = i;row+ ) for (int col = 1; col = (i - row);col+ ) Console.Write( ); for (int col = 1; col 0;col- ) Console.Write(col); Console.WriteLine(); Console.ReadKey(); 寫出程序運行完后屏幕上的結果顯示34. sta
26、tic void Main(string args) int n = 0; double inc = 0.075, sum = 1; while (sum = 4) sum += (1 + inc) * sum; n+; Console.WriteLine(n); Console.ReadKey(); 寫出程序運行完后屏幕上的結果顯示 35. static int exam(int x) int result; if (x = 0) result = 1; else result = x * exam(x - 1); return result; static void Main(string
27、 args) int n = exam(5); Console.WriteLine(n); Console.ReadKey(); 寫出程序運行完后屏幕上的結果顯示 36. static void Main(string args) for (int i = 1; i = 50; i+) if (i % 3 = 0 & i % 5 = 0) Console.WriteLine(i); Console.ReadKey(); 寫出程序運行完后屏幕上的結果顯示37. static void Main(string args) int k = 0; int i = 1; while (i 50) bre
28、ak; Console.WriteLine(k); i+; Console.ReadKey(); 寫出程序運行完后屏幕上的結果顯示38. static void Main(string args) int x = 5; int i,j=1; for (i = 1; i x;i+ ) j *= i; Console.WriteLine(j); Console.ReadKey(); 寫出程序運行完后屏幕上的結果顯示39. static void Main(string args) int i; string str = ; for (i = 0; i = a & a = A & a = Z) re
29、sult = (char)(Z - (a - A); return result; static void Main(string args) Console.WriteLine(fun(b); Console.WriteLine(fun(W); Console.ReadKey(); 寫出程序運行完后屏幕上的結果顯示解答:1. x = 0;y = 4;z = 02. x = 4;y = 83. y = 624. 北京奧運2008長度為85. 906. 水仙花數(shù):153 水仙花數(shù):370 水仙花數(shù):371 水仙花數(shù):4077. 16 4 1 08. -16 -4 -1 -19. True False False True10. 24+8 = 32 24-8 = 16 24*8 = 192 24/8 = 311. 的值為:112. BAC13. p = 12014. 153415. s = 15316. i is 0,
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 二零二五年度民辦學校圖書資源采購與借閱服務合同范本3篇
- 二零二五年度無線通信塔架建設施工合同
- 2025年臍橙果肥國際市場拓展合作合同4篇
- 2025年度二手房買賣合同稅務籌劃范本
- 二零二五年度土地承包經(jīng)營權租賃管理服務合同
- 二零二五年度文化藝術交流活動組織合同
- 二零二五年度天然青貯飼料原料采購與倉儲管理合同
- 二零二五年度品牌代理授權合同(含保密條款)
- 二零二五年度水塘生態(tài)環(huán)境保護與修復工程合同
- 二零二五版鋁單板裝飾材料采購合同4篇
- 2024年社區(qū)警務規(guī)范考試題庫
- 2024年食用牛脂項目可行性研究報告
- 2024年全國各地中考試題分類匯編(一):現(xiàn)代文閱讀含答案
- 2024-2030年中國戶外音箱行業(yè)市場發(fā)展趨勢與前景展望戰(zhàn)略分析報告
- GB/T 30306-2024家用和類似用途飲用水處理濾芯
- 家務分工與責任保證書
- 消防安全隱患等級
- 溫室氣體(二氧化碳和甲烷)走航監(jiān)測技術規(guī)范
- 華為員工股權激勵方案
- 部編版一年級語文下冊第一單元大單元教學設計
- 《保單檢視專題》課件
評論
0/150
提交評論