Содержание
- 2. 1.1 General Notes About C++ and This Course Course geared toward novice programmers Stress programming clarity
- 3. 1.1 General Notes About C++ and This Course What do you need? Books: C++ How to
- 4. 1.2 Introduction to C++ Programming C++ language Facilitates structured and disciplined approach to computer program design
- 5. 1.3 Basics of a Typical C++ Environment C++ systems Program-development environment Language C++ Standard Library
- 6. 1.3 Basics of a Typical C++ Environment Phases of C++ Programs: Edit Preprocess Compile Link Load
- 7. 1.3 Basics of a Typical C++ Environment Input/output cin Standard input stream Normally keyboard cout Standard
- 8. 1.3 A Simple Program: Printing a Line of Text Comments Document programs Improve program readability Ignored
- 9. 1 // Fig. 1.2: fig01_02.cpp 2 // A first program in C++. 3 #include 4 5
- 10. 1.31 A Simple Program: Printing a Line of Text Standard output stream object std::cout “Connected” to
- 11. 1.31 A Simple Program: Printing a Line of Text
- 12. 1 // Fig. 1.4: fig01_04.cpp 2 // Printing a line with multiple statements. 3 #include 4
- 13. 1 // Fig. 1.5: fig01_05.cpp 2 // Printing multiple lines with a single statement 3 #include
- 14. 1.4 Variables Variables Location in memory where value can be stored Common data types int -
- 15. Variables Variable names Valid identifier Series of characters (letters, digits, underscores) Cannot begin with digit Case
- 16. 1.5 Memory Concepts Variable names Correspond to actual locations in computer's memory Every variable has name,
- 17. 1.5 Memory Concepts std::cin >> integer1; Assume user entered 45 std::cin >> integer2; Assume user entered
- 18. 1.6 Data types C and C++ have four basic built-in data types, described here for binary-based
- 19. 1.6 Data types
- 20. 1.6 Data types Specifiers Specifiers modify the meanings of the basic built-in types and expand them
- 21. 1.6 Data types The exact sizes and ranges of values for the fundamental types are implementation
- 22. 1.6 C++ Data Types The guaranteed minimum range for each type as specified by the ANSI/ISO
- 23. 1. C++ Data Types
- 24. 1.7 Arithmetic Arithmetic calculations * Multiplication / Division Integer division truncates remainder 7 / 5 evaluates
- 25. 1.7 Arithmetic Rules of operator precedence Operators in parentheses evaluated first Nested/embedded parentheses Operators in innermost
- 26. 1.7 Arithmetic
- 27. 1.8 Decision Making: Equality and Relational Operators if structure Make decision based on truth or falsity
- 28. 1.8 Decision Making: Equality and Relational Operators
- 29. 1 // 2 // Using if statements, relational 3 // operators, and equality operators. 4 #include
- 30. 26 if ( num1 27 cout 28 29 if ( num1 > num2 ) 30 cout
- 31. Enter two integers, and I will tell you the relationships they satisfy: 7 7 7 is
- 32. Readings: C++ How to Program, By H. M. Deitel Chapter 1. Introduction to Computers, the Internet
- 34. Скачать презентацию