| |||
| C/C++编程试题 (35%) 要求:用c或者c++写出下列程序. 1. 写一段程序, 比较 a,b 两个int 型 的大小,返回最大值。 2。自己定义一个结构,定义一个这个结构的变量,然后传递给一个函数,完成某个功能改变结构变量的值并返回 3。写程序解释实参和形参的不同,并解释如果需要对传入的参数进行修改需要如何实现。 4。程序实现:循环找出符合条件的索引号,然后动态数组存储这些索引号。 5。用C实现在内存中动态开辟内存,存储数据(int),然后动态扩大这个内存,最后将这个内存全部做一个复制到另一个与这个内存一样大的区域并实现数据的从小到大的排列。 空间要求:n个int为n。 网络基础知识试题 (25%) 1. OSI七层模型: 答案: 应用层, 表示层 2. TCP/IP的三大服务: 答案: 3. IP地址有四类网络,请分别列出各类的所辖范围、各类的网络数目和主机数目? 答案: 4.网桥及一般的二层交换机在进行资料包转发的时候,识别的是资料包包头中的什么内容进行资料包的转发( )路由器使用的是什么() A MAC地址 B IP地址 C 网络ID D 主机ID 答案: 5.TCP 、UDP、 IP三种协议中面向对象的协议是( ) A TCP B UDP C IP 答案: 6.某公司现有一个局域网采用TCP/IP作为传输协议,用路由器与internet相连。要求所有职员的机器上网的时候只能进行www浏览,作为网管应采用的做法是:() A 断开路由器与公司网络的连接 B 在公司所有主机上只安装浏览器软件,不安装其它应用网络程序 C 在路由器上做策略限制只让TCP21端口的资料包进行传输 D在路由器上做策略限制只让TCP80端口的资料包进行传输 答案: 7.某主机地址为131.107.16.25,子网掩码是255.255.0.0,它的本网内的广播地址是() A 131.107. B 131.107.0.0 C 131.107.16.0 D 131.107.255.255 E 255.255.255.255 答案: 8.如果采用ABC类标准地址划分,不定义子网掩码,下面地址中可以作为合法主机IP的是 A 0.0.0.0 B 1.1.1.1 C 1.0.0.0 D 1.1.0.0 E 1.1.255.255 F 131.107.0.0 G 131.107.255.255 H 223.0.0.1 I 224.0.0.1 答案: 9.学校的网络中有1900台机器,不需要内部路由,并希望能够上互联网。Isp给了学校如下的8个网络地址, 193.24.32.0/24 193.24.33.0/24 193.24.34.0/24 193.24.35.0/24 193.24.36.0/24 193.24.37.0/24 193.24.38.0/24 193.24.39.0/24 作为管理员你希望路由表保持最小,那么该选择的子网掩码是 答案: 10. You are the administrator of a Windows 2000 network. The network is configured as shown in the exhibit. . Computers on the Sales subnet run Windows 2000 Professional. These computers are dynamically assigned IP addressing and configuration information from a DHCP server on the subnet. Computers on the development subnet run Windows 98. These computers are statically assigned IP addressing and configuration information. Users on the Sales subnet report that they cannot communicate with users on the development subnet. A user who works on computer3 reports that he cannot communicate with computers on either subnet. You want all users to be able to communicate with other users on both subnets. What should you do? (Choose two) A. Change the frame type to 802.2 on computer3. B. Change the default gateway option IP address on the DHCP server. C. Change the default protocol on the computers on the Sales subnet to NWLink IPX/SPX/NetBIOS Compatible Transport Protocol. D. Enable TCP/IP protocol with the default settings on Computer3. E. Add the NetBEUI protocol to the binding order on all client computers. 答案: 11. You have updated the modem driver on your Windows 2000 Professional computer. You restart your computer. Immediately after you log on, you receive a Stop error. You need to start Windows 2000. What must you do? A. Restart the computer in Safe Mode. Uninstall the modem driver. B. Restart the computer by using the last known good configuration. C. Restart the computer in Recovery Console. Replace the new modem.inf file with the old modem.inf file. D. Start the computer from the Windows 2000 startup floppy disks. Repair the registry. E. Start the computer from the Windows 2000 startup floppy disks. Repair the system files. 答案: 12. You configure an HP Jet Direct print device as sown in the Network Diagram exhibit. You want to create and share a printer at Srv2.sales.justtogs.com that is connected to the TCP/IP port of the print device. However, when you enter the IP address of the device, you receive the dialog box shown in the Printer Port Wizard exhibit. Printer Port Wizard What should you do? A. Select Hewlett Packard JetDirect from the Standard drop-down list. B. Select the Custom option button, click the Settings command button, and select the LPR protocol. C. Change the IP address of the print device to 10.5.20.200. D. Change the subnet mask of the print device to 255.0.0.0. E. Change the default gateway address on Srv2.sales.justtogs.com to 10.5.20.100. 答案: VB基础知识试题 (20%) 1. You want to check keys pressed by a user to ensure that only alphanumeric values can be entered in a textbox. What event should you use? A. KeyPress B. KeyDown C. KeyUp D. KeyAscii 答案: 2、You are developing a database application that will access multiple database formats. What software components provide you with a single data access layer to access all data types? A. ODBC B. OLEDB C. IIS D. Microsoft Distributed Transaction Coordinator. 答案: 3、 Given the following code in the Initialize event of a form, what best describes the result? With Combo l .AddItem "Red" .AddItem "Green" .AddItem "Blue" End With A. When the form is loaded additional items are added to the combo B. When the form is loaded additional items are added to the combo each time. C. Combo box is added when the form is loaded first time. D. Combo box is loaded with the values when form first time loaded. 答案: 4、Given the following code in the Initialize event of a form, which of the options best describes the result? (Choose 2) With Combo1 .AddItem "Red" .AddItem "Green" .AddItem "Blue" End With A. The Combo box list values remain even when the form is unloaded and reloaded B. The Combo box list values do not remain when the form is unloaded and reloaded C. The Combo box list values remain so long as the form is not unloaded D. The initialize event can not be used to load property values 答案: 5. What is the outcome of the following section of code? Sub Proc 1() On Error Goto Errorhandler: Dim strProcName as string strProcName = "Proc1" call Proc2(strProcName) Errorhandler: MsgBox "Error in" & strProcName End Sub Sub Proc2(strName as String) strName = "Proc2" call Proc3(strName) end sub Sub Proc3(ByVal strName as string) dim x as integer strName = "Proc3" x = 1/0 end sub A. Error has occurred in Proc1 B. Error has occurred in Proc2 C. Error has occurred in Proc3 D. Success 答案: 6. What is the outcome of the following section of code? Sub ProcA() On Error GoTo eh: Dim x as integer x = 1000 ProcB(x) MsgBox "x = " & x Exit Sub eh: MsgBox "An Error has occurred" End Sub Sub ProcB(n as integer) dim y as integer, z as integer z = n/y MsgBox "z = " & z MsgBox "y ? " & y End Sub A. An Error has occurred. B. Z = 1000, y = 1, x = 1000 C. The program crashes with a runtime error D. X = 1000 答案: 7. Your VB application has two forms named FormA and FormB. FormA contains a combo box control, and FormB contains a test box control. Every time FormB receives focus, you want it to be updated with the value display on FormA. You write the following code: FormB.txtFormB = FormA.cboFormA. Where should you place this line? A. Load event (of FormA) B. Activate event (of FormB) C. GotFocus event (of FormB) D. In the Activate event for FormB 答案: 8. Your Visual Basic application contains a form named Forml. Forml contains a StatusBar control named MyBar that consists of five Panel objects. Which line of code will display the text Please Wait ...in the second Panel object of this control? A. MyBar.Panels(1).Text = "Please Wait..." B. MyBar.Panels(2).Text = "Please Wait..." C. MyBar.Panels(1).Caption = "Please Wait..." D. MyBar.Panels(2).Caption = "Please Wait..." 答案: 9. What is the correct syntax to show only numeric values in a text box control named Textl? 答案: 10. A Visual Basic form contains a ListView control named ListViewl. The first column in ListViewl contains product numbers, and the second column contains product descriptions. Which code should you use to sort ListViewl by the product number column in ascending order? 答案: 11. Assume m, j and n are globally declared as integers and m has an initial value of 3. Suppose the MyFunc function is called with the statement j =MyFunc and the following function exists: Function MyFunc (n As Integer) n=4 Debug.Print m End Function What number is printed in the Debug window? 答案: 12.如何检测操作系统中是否安装了打印机(VB6) 答案: 13. VB6.0中如何使点击右上角的关闭按钮时不执行unload事件 答案: 14. 编程题: 生成10个0到99的随机数,然后按从小到大排序。(必须程序实现) 程序代码: 15. 附加分题:如何在VB中实现打印预览(要能实现多页预览)(写思路也可,最好能编程实现)答对此题者总分加20. 程序代码: .NET & C# 基础知识试题 (20%) 1. 在.net(C# or vb.net)中如何获得当前窗体或控件的句柄,特别是控件本身的句柄(请列举)。 答案: 2. 在.net(C# or vb.net)中如何用户自定义消息,并在窗体中处理这些消息。 答案: 3. 在.net(C# or vb.net)如何启动另一个程序。 答案: 4. 在.net(C# or vb.net)中如何取消一个窗体的关闭。 答案: 5. 在.net(C# or vb.net)中,Appplication.Exit 还是 Form.Close有什么不同? 答案: 6. 在C#中有一个double型的变量,比如10321.5,比如122235401.21644,作为货币的值如何按各个不同国家的习惯来输出。比如美国用$10,321.50和$122,235,401.22而在英国则为£10 321.50和£122 235 401.22 答案: 7. 某一密码仅使用K、L、M、N、O共5个字母,密码中的单词从左向右排列,密码单词必须遵循如下规则: (1) 密码单词的最小长度是两个字母,可以相同,也可以不同 (2) K不可能是单词的第一个字母 (3) 如果L出现,则出现次数不止一次 (4) M不能使最后一个也不能是倒数第二个字母 (5) K出现,则N就一定出现 (6) O如果是最后一个字母,则L一定出现 问题一:下列哪一个字母可以放在LO中的O后面,形成一个3个字母的密码单词? A) K B)L C) M D) N 答案: 问题二:如果能得到的字母是K、L、M,那么能够形成的两个字母长的密码单词的总数是多少? A)1个 B)3个 C)6个 D)9个 答案: 问题三:下列哪一个是单词密码? A) KLLN B) LOML C) MLLO D)NMKO 答案: 8. 62-63=1 等式不成立,请移动一个数字(不可以移动减号和等于号),使得等式成立,如何移动? 答案: |