C++ 基础练习 - 第一章(英文版)

1.1 What do you think are the major issues facing the software industry today?

Answer: Many software products are either not finished or not used or not delivered for some major errors. Today some of the quality issues that must be considered for software industry are: Correctness; Maintainability; Reusability; Openness and interoperability; Portability; Security; Integrity; User friendliness; etc..

1.2 Discuss an approach to the development of procedure-oriented programs.

Answer: In the procedure-oriented approach, the problem is viewed as a sequence of things to be done such as: Reading, Calculating, Printing, etc..

1.3 Describe how data are shared by functions in a procedure-oriented program.

Answer: In a multi-function program, many important data item are placed as global so that they may be accessed by all the functions. Each function may have its own local data.

1.4 What is object-oriented programming? How is it different from procedure-oriented programming?

Answer: OOP is an approach that provides a way of modularizing programs by creating partitioned memory areas for both data and functions that can be used as templates for the creation of copies of such modules on demand. Different between OOP and POP:

OOP has data hiding feature for which the data of a class cannot be accessed by the member function of other class but POP has no such feature.

In OOP we can design our own data type which is the same as the built-in data type. But in POP we can not do this.

1.5 How are data and functions organized in an OOP?

Answer: Data and functions belong to a class. Data is called data members and functions are called member functions. There is a visibility-mode such as public and private. Generally, data is private and functions are public.

1.6 What are the unique advantages of an OOP paradigm?

Answer: The unique advantage of the OOP paradigm is to have a working definition of OOP before we proceed further.

1.7 What kinds of things can become objects in OOP?

Answer: Objects are the basic run-time entities in an object-oriented system. They may represent a person, a place, a bank account, a table of data or any item that the program has to handle.

1.8 Describe inheritance as applied to OOP.

Answer: Inheritance is one of the most powerful features of OOP. Inheritance is the process of creating a new class from the existing class. The new class is called and the existing class is called the base class.

1.9 What do you mean by dynamic binding? How is it useful in OOP?

Answer: Binding refers to the linking of a procedure call to be executed in response to the call. When binding occurs at run time it is known as dynamic binding. Dynamic binding is useful in OOP such as a function call associated with a polymorphic reference depends on the dynamic type of that reference.

1.10 List a few areas of application of OOP technology.

Answer: Real-time system; Simulation and modelling; Object-oriented database; Hypertext, hypermedia; Decision support and office automation system.

1.11 Distinguish between the following terms:

(a). Objects and classes.

(b). Data abstraction and data encapsulation. (数据抽象和数据封装)

(c). Inheritance and polymorphism. (继承和多态)

(d). Dynamic binding and message passing.

Answer:

(a). Objects are the basic run-time entities which contain data and code to manipulate data where the entire set of data and code of an object can be made as a user-defined data type with the help of a class. In short, objects are the numbers of classes.

(b). Describing the functionality of a class independent of its implementation is called data abstraction. Where data encapsulation means the wrapping up of data and functions into a single unit.

(c). The mechanism of deriving a new class from an old one is called inheritance, where polymorphism means one thing with several distinct terms.

(d). Binding refers to the linking of a procedure call to be executed in response to the call. When binding occurs at run-time, then it's known as dynamic-binding.

Message passing involves specifying the name of the object, the name of the function and the information to be sent.

1.12 State whether the following statements are TRUE or FALSE.

a. In POP, all data are shared by all functions.

b. The main emphasis of POP is on algorithms rather than on data.

c. One of the striking features of OOP is the division of programs into objects that represent real-world entities.

d. Wrapping up of data of different types into a single unit is known as encapsulation.

e. One problem with OOP is that once a class is created it can never be changed.

f. Inheritance means the ability to reuse the data values of one object by another.

g. Polymorphism is extensively used in implementing inheritance.

h. OOP are executed much faster than conventional programs.

i. Object-oriented systems can scale up better from small to large.

j. Object-oriented approach cannot be used to create databases.

Answer: FALSE; TRUE; TRUE; FALSE; FALSE; TRUE; TRUE; FALSE; TRUE; FALSE

欢迎大家留言指正,让我们在C++的道路上越走越深入,祝我们都早日找到理想的工作!共勉!

  • 21
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值