计算机导论3-0928三分析PPT精品课件
- 格式:ppt
- 大小:760.50 KB
- 文档页数:57


思考题与习题五
1. 请简述程序设计的一般过程。
答:
(1)分析要解决的问题,明确任务。
(2)分析问题,建立数学模型,并选择合适的解决方案。
(3)确定数据结构和算法。
(4)编写程序。
(5)调试程序。
(6)整理资料,交付使用。
2. 请简述机器语言、汇编语言和高级语言之间的区别。
答:
机器语言是一种用二进制数“0”和“1”表示计算机各种操作的程序设计语言。用机器语言进行程序设计时,只能使用由0和1组成的机器指令。一条机器指令能够控制计算机执行一种操作。计算机能够直接理解和执行使用机器语言编写的程序,执行速度快,占用内存少;但难于记忆,编程困难,可读性差,容易出错。机器语言是面向机器的语言,可移植性极差。
汇编语言是一种用助记符来表示各个基本操作的程序设计语言。如用ADD表示加法操作,SUB表示减法操作等。
汇编语言的出现,大大减少了程序编写、阅读、修改、维护等方面的工作量,但汇编语言也是一种面向机器的语言,计算机不能直接执行,通用性和可移植性差,必须经过汇编程序翻译成机器语言程序后才能在计算机上执行,需要程序员对计算机内部结构非常了解。
高级语言是一种用接近自然语言和数学语言的语法、符号描述基本操作的程序设计语言。它符合人们叙述问题的习惯,因此简单易学。高级语言的诞生让程序员摆脱了低级语言所带来的种种不便。用高级语言编写的程序不依赖于具体的机器,程序员编程时无需关心计算机内部的细节,从而大大提高了编程效率。计算机不能直接执行使用高级语言编写的程序,需用专门的翻译程序将其转换成机器语言程序后才能执行。如用C语言编写的程序,必须先经C编译系统翻译成机器语言程序,再连接生成可执行文件后才能执行。高级语言种类繁多,风格迥异,各有所长,在各自的应用领域发挥了巨大的作用。目前,使用较广泛的高级语言有C、C++、Visual Basic、Visual C++、Power Builder、Java、Delphi、ASP、JSP、PHP、Visual Foxpro等。
第3章补充习题答案
1. (10111.110)2=(27.6)8 , (10111.110)2=(17.C)16
(1001010.101)2= (112.5)8 , (1001010.101)2= (4A.A)16
2. (17)10=(10001)2 ,(17)10=(21)8 ,(17)10=(11)16
(0.5918)10=(0.1001)2 ,(0.5918)10=(0.457)8 (0.5918)10=(0.9780)16
(125)10= (1111101)2 ,(125)10= (175)8 ,(125)10= (7D)16
(234.125)10=(11101010.001)2 ,(234.125)10=(352.1)8 ,(234.125)10=(DA.2)16
3. (101011.110)2= (43.75)10 (73.2)8=(59.25)10 (A8C)16= (2700)10
4. 若用二进制数表示所有4位十进制数,至少需要10位二进制数
5. (1001)原码是00001001,补码是00001001,反码是00001001,
(-1001) 原码是10001001,补码是11110110,反码是11110111
(1000) 原码是00001000补码是00001000反码是00001000
(-1000) 原码是10001000补码是11111000反码是11110111
(+0000) 原码是00000000补码是00000000反码是00000000
(-0000) 原码是10000000补码是100000000反码是11111111
6 1).[X]原=10111;则头号位1为“-”号,0111为1+2+4=7
所以原来的数位-7。
2).[X]反=10111;则头号位1为“-”号,0111为1000,等于8+0+0+0=8
1. If the memory cell whose address is 5 contains the value 8, what is the difference between writing the value 5 into cell number 6 and moving the contents of cell number 5 into cell number 6? 在第一种情况下,地址为6的存储单元结果包含值5;第二章情况下结果包含8 2. Suppose you want to interchange the values stored in memory cells 2 and 3.What is wrong with the following sequence of steps: * Step 1:Move the contents of cell number 2 to cell number 3. Step2:Move the contents of cell number 3 to cell number 2. Design a sequence of steps that correctly interchanges the contents of these cells. Answer: 2->1; 3->2; 1->3; 3. What advantage does a hard-disk system gain from the fact that its disks spin faster than those in a floppy-disk system? 有较快的数据检索速度和较高的传输速率。 4. In the ASCII code, what is the relationship between the codes for an uppercase letter and the same letter in lowercase? 除了从低端数第6位对大写字母和小写字母分别是0和1外,两个位模式是相同的。 5. Convert each of the following binary representations to its equivalen ten form: 将下列二进制(binary representations)表示转换为等价的十进制(ten form)形式 6. Convert each of the following base ten representations to its equivale binary form: 将下列十进制(ten representations)表示转换为等价的二进制(binary form)形式 7. Convert each of the following two's complement representations to its equivalent base ten form: 将下列二进制补码(two's complement representations)转换成等价的十进制 8. a. Suppose you XOR the first two bits of a string of bits and then continue down the string by successively XORing each result with the next bit in the string. How is your result related to the number of 1s appearing in the string? b. How does this problem relate to determining what the appropriate parity bit should be when coding a message? Answer: a、 如果该串包含偶数个1,那么最后结果是0,否则是1; b、 结果是偶校验的校验位值 9. Which of the following would require real-time processing? a) Printing mailing labels b) b. Playing a computer game c) c. Displaying letters on a monitor screen as they are typed at the keyboard d) d. Executing a program that predicts the state of next year's economy 10. Identify examples of queues. In each case, indicate any situations that violate the FIFO structure. 实时处理是指一个程序的执行要与机器的环境里的活动相协调。 交互处理时指一个程序在其执行时人要与他交互。 成功的交互处理需要好的实时特征。’ 11. What is the difference between time-sharing and multitasking 分时是在单处理器的机器上实现多任务的技术。 12. List the components of a typical operating system and summarize the role of each in a single phrase. * (外壳):与机器的环境通信 (文件管理程序):协调机器大容量存储器的使用 (设备驱动程序):处理与机器外部设备的通信 (存储管理程序):协调机器主存储器的使用 调度程序:协调系统中的进程 调遣程序:协调各个进程的CPU时间的分配 13. Summarize the difference between a program and a process. * Program- a set of directions 指令的集合 Process-action of the following those directions 遵循这些指令的动作 14. In a time-sharing system, how can high-priority processes be allowed to run faster than others? Dispacher 赋其高优先级--------或给该进程长的时间片 15. What is an open network? Specifications and protocols are public Allowing vendors to produce compatible products 16. What is a router? 网络层的互连设备 路由器是一台机器;它把两个网络连接成一个互联网。 术语网关通常是指把一个域连接到互联网其余部分的路由器 17. What is the purpose of tier-1 and tier-2 ISPs? What is the purpose of access ISPs? Answer: tier-1 and tier-2提供 接入Internel的核心服务功能 接入服务商提供接入核心的能力 18. What is the DNS? * 名字服务器,负责将助记符地址转换成IP地址 19. What bit pattern is represented by 3.4.5 in dotted decimal notation? Express the bit pattern 0001001100010000 using dotted decimal notation. 3.4.5 000000110000010000000101 0001001100010000 19.16 20. What are the components of the complete Internet address of a machine? 一台机器完整的因特网地址由网络标识符和主机地址构成 21. What is a URL? A browser? URLWWW(万维网)中指定的文档地址 Browser-一个程序用于访问超文本,帮助用户存取超文本 22. How does the Internet software ensure that messages are not relayed within the Internet forever? 每个消息赋予跳数(hop count) 23. Summarize the distinctions between a process, an algorithm, and a program. * Answer: Process-activity of execution an algorithm 一个进程是执行一个算法的活动 program-a representation of an algorithm 一个程序一个算法的表示 24. In what sense do the steps described by the following list of instructions fail to constitute an algorithm? Step 1. Take a coin out of your pocket and put it on the table. Step 2. Return to Step 1. 问题:不确定性—空口袋呢? 这里存在两点。 一、这些指令定义了一个不可终止的过程。但是,事实上,这个过程最终达到这样的状态:你的口袋里在没有硬币。实际上,这可能是初始状态。 二、这个算法正如所所表示的,她并没有告诉我们在这个情况下该怎么做,也就是说不知道初始状态是什么。 25. The Euclidean algorithm finds the greatest common divisor of two positive integers X and Y by the following process: As long as the value of neither X nor Y is zero, continue dividing the larger of the values by the smaller and assigning X and Y the values of the divisor and remainder, respectively. (The final value of X is the greatest common divisor.) Express this algorithm in our pseudocode. X the lager input; Y the smaller input; While (Y not zero) do i. X Y ii. Y Remainder GCD X 26. Convert the pseudocode routine * Z 0; X 1; while (X < 6) do (Z Z + X; XX+ l) to an equivalent routine using a repeat statement. Answer: Z 0;X 1; repeat (Z Z + X;XX+ l)Until (X = 6) 27. What names are interrogated by the binary search (Figure 5.14) when searching for the name be in the list Alice, Brenda, Carol, Duane, Evelyn, Fred, George, Henry, Irene, Joe, Karl, Larry, Mary, Nancy, and Oliver? ----Alice, Brenda, Carol, Duane, Evelyn, Fred, George, Henry, Irene, Joe, Karl, Larry, Mary, Nancy, Oliver 28. List the classes (n2), (lg n), (n), and (n3) in decreasing order of efficiency. 效率由高到低:(lg n)- (n)- (n2) -(n3) 29. In what sense is a program in a third-generation language machine independent? In what sense is it still machine dependent? 一个用第三代语言编写的程序,从某种意义上说它是独立于机器的,因为它的步骤不是按照诸如寄存器和存储单元地址这样的机器属性来描述的。 在另一方面,从某种意义上说,它又是以来于机器的,因为算术溢出和截断误差还是会出现的。 30. What is the difference between an assembler and a compiler? * Assembler 汇编器-> machine instruction 1:1 compiler 编译器 -> machine instruction 1:n 31. Why is the use of a constant considered better programming style than the use of a literal? 使用描述性常量可以改进程序的可达性。 32. What is the difference between a declarative statement and an imperative statement? Declarative statement说明术语 Imperative statement说明算法步 33. List some common data types. 整数,实数,字符和布尔等类型。 34. What is the difference between a global variable and a local variable? 局部变量仅在像过程这样的程序单元内事可存取的; 全局变量在整个程序中都是可存取的。 35. What is the difference between a procedure and a function? * 一个函数是这样的过程,它返回与函数的名字相联系的值。 36. Describe the three major steps in the translation process. 词法分析:识别标记的过程; 语法分析:识别程序的语法结构的过程; 代码分析:生成目标指令的过程 37. Why would the number of lines in a program not be a good measure of the complexity of the program? Answer: 一个循环语句程序就得执行多次,因此语句数不能说明问题 一长串赋值语句并不比设计成几句嵌套的if语句发杂。 38. What is the difference between system requirements and system specifications? system requirements系统需求从应用环境的角度表达 system specifications系统说明以技术术语的观点以及说明如何来满足系统需求的角度来表达。 39. Summarize the distinction between the traditional waterfall model of software development and the newer prototyping paradigm. 传统瀑布方法要求分析、设计、实现以及测试各阶段以线性方式执行。 而原型模型是一种比较宽松的反复试验,不断摸索的方法。 40. in what form can software be documented 在附随的手册里,有注释清晰以及精心编写代码的源程序,程序本身显示在终端上的交互信息,有数据字典以及文档的设计格式,如结构图、类图、数据流图以及实体关系图。
[0037]《计算机导论》
1、微机的CPU由
组成。
1.
控制器和存储器
2. 运算器和存储器
3. 运算器和控制器
4. 运算器、控制器和存储器
2、关系数据库的任何检索操作都是由三种基本运算组合而成的,这三种基本运算不包括
1. 联接
2. 选择
3. 投影
4. 比较
3、Internet中URL的含义( )。
1. 传输控制协议
2. 简单邮件传输协议
3. 统一资源定位器
4. Internet协议
4、
在Internet网中,一个IP地址由 位二进制数值组成.
1. A. 8
2. 16
3. 64
4. 32
5、请将二进制数(11100110)2用十六进制数表示。 1.
F3
2.
E3
3.
E6
4. F6
6、驱动器是一种( )。
1. 输入输出设备
2. 输入设备
3. 输出设备
4. 外部设备
7、数据库系统的核心是。
1. F. 文件
2. 数据库
3. 数据库管理系统
4. 操作系统
8、
在程序设计语言中,汇编语言是一种____语言。
1. 二级
2. 低级
3. 高级
4. 中级 9、
当二进制数的小数点向左移动一位时,该数就( ).
1.
放大十倍
2. 缩小十倍
3. 缩小两倍
4.
放大两倍
10、HTML是指:( )
1. 超文本标记语言
2. 超媒体文件
3. 超文本文件
4. 超文本传输协议
11、
若需连接两个以上的同类网络(网络操作系统相同),应使用 作为网络连接器。
1. 中继器
2. 网关
3. 网桥
4. 路由器
12、
微型机不可缺少的I/O设备是 。
1.
键盘和鼠标
2.
鼠标和打印机
3. 显示器和打印机