2009级计算机学院-计算机导论试题A卷--答案(参考)

更新时间:2024-04-09 16:20:02 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

2009-2010学年 第1学期

2009 级《计算机导论》考试试题A卷答案

考试时间:2009年 月

I

ABCDC BCBDB DDCCD BDCBA

II、 Questions( 6 questions, 5 scores for each question) 1. What’s the definition of an operating system?

A: An operating system is an interface between the hardware of a computer and user(programs or humans) that facilitates the execution of other programs and the access to hardware and software resources.

2. What are the subsystems of the von Neumann computer model?

A:The von Noumann model specifies a memory subsystem, an arithmetic logic unit subsystem, a control unit subsystem, and an input/output subsystem.

3. Name four types of network connecting devices.

A: The four types of network connecting devices are repeater, bridge, router and gateway.

4. Define the three constructs used in structured programming.

A: The three constructs in structured programming are Sequence, Decision and Repetition

5. Name the layers of the OSI model?

A:The OSI model has seven layers, which are Physical layer, Data link layer, Network layer, Transport layer, Session layer, Presentation layer and Application layer.

6. What’s the formal definition of an algorithm?

A:It’s an ordered set of unambiguous steps that produces a result and terminates in a finite time.

III、Calculation( 5 subjects, 5 scores for each subject)

1. Change the following 8-bit two’s complement numbers to decimal.

(1). 1000000 (2). 01100100 (3). 11001000 (4). 11000011 (5).11010101 A: 128, 100, 170 200 195 213

2. Change the following decimal numbers to 8-bit two’s complement integers, and then convert the result to hexadecimal.

第 1 页 共 3 页

(1). -48 (2). 25 (3). -127 (4). 98 (5). -55 A: xD0 x19 x81 x62 xC9

3. Using an 8-bit allocation, first convert each of the following numbers to two’s complement, do the operation, and then convert the result to hexadecimal.

(1) 35+63 (2) 35-63 (3) -35 +63 (4) -35-63 (5) 63-1 A: x62 xE4 x1C x9E x3E

4. Show the result of the following operations, and then convert the result to hexadecimal. (1) NOT 129 (2) 15 AND 10 (3) x55 OR xAA (4) 100 AND 255 (5) (xFF XOR xBB) AND (xFF OR xBB) A: x81 x0A x00 x64 x44

5. Change the +12.625 decimal numbers to binary numbers, and show it in 32-bit IEEE format, and then convert the result to hexadecimal.

A: 1100.101 ----1.100101E02 ---1 10000001 1001010 00000000 00000000 ---x C0CA00

IV. Analyzing and Design (5 subjects, 5 scores for each subject)

1. Using the bubble sort algorithm, manually sort the following list and show your work in each pass: 12, 6, 78, 31, 50, 46, 99, 2, 20, 44 A: 2, 12, 6, 78, 31, 50, 46, 99, 20, 44

2, 6,12, 78, 31, 50, 46, 99, 20, 44 …

2. A list contains the following elements. Using the binary search algorithm, trace the steps followed to find 66. At each step, show the values of first, last and mid. 2, 5, 18, 28, 30, 40, 66, 100 A: index 0---1---2---3---4---5---6---7 2, 5, 18, 28, 30, 40, 66, 100 First=0, Last=7, Mid=(0+7)/2=3

The data is D(3)=28, 66 bigger than the D(3), so remove the data from index 0 to 3. Change the new point First=mid+1=4, Last=7, and Mid=(4+7)/2=5

The data is D(5)=40, 66 bigger than the D(3), so remove the data from index 4 to 5. Change the new point First=mid+1=6, Last=7, and Mid=(6+7)/2=6 The data is D(6)=66, we find the data 66 in index=6

3 Write an algorithm in pseudocode to find the smallest of a set of 10000 numbers (the biggest data is 255 among the numbers). A: input: 1000 integers Set smallest to 256 Set counter to 0

第 2 页 共 3 页

While(counter <10000)

If(the number

Set the smallest to the number

End if

Increment the counter End while

Return smallest End

4. Write a recursive algorithm to find the combination of n objects taken k at a time using following definition.

C(n,k)=1 , if k=0 or n=k

C(n,k)=C(n-1,k)+(n-1,k-1) , if n>k>0

A: C

Input : n and k

If(k==0 or n==k) Then

return 1 End if

If(n>k and k>0) Then

Return C(n-1,k)+(n-1,k-1)

End if End

5. Imaging a power plant that pumps water to a city using eight pumps(P8, P7, P6, P5, P4, P3, P2, and P1). The states of the pumps (on or off) can be represented by 8-bit pattern. For example, the pattern 10001111 shows that pumps 1 to 4(from right), and 8 are on (running) while pumps 5, 6, and 7 are off (shut down). How can you shut down all pumps, after two minutes, let the pump P2 and P5 running, and after one hour, shut down the P2 pump and turn on the P6 pump simultaneously, and remain the P5 running too? A: 0000 0000 after two minutes OR 0001 0010 after one hour XOR 0010 0010

第 2 页 共 3 页

本文来源:https://www.bwwdw.com/article/4c6r.html

Top