Programming Fundamentals - A Modular Structured Approach using C++ docx

314 198 0
Programming Fundamentals - A Modular Structured Approach using C++ docx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Programming Fundamentals - A Modular Structured Approach using C++ By: Kenneth Leroy Busbee Programming Fundamentals - A Modular Structured Approach using C++ By: Kenneth Leroy Busbee Online: <http://cnx.org/content/col10621/1.17/ > C O N N E X I O N S Rice University, Houston, Texas [...]... module and function We are going to use the term function for that is what they are called in the two predominant programming languages of today: C++ and Java Functions are important because they allow us to take large complicated programs and to divide them into smaller manageable pieces Because the function is a smaller piece of the overall program, we can concentrate on what we want it to do and test... programs using a programming language decided by the System Analyst Once the system of programs is tested the new application is installed for people to use As time goes by, things change and a specic part or program might need repair During the Maintenance phase, it goes through a mini planning, analysis, design and implementation The programs that need modication are identied and programmers change... that program Depending on the programming language, there is a formal way to: 1 dene a function (it's 2 call a function 3 declare a function (a denition or the code it will execute) prototype is a declaration to a complier) Program Control functions normally to do not communicate information to each other but use a common area for variable storage Specic Task functions are constructed so that data... that data can be communicated between the calling program piece (which is usually another function) and the function being called This ability to communicate data is what allows us to build a specic task function that may be used in many programs The rules for how the data is communicated in and out of a function vary greatly by programming language, but the concept is the same The data items passed (or... future There are three broad areas of activity: • • • Understanding the Program Using Design Tools to Create a Model Develop Test Data 2.1.2 Understanding the Program If you are working on a project as a one of many programmers, the system analyst may have created a variety of documentation items that will help you understand what the program is to do These could include screen layouts, narrative descriptions,... dened) are placed near the top of the program before the function main three things you do in conjunction with a function in the order that they normally appear in a program, there is a formal way to: 1 declare a function (a prototype is a communications declaration to a complier) 2 call a function 3 dene a function 1.3.3 C++ Program Layout From the above example, you can see that 2/3 of the program is... CHAPTER 1 1 INTRODUCTION TO PROGRAMMING 22 • We are now going to make simple modications to this program so that it is able to average the weight of three people Do the following: • Within the variables area, change the variable names for age1 and age2 to weight1 and weight2 Add another variable of integer data type with the identier name of weight3 • The input area has... prompts and requests for data from the user They are paired up  a prompt and getting data from the keyboard We need to modify the prompt to ask for weight instead of age We need to change the variable name from age1 to weight1 Do this for the second pair that prompts and gets the second data item Create a third pair that prompts and gets the third data item • The process area has only one line of code and... The chapters are divided into ve groups Group Title Chapters Modules Pre-Chapter Items N /A 3 Foundation Topics 1-5 27 Modular Programming 6-9 17 Structured Programming 1 0-1 6 30 Intermediate Topics 1 7-2 1 17 Advanced Topics 2 2-2 4 11 Review Materials N /A 5 Appendix N /A 7 Total Modules N /A 117 Table 1 Some professors using this textbook/collection might decide to eliminate certain modules or chapters... has been prepared and includes references for the following textbooks: th Edition, ISBN: 0-3 2 1-5 123 8-3 th Edition, ISBN: 0-3 2 1-3 834 8-6 2 Starting Out with C++ Early Objects, by: Tony Gaddis et al., 5 nd Edition, 3 Computer Science  A structured Approach using C++, by: Behrouz A Forouzan et al., 2 1 Starting Out with C++ Early Objects, by: Tony Gaddis et al., 6 ISBN: 0-5 3 4-3 748 0-8 These textbooks are . Programming Fundamentals - A Modular Structured Approach using C++ By: Kenneth Leroy Busbee Programming Fundamentals - A Modular Structured Approach using. h4" alt=""

Ngày đăng: 08/03/2014, 11:20

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan