作者s88239 (s88239)
看板NTU-Exam
標題[試題] 100上 陳彥仰 計算機概論 第二次期中考
時間Fri Dec 30 17:53:32 2011
課程名稱:計算機概論
課程性質:選修
課程教師:陳彥仰
開課學院:電機資訊學院
開課系所:資訊工程學系
考試日期〈年月日〉:2011.11.22
考試時限〈分鐘〉:120分鐘
是否需發放獎勵金:是
〈如未明確表示,則不予發放〉
試題:
Part I: Multiple Choice Problems(21 points)
Circle the letter of the choice that best completes the statement or answers
the question.
1. Who designed the ENIAC?
a. Alan Turing b. John von Neumann c. J. Presper Eckert and John
William Mauchly d. Gordon Moore
2. Which programming language was invented after C++?
a. Java b. Python c. C# d. all of the above
3. Which command can be used to find all users currently using the same machine?
a. getpath b. who c. whereis d.find
4. How many bits are used to encode each symbol in ASCII code?
a. 4 b. 6 c. 8 d. 9
5. Which is a volatile storage?
a. Hard disk b. DRAM c. Floppy d. Flash memory
6. Which storage has the lowest latency?
a. L1 cache b. L2 cache c. SDRAM d. Hard drive
7. How does Windows manage multiple processes?
a, time-sharing b. event-driven c. distribute d. virtualization
Part II: Alphabet Soup(20 points)
For each terminology, spell it out completely, and explain (in either Chinese
or English) briefly.
1. USB
2. DNS
3. GPU
4. SMTP
5. HTTP
Part III: Short Answers(37 points)
Answer the following questions briefly but clearly.
1. (5 points)Write a regular expression that defines the official email address
of all NTU freshmen (
[email protected] , x represents a number between 0-9)
2. (5 points)What are the major function of a computer operating system?
3. (5 points)Consider a simple 8-bit computer, what is the range of binary
number that can be represented using 2's complement encoding?
4. (5 points)Please explain what is the little-endian and big-endian format?
5. (5 points)Please explain briefly the "Y2K38" problem.
6. (12 points)Write the Linux commands for performing the following tasks:
A. Renaming the file "source.txt" to "target.txt"
B. Defining a new command "delete" that removes files and directories.
C. Listing all files whose names start with "Quiz"
D. Listing all environment variables
Part IV: Turing Machine (10 points)
Draw the state diagrams of the Turing Machine you designed.
Question:
Let any given positive number n be represented in binary but without leading
zeros. (eg. 2 is _ _ 1 0 _ _ not _ _ 0 1 0 _ _ or 0 0 1 0 _ _) Design a Turing
Machine to do "multiply 2 to the number and then add 1" (which means output
2n+1) with the smallest number of states. (The number of states must be less
than 5)
Part V: Python Programming (20 points)
Please answer the following questions of python language.
1. (5 points)Can the following program work?If yes, write down the value of R1.
If no, please explain why and correct the program.
A=[1,3,2]
R1=A.sort()
2. (5 points)Can the following program work?If yes, write down the value of R2.
If no, please explain why and correct the program.
A=(1,3,2)
R2=A.sort()
3. (10 points)Write a program that outputs a user's birth city based on the
following table. (Eg. After reading the letter "A" from stdin, the program will
output "Taipei City" to stdout.)
┌────┬────┬────┬────┬─────┬─────┐
│A │B │C │D │E │F │
├────┼────┼────┼────┼─────┼─────┤
│Taipei │Taichung│Keelung │Tainan │Kaohsiung │New Taipei│
│City │City │City │City │City │City │
└────┴────┴────┴────┴─────┴─────┘
--
Ans:
Part I:
1.c 2.d 3.b 4.c 5.b 6.a 7.a or b
Note: For 7th question, both answers are acceptable, time-sharing is mainly for
Linux, and event-driven are used by Windows)
Part II:
1. Universal Serial Bus
USB was designed to standardize the connection of computer peripherals, such as
keyboards, pointing devices, digital cameras, printers, portable media players,
disk drives and network adapters to personal computers, both to communicate and
to supply electric power.
2. Domain Name System / Domain Name Service
DNS is a hierarchical distributed naming system for computers, services, or any
resource connected to the Internet or private network.
3. Graphics Processing Unit
GPU is a specialized circuit designed to rapidly manipulate and alter memory in
such a way so as to accelerate the building of images in a frame buffer
intended for output to a display.
4. Simple Mail Transfer Protocol
SMTP is an Internet standard for electronic mail (e-mail) transmission across
Internet Protocol (IP) networks.
5. Hypertext Transfer Protocol
HTTP is an application protocol for distributed, collaborative, hypermedia
information systems. HTTP is the foundation of data communication for the World
Wide Web.
Part III:
1. In ERE: b00[0-9]{6}@ntu\.edu\.tw
2. memory management, process management, storage & I/O managementm (graphical)
user interface, network management, security etc.
3. -128 ~ 127
4. The term endian or endianness refers to the ordering of individually
addressable sub-components within the representation of a larger data item as
stored in external memory (or, sometimes, as sent on a serial connection).
A big-endian machine stores the most significant byte first (at the lower byte
address), and a little=endian machine stores the least significant bye first.
5. The buid-in time of computer starts from 1970-01-01 00:00 and counts seconds
with an integer counter. Since 32-bit integer has a upper bound as 2^31-1, the
couunter will overflow after 2^31-1 seconds. The overflow would happen on 2038-
01-19 03:14:07, and after the moment, the time would go back to 1901-12-13
20:45:52, making potential problems.
6. A. mv source.txt target.txt
B. In bash shell: alias delete="rm -rf"
C. ls Quiz*
D. In bash shell: export
Part IV:
(1,1,→) (_,1,→)
┌───┐┌───┐
│ ↓│ ↓
○ ○ ○
│↑ │↑
└┘ └┘
(_,_,→) (1,1,→)
(0,0,→)
Part V:
1. Yes, R1=[1,2,3]
2. No, tuple can't be modified. Tuple is immutable! We can use list instead or
just create a new tuple! R2=(A[0], A[2}, A[1})
3. dir={"A":"Taipei City","B":"Taichung City","C":"Keelung City","D":"Tainan
City","E":"Kauhsiung City","F":"New Taipei City"}
in=raw_input("Please type the first letter of your ID: ")
print dir[in]
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.242.63
1F:→ andy74139 :已收錄至資訊系!! 12/30 19:18