问题 填空题

使用VC6打开考生文件夹下的工程test10_1,此工程包含一个源程序文件test10_1.cpp,但该程序运行有问题,请改正程序中的错误,使程序的输出结果为;
class Base
class D1
class D2
class D3
fin Base
源程序文件test10_1.cpp清单如下:
#include<iostream.h>
class Base

public:
Base()cout<<"class Base"<<endl;
void f()cout<<"f in Base"<<endl;
;
class D1:virtual public Base

public:
D1()cout<<"class D1"<<endl;
void f()cout<<"f in D1"<<endl;
;
/*********found**********/
class D2:public Base

public:
D2()cout<<"class D2"<<endl;

/**********found**********/
class D3::public D1,public D2

public:
D3()cout<<"class D3"<<endl;
;
void main()

D3 d;
/**********found************/
d.f();

答案

参考答案:
(A)错误:class DB:public Base
正确:class DB:virtual public Base
(B)错误:class DC::public DA,public DB
正确:class DC:public DA,public DB
(C)错误:d.f();
正确:d.Base::f();

解析:
(1)主要考查考生对虚基类的理解,虚基类可以解决二义性的问题,其定义方式是在继承列表中使用virtual关键字,使用虚基类可以避免程序运行中对基类函数调用的不惟一;
(2)主要考查考生对类的定义方法的掌握,“::”为作用域符,此处应该使用“:”,因为后面是继承列表;
(3)主要考查考生对虚基类函数调用过程的理解,只有使用“:”限定才能访问基类函数,否则将会调用自身的函数,如果该类没有该函数的定义,则会自动调用其父类的该函数,所以必须使用“::”符号。

单项选择题 共用题干题

Information systems design is defined as those tasks that focus on the specification of a detailed computer-based solution. Typically, there are four systems design tasks for in-house development. 1)The first task is to specify (1), which defines the technologies to be used by one, more, or all information systems in terms of their data, processes, interfaces, and network components. This task is accomplished by analyzing the data models and process models that are initially created during requirements analysis. 2)The next systems design task is to develop the (2). The purpose of this task is to prepare technical design specifications for a database that will be adaptable to future requirements and expansion. 3)Once the database prototype has been built, the systems designer can work closely with system users to develop input, output and dialogue specifications. The (3) must be specified to ensure that the outputs are not lost, misrouted, misused, or incomplete. 4)The fourth design task involves packaging all the specifications from the previous design tasks into a set of specifications that will guide the (4) activities during the following phases of the systems development methodology. Finally, we should (5) and update the project plan accordingly. The key deliverable should include a detailed plan for the construction phase that should follow.

空白(2)处应选择()

A.database design specifications

B.database organization decisions

C.data structure specifications

D.data distribution decisions

单项选择题