Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 787 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
787
Dung lượng
42,57 MB
Nội dung
[...]... language can be done in two ways When each statement in the source program is translated separately and executed immediately after translation, the programming language is called an interpreted language, and the program doing the translation is an interpreter Examples of interpreted languages are BASIC and Perl When all statements in a source program are translated as a complete unit before any statement... of data values and cout for output of data values—are provided in C++ You use these two objects extensively in your early work Program Translation After an algorithm or a class is written in C++, it still can’t be run on a computer without further translation because all computers’ internal language consists of a series of 1s and 0s, called machine language Generating a machine-language program that... example, a student’s name and grade point average can be considered a data object; in this case, the object consists of two pieces of data Similarly, a name, street address, city, state, and zip code can be packaged as an object, one that would be useful for a program used to print address labels Finally, a multiplication table, such as the 10s table, can be considered a data object—in this case, a. .. can respond to and other programmers can understand The set of instructions, data, and rules used to construct a program is called a programming language Programming languages are usefully classified by level and orientation Languages using instructions resembling written languages, such as English, are referred to as highlevel languages Visual Basic, C, C++, and Java are examples of high-level languages.1... 10:43 AM 14 Getting Started A similar analogy is suitable for a class A class, which encapsulates both data and operations, can be thought of as a complete processing plant containing all the raw materials (the data being operated on) and all the machines (functions) needed for input, output, and processing of these materials An important requirement for designing a good function or class is giving it a. .. programming language is called a compiled language In this case, the program doing the translation is called a compiler Because C++ is a compiled language, a C++ source program is translated as a unit into machine language Figure 1.7 shows the relationship between a program in C++ source code and its compilation into a machine-language object program The source code is entered by using an editor program,... Programming C++, which is classified as an object-oriented language, contains features of both procedural and object-oriented languages The reason for C++ s dual nature is that it began as an extension to C, which is a procedural language developed in the 1970s at AT&T Bell Laboratories In the early 1980s, Bjarne Stroustrup (also at AT&T) used his background in simulation languages to develop C++A central... of characters B_C7785_01.1c 14 1/18/11 10:43 AM Chapter 1 15 Function and Class Names Point of Information Tokens In a computer language, a token is the smallest unit of the language that has a unique meaning to the compiler Therefore, keywords, programmer-defined identifiers, and all special mathematical symbols, such as + and -, are considered tokens of the C++ language Separating characters in a multicharacter... chapter explains the basic structure of a C++ program and how to develop a working first program An additional element required for programming a computer successfully is understanding what an algorithm does, how programs can be built with a modular design, and what constitutes a “good” program, and these topics are covered in this chapter The goal of all professional programmers is to create readable, efficient,... allow students to take exams at their computers and save instructors time because each exam is graded automatically The Test Bank is also available in WebCT and Blackboard formats PowerPoint Presentations This book comes with Microsoft PowerPoint slides for each chapter They are included as a teaching aid for classroom presentations, to make available to students on the network for chapter review, or . Michael Beckett Proofreader: Camille Kiolbasa Indexer: Michael Brackney Editorial Assistant: Jacqueline Lacaire Content Project Manager: Lisa Weidenfeld Associate Marketing Manager: Shanna Shelton Art. One-Dimensional Arrays 292 Input and Output of Array Values 296 7.2 Array Initialization 303 7.3 Arrays as Arguments 307 7.4 Two-Dimensional Arrays 313 Larger Dimensional Arrays 319 7.5 Common Programming. Standard Template Library 573 Part Three Additional Topics 603 Chapter 14 The string Class and Exception Handling 605 Chapter 15 Strings as Character Arrays 665 Chapter 16 Data Structures 701 Appendixes Appendix