프로그래밍언어론-인정답(2021-04-11 / 207.6KB / 96회)
프로그래밍언어론 인 책형 1 쪽 프로그래밍언어론 문 1. 언어의 문법(grammar)을 구성하는 요소로 옳지 않은 것은? ① 시작기호(start symbol) ② 심볼테이블(symbol table) ③ 생성규칙들(production rules)의 집합 ④ 비단말기호들(non-terminal symbols)의 집합 문 2. HTML 문서의 하이퍼링크에서 target 속성의 미리 정의된 속성 값으로 옳지 않은 것은? ① _blank ② _child ③ _top ④ _self 문 3. C# 언어가 지원하는 기능으로 옳지 않은 것은? ① 델리게이트(delegate) ② 이벤트(event) ③ 멀티쓰레드(multithread) ④ 애플릿(applet) 문 4. 다음 Visual Basic 프로시저를 sum(10, 10)의 형태로 두 번 호출 하고 난 후, 두 번째 메시지박스에 출력된 내용이 100 200이 되게 하려 한다. ㉠과 ㉡에 들어갈 키워드로 옳은 것은? Private Sub sum(unitprice, number) ㉠ num1 As Integer ㉡ num2 As Integer Dim result As String result = "" num1 = unitprice * number + num1 num2 = unitprice * number + num2 result = num1 & " " & num2 MsgBox(result) End Sub ㉠ ㉡ ① Dim Static ② Static Dim ③ Dim Dim ④ Static Static 문 5. Java 언어의 추상클래스(abstract class)에 대한 설명으로 옳은 것은? ① 추상클래스는 다중상속(multiple inheritance)을 지원한다. ② 추상클래스는 추상메소드(abstract method)만 갖는다. ③ 추상클래스는 인터페이스(interface)의 수퍼클래스(superclass)가 될 수 있다. ④ 추상클래스는 인터페이스(interface)를 구현(implements)할 수 있다. 문 6. 다음 Java 프로그램의 실행 결과는? class Ref { int a; Ref(int x) { a = x; } int sum(Ref obj) { int k; k = obj.a - a; a = 10; obj.a = 20; return k; } } class PassRef { public static void main(String[] args) { Ref obj1 = new Ref(3); Ref obj2 = new Ref(4); int k1 = obj2.sum(obj1); System.out.print("k1= "+k1); System.out.print(" obj1.a= "+obj1.a); System.out.print(" obj2.a= "+obj2.a); } } ① k1= -1 obj1.a= 10 obj2.a= 20 ② k1= -1 obj1.a= 20 obj2.a= 10 ③ k1= 1 obj1.a= 3 obj2.a= 20 ④ k1= 1 obj1.a= 20 obj2.a= 3 문 7. 다음은 Visual Basic 프로그램에서 버튼을 클릭했을 때 실행되는 프로시저의 본체이다. 프로그램에 대한 설명으로 옳지 않은 것은? Dim sum As Integer Dim counter As Integer sum = 0 counter = 0 Do While sum void swap(int a, int *b) { int temp; temp = a; a = *b; *b = temp; } void main() { int value = 3, list[4] = {1, 3, 5, 7}; int i; swap(value, &list[0]); swap(list[2], &list[3]); swap(value, &list[value]); for (i = 0; i < 4; i++) printf("%d ", list[i]); } ① 1 3 5 7 ② 3 3 3 3 ③ 3 3 5 3 ④ 3 3 5 5 문 9. 다음 C++ 프로그램은 계승(factorial)을 계산하는 프로그램이다. ㉠과 ㉡에 들어갈 내용으로 옳은 것은? #include using namespace std; double factorial(int n) { if (n == 0) ㉠ else ㉡ } void main() { int r; cout > r; cout using namespace std; const int MAX_SIZE = 50; template class classA { TYPE data[MAX_SIZE]; int nCount; public: classA() { nCount = 0; } void f1(TYPE in) { data[nCount++] = in; if (nCount == MAX_SIZE) cout S1; int i; for (i = 0; i < 10; i += 2) S1.f1( i ); for (i = 0; i < 5; i++) cout ②