阿摩線上測驗
登入
首頁
>
程式設計
>
110年 - 110-2 國立清華大學期末考試題_電機工程學系:計算機程式設計#112945
> 申論題
題組內容
3. (15%) Consider the access of dynamically allocated data structure.
(a) What is the default access level of a member defined in a data structure using keyword struct? (5%)
相關申論題
(b) Fill in Statement-1 in the following program that assigns a dynamic S_record object and returns its starting address to variable ptr_s. (5%)
#483283
(c) Fill in Statement-2 in the following program that calls the member function show() properly so that the screen will display “Everybody is somebody”. (5%)
#483284
4. (10%) Finish the following program that converts an integer array A[5]={3, 11, 2, 17, 9} into an STL vector object V, and then sort it in the increasing order. Please be as complete and accurate as possible. The score you will get depends on the completeness and correctness of your answer. (Hint: you many need member function of vector such as V.push_back(), and generic sorting function such as sort().
#483285
(a) To enable the “Mule inherits from Horse publicly” relation, what should be filled in at “Inheritance_declaration” in the program code? Note that this declaration has two words. (5%)
#483286
(b) After the execution of the main program, what will be displayed on the screen? Hint: beware of the member function overriding during the inheritance. (5%)
#483287
6. (15%) Complete the following function that writes an array of complex numbers, A[3], into a binary file, and then reads all the contents back to another array B[3]. Please specify clearly what should be filled in to Blank1, Statement-1, and Statement-2, respectively. The program will print out the following result after execution: B[0]=1.0 + j1.0B[1]=2.0 + j4.0B[2]=3.0 + j9.0
#483288
7. (10%) Consider the following recursive function B(int m, int n). How many lines of “Base Case” will be printed if B(5, 3) is executed.
#483289
(a) How many coordinates along the number line can he reach (including the starting point at coordinate 0)? Drive this result by paper-and-pencil method. (5%)
#483290
(b) Finish the primitive recursive program shown below by adding 2 statements which make recursive calls. (5%)
#483291
(c) What is the computational complexity of this program? Is it O(n), O(n*log2(n)), O(n2 ), O(2n ), or O(n!), where n denotes the number of jumps taken? (5%)
#483292
相關試卷
115年 - 115 身心障礙特種考試_四等_資訊處理:程式設計概要#138996
115年 · #138996
115年 - 115 關務特種考試_四等_資訊處理(選試英文):程式設計概要#138932
115年 · #138932
114年 - 114 地方政府公務特種考試_四等_資訊處理:程式設計概要#134763
114年 · #134763
114年 - 114 專技高考_資訊技師:程式設計#133686
114年 · #133686
114年 - 114 普通考試_資訊處理:程式設計概要#128722
114年 · #128722
114年 - 114 關務特種考試_四等_資訊處理(選試英文):程式設計概要#126658
114年 · #126658
114年 - 114 身心障礙特種考試_四等_資訊處理:程式設計概要#126591
114年 · #126591
113年 - 113 地方政府公務、離島地區公務特種考試_四等_資訊處理:程式設計概要#124356
113年 · #124356
113年 - 113 專技高考_資訊技師:程式設計#123958
113年 · #123958
113年 - 113 普通考試_資訊處理:程式設計概要#121162
113年 · #121162