Chap2 - Chapter 2 Problem Solving Using C 1 Outline...

Info icon This preview shows pages 1–18. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Chapter 2 Problem Solving Using C++
Image of page 1

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

View Full Document Right Arrow Icon
2 Outline Introduction to C++ Programming Style Data Types Arithmetic Operations Variables and Declaration Statements
Image of page 2
3 Modular Program: a program consisting of interrelated segments arranged in a logical and understandable form Easier to develop, correct, and modify than other kinds of programs Module: a small segment which is designed to perform a specific task A group of modules is used to construct a modular program Introduction to C++
Image of page 3

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

View Full Document Right Arrow Icon
4 Introduction to C++ (continued) Figure 2.1 A well-designed program is built using modules.
Image of page 4
5 Modules in C++ can be classes or functions Function: accepts an input and produces an output by processing the input in some fashion Class: contains both data and functions used to manipulate the data Introduction to C++ (continued)
Image of page 5

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

View Full Document Right Arrow Icon
6 Introduction to C++ (continued) Figure 2.2 A multiplying function.
Image of page 6
7 Introduction to C++: The main() Function Overall structure of a C++ program contains one function named main() , called the driver function All other functions are invoked from main()
Image of page 7

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

View Full Document Right Arrow Icon