103年特種考試地方政府公務人員考試三等_程式語言
首頁
>
線上測驗
>
公職考試>地方特考/三等>資訊處理
> 103年特種考試地方政府公務人員考試三等_程式語言
年度
年度
105
105
104
103
100
99
98
1.
定義下述文法(grammar):
expression → expression + expression | expression - expression | type
type → int | double
(一)根據上面之文法,請畫出int + int + int兩個不同的剖析樹(parsing tree)。
(二)根據上面之文法,請導出所有只包含2個type之expression的結果。該expression一個type為int,另一type為double。
(三)請說明何謂模稜兩可的文法(ambiguous grammar)。
題型:問答題
難易度:尚未記錄
2.
網際網路程式與應用的發展,結合了許多技術與分析方法,請用數行文字,說明下列幾個網際網路應用技術的專有名詞:
(一)說明HDFS英文全名,其架構元素與基本運作特性。
(二)說明MapReduce的特性及Map和Reduce的運作方式。
(三)說明NO SQL的英文全名及其特性。
題型:問答題
難易度:尚未記錄
3.
請以物件導向,多型(polymorphism)的技術,改寫下列計算薪水的程式,其中經理(manager)薪水是40000,工程師(engineer) 薪水是35000。
int getPay(String employeeType) {
if (employeeType ==“manager”) {
return 40000;
else if (employeeType == “engineer”)
return 35000;
}
(一)設計Employee, Manager, Engineer 等三個類別及其屬性(attribute)與方法(method),方法包括建構子(constructor)。其中Employee 是抽象類別,有一個保護(protected)屬性薪水(salary);Manager 和 Engineer 是Employee的子類別。
(二)畫出UML類別圖。
題型:問答題
難易度:尚未記錄
4.
例外(exception)處理的應用:
(一)試說明Java 對於例外處理的抓取或宣告規則(catch or declare rule)。
(二)填寫下列空格,完成以下inputScore 方法。該程式要求使用者輸入成績,若輸入為非數字,則 拋出例外(exception)警示,迴圈繼續,直到使用者輸入合理的數字成績。若輸入的成績沒有介於0-100 間,則把例外向上拋給呼叫的方法。(18分)public static void inputScore ()
(1)
{
String str;
boolean valid;
double score = 0;
Scanner sc = new Scanner(System.in);
do {
valid = true;
System.out.println("Input the score");
str = sc.next();
try {
score = Double.parseDouble(str);
} catch (
(2)
) {
System.out.println(e);
valid = false;
}
} while (
(3)
);
if (score >100 || score <0) throw
(4)
("分數未介於0-100間");
System.out.println(score);
}
題型:問答題
難易度:尚未記錄
購買題庫後,可使用那些功能?
可觀看題目詳解,並提供模擬測驗!(免費會員無法觀看研究所試題解答)