Chap03 - Chapter 3 Numeric Types, Expressions, and Output...

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

View Full Document Right Arrow Icon
Chapter 3 Numeric Types, Expressions, and Output Chapter 3 NUMERIC TYPES, EXPRESSIONS, AND OUTPUT CHAPTER GOALS To be able to declare named constants and variables of type int and float . To be able to construct simple arithmetic expressions. To be able to evaluate simple arithmetic expressions. To be able to construct and evaluate expressions that include multiple arithmetic operations. To understand implicit type coercion and explicit type conversion. To be able to call (invoke) a value-returning function. To be able to recognize and understand the purpose of function arguments. To be able to use C++ library functions in expressions. To be able to call (invoke) a void function (one that does not return a function value). To be able to use C++ manipulators to format the output. To learn and be able to use additional operations associated with the string type. To be able to format the statements in a program in a clear and readable fashion CHAPTER OUTLINE I. Overview of C++ Data Types II. Numeric Data Types A. Integral Types B. Floating-Point Types III. Declarations for Numeric Types A. Name Constant Declarations Software Engineering Tip : Using Named Constants Instead of Literals B. Variable Declarations IV. Simple Arithmetic Expressions A. Arithmetic Operations B. Increment and Decrement Operators V. Compound Arithmetic Expressions A. Precedence Rules B. Type Coercion and Type Casting 1. Assignment Statement 2. Arithmetic Expressions May We Introduce : Blaise Pascal VI. Function Calls and Library Functions A. Value-Returning Functions B. Library Functions C. Void Functions VII. Formatting the Output A. Integers and Strings B. Floating-Point Numbers VIII. Additional String Operations A. The length and size Functions B. The find Function C. The substr Function Software Engineering Tip : Understanding Before Changing
Background image of page 1

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

View Full DocumentRight Arrow Icon
Chapter 3 Numeric Types, Expressions, and Output GENERAL DISCUSSION In Chapter 2, we introduced only the basic concepts and syntax necessary to begin writing programs. Our goal was for students to learn to apply these concepts without having to deal with unnecessary syntactical baggage. Now that the first program has been developed and the students have had a little time to digest all of the new concepts, we refine and complete the discussion of expressions and output. The major topics in Chapter 3 are numeric data types/arithmetic expressions, function calls, output formatting, and string operations. The first of these – numeric data types/arithmetic expressions – includes discussion of operator precedence so that multioperator expressions can be composed correctly. There is nothing tricky about the precedence rules, and students who are comfortable with algebra will easily understand them. However, students with weak math backgrounds may be unfamiliar with the rules. For these people, all that should be required is some practice homework in evaluating expressions whose results are
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 / 6

Chap03 - Chapter 3 Numeric Types, Expressions, and Output...

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