Chap04 - Chapter 4 Program Input and the Software Design...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
41 Chapter 4 Program Input and the Software Design Process Chapter 4 PROGRAM INPUT AND THE SOFTWARE DESIGN PROCESS CHAPTER GOALS To be able to construct input statements to read values into a program. To be able to determine the contents of variables assigned values by input statements. To be able to write appropriate prompting messages for interactive programs. To know when noninteractive input/output is appropriate and how it differs from interactive input/output. To be able to write programs that use data files for input and output. To understand the basic principles of object-oriented design. To be able to apply the functional decomposition methodology to solve a simple problem. To be able to take a functional decomposition and code it in C++, using self-documenting code CHAPTER OUTLINE I. Getting Data into Programs A. Input Streams and the Extraction Operator ( >> ) B. The Reading Marker and the Newline Character C. Reading Character Data with the get Function Theoretical Foundations : More About Functions and Arguments D. Skipping Characters with the ignore Function E. Reading String Data II. Interactive Input/Output III. Noninteractive Input/Output IV. File Input and Output A. Files B. Using Files 1. Including the Header File fstream 2. Declaring File Streams 3. Opening Files 4. Specifying Files in Input/Output Statements C. An Example Program Using Files D. Run-Time Input of File Names V. Input Failure VI. Software Design Methodologies VII What are Objects? VIII. Object-Oriented Design A. Modules 1. Writing Cohesive Modules 2. Pseudocode B. Implementing the Design
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
42 Chapter 4 Program Input and the Software Design Process C. Perspective on Design Software Engineering Tip : Documentation IX. Functional Decomposition X. Problem-Solving Case Study : Stretching A Canvas Background Information : Programming on Many Scales XI. Testing and Debugging XII. Summary GENERAL DISCUSSION Chapter 4 introduces three key concepts: input using the cin stream, file I/O, and object-oriented vs. functional decomposition design. We have included file I/O in this chapter because it permits the use of prepared test data files in programming assignments. Requiring that the students' programs be run on an instructor-supplied data file is one way of increasing grading consistency. Input is a concept that is usually fairly easy to grasp. Its importance often is not appreciated fully, however. Without input, programs would be inflexible they would have to be recompiled for every new data set. Input bears a similarity to assignment because it is another way to store a value into a variable. Interactive I/O does not usually present any problems. Some students may refuse to believe that informative prompts are needed. They may argue that they know exactly what is meant by their program's cryptic prompts and that they're the only one who will ever use it anyway. The best approach here is to give some examples that demonstrate how hard it is to work with programs that don't use clear prompts. File I/O is usually a new concept to most of the students, but it is not particularly difficult in C++ because of
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/13/2011 for the course CSC 140 taught by Professor Lebre during the Spring '04 term at Moraine Valley Community College.

Page1 / 9

Chap04 - Chapter 4 Program Input and the Software Design...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online