{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

Info icon This 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
Image of page 1

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

View Full Document Right 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 dependent on the order of evaluation.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern