阿摩線上測驗
登入
首頁
>
程式設計
>
110年 - 110-2 國立清華大學期末考試題_電機工程學系:計算機程式設計#112945
> 申論題
題組內容
5. (10%) Consider the following class definitions using inheritance in C++.
(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%)
相關申論題
(a) For a class with a class name as T. What is the name of its destructor function? (5%)
#483276
(b) What is the maximum number of comparisons that a binary search function could possibly make when searching for a value in a 2000-element array? (5%)
#483277
(c) Give a reason why selection sort could be more efficient than bubble sort for large arrays of big elements? (Note that a big element means an element with many data, for example, a student record containing a lot of information about a student). (5%)
#483278
(d) Given a C++ string object, s, sometimes we perform s.c_str(). What is the return type of this member function? (5%)
#483279
(a) Consider a program that requires matrix operations, C=A+B, where A, B, and C are all 2-D matrices of 3 rows and 3 columns of double-precision floating-point numbers. How do we declare them using the traditional 2-D array in C++? Since the declarations of A, B, and C are similar, you only need to declare matrix A without initialization as an example. (5%)
#483280
(b) If the function call is matrix_addition(C, A, B), what is the function heading of “matrix_addition”? Note that a function heading includes the return type, function name, and its parameters. Use void as the return type. (5%).
#483281
(a) What is the default access level of a member defined in a data structure using keyword struct? (5%)
#483282
(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
相關試卷
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
113年 - 113 關務特種考試_四等_資訊處理(選試英文):程式設計概要#119478
113年 · #119478
112年 - 112 地方政府特種考試_四等_資訊處理:程式設計概要#118364
112年 · #118364