KEMBAR78
Daftar
Login
A Powerpoint Presentation on CPP Programming | PPT
Download free for 30 days
Sign in
Upload
Language (EN)
Support
Business
Mobile
Social Media
Marketing
Technology
Art & Photos
Career
Design
Education
Presentations & Public Speaking
Government & Nonprofit
Healthcare
Internet
Law
Leadership & Management
Automotive
Engineering
Software
Recruiting & HR
Retail
Sales
Services
Science
Small Business & Entrepreneurship
Food
Environment
Economy & Finance
Data & Analytics
Investor Relations
Sports
Spiritual
News & Politics
Travel
Self Improvement
Real Estate
Entertainment & Humor
Health & Medicine
Devices & Hardware
Lifestyle
Change Language
Language
English
Español
Português
Français
Deutsche
Cancel
Save
Submit search
EN
Uploaded by
KrishnakumarJoshi8
PPT, PDF
10 views
A Powerpoint Presentation on CPP Programming
A presentation on C++ Programming
Education
◦
Read more
0
Save
Share
Embed
Download
Download to read offline
1
/ 40
2
/ 40
3
/ 40
4
/ 40
5
/ 40
6
/ 40
7
/ 40
8
/ 40
9
/ 40
10
/ 40
11
/ 40
12
/ 40
13
/ 40
14
/ 40
15
/ 40
16
/ 40
17
/ 40
18
/ 40
19
/ 40
20
/ 40
21
/ 40
22
/ 40
23
/ 40
24
/ 40
25
/ 40
26
/ 40
27
/ 40
28
/ 40
29
/ 40
30
/ 40
31
/ 40
32
/ 40
33
/ 40
34
/ 40
35
/ 40
36
/ 40
37
/ 40
38
/ 40
39
/ 40
40
/ 40
More Related Content
PPT
C++ basic.ppt
by
SityogInstituteOfTec1
PPTX
Lecture # 1 - Introduction Revision - 1 OOPS.pptx
by
SanaullahAttariQadri
PPT
Savitch ch 022
by
Dr .Ahmed Tawwab
PDF
Lecture # 1 introduction revision - 1
by
SajeelSahil
DOCX
Copyright © 2012 Pearson Addison-Wesley. All rights reser.docx
by
maxinesmith73660
PPTX
Week 03.pptx c++ loops files and expression
by
haseebulhasan750
PPT
savitchch02-C++Basic Computer Programming.ppt
by
RyahFayeCuenca
PPT
Chapter02-S11.ppt
by
GhulamHussain638563
C++ basic.ppt
by
SityogInstituteOfTec1
Lecture # 1 - Introduction Revision - 1 OOPS.pptx
by
SanaullahAttariQadri
Savitch ch 022
by
Dr .Ahmed Tawwab
Lecture # 1 introduction revision - 1
by
SajeelSahil
Copyright © 2012 Pearson Addison-Wesley. All rights reser.docx
by
maxinesmith73660
Week 03.pptx c++ loops files and expression
by
haseebulhasan750
savitchch02-C++Basic Computer Programming.ppt
by
RyahFayeCuenca
Chapter02-S11.ppt
by
GhulamHussain638563
Similar to A Powerpoint Presentation on CPP Programming
PPT
Chapter 2 Introduction to C++
by
GhulamHussain142878
PDF
C++ ch2
by
Venkateswarlu Vuggam
PPT
02a fundamental c++ types, arithmetic
by
Manzoor ALam
PPT
Savitch Ch 02
by
Terry Yoast
PPT
Savitch Ch 02
by
Terry Yoast
PPT
Chapter 3 Expressions and Inteactivity
by
GhulamHussain142878
PPT
Basics of c++ Programming Language
by
Ahmad Idrees
PPT
CPLUSPLUS UET PESHAWAR BS ELECTRICAL 2ND SEMSTER Lecture02.ppt
by
abdurrahimk182
PPTX
intro to programming presentation .pptx
by
farantouqeer8
PPTX
Programming Fundamentals
by
Zohaib Sharif
PPTX
#Code2 create c++ for beginners
by
GDGKuwaitGoogleDevel
PPT
Savitch ch 02
by
Terry Yoast
PPTX
C++ lecture 01
by
HNDE Labuduwa Galle
PPTX
SOW_C_CSO_Chapter_02_10e_a11y.pptx c++ chapter 2
by
alzawahramarkantony
PPTX
Lecture 1.pptx on plant morphology, intro
by
stephenopokuasante
PPT
Lecture 1.ppt morphology of higher plant
by
stephenopokuasante
PPT
2 Intro to C++ SOW_C++_CSO_Chapter_02_9e.ppt
by
azizt730
PDF
BASIC C++ PROGRAMMING
by
gufranresearcher
PPT
Lecture+06-TypesVars.ppt
by
KamranAli649587
PPT
Lecture06-TypesVarsConsts variables data types
by
atifmugheesv
Chapter 2 Introduction to C++
by
GhulamHussain142878
C++ ch2
by
Venkateswarlu Vuggam
02a fundamental c++ types, arithmetic
by
Manzoor ALam
Savitch Ch 02
by
Terry Yoast
Savitch Ch 02
by
Terry Yoast
Chapter 3 Expressions and Inteactivity
by
GhulamHussain142878
Basics of c++ Programming Language
by
Ahmad Idrees
CPLUSPLUS UET PESHAWAR BS ELECTRICAL 2ND SEMSTER Lecture02.ppt
by
abdurrahimk182
intro to programming presentation .pptx
by
farantouqeer8
Programming Fundamentals
by
Zohaib Sharif
#Code2 create c++ for beginners
by
GDGKuwaitGoogleDevel
Savitch ch 02
by
Terry Yoast
C++ lecture 01
by
HNDE Labuduwa Galle
SOW_C_CSO_Chapter_02_10e_a11y.pptx c++ chapter 2
by
alzawahramarkantony
Lecture 1.pptx on plant morphology, intro
by
stephenopokuasante
Lecture 1.ppt morphology of higher plant
by
stephenopokuasante
2 Intro to C++ SOW_C++_CSO_Chapter_02_9e.ppt
by
azizt730
BASIC C++ PROGRAMMING
by
gufranresearcher
Lecture+06-TypesVars.ppt
by
KamranAli649587
Lecture06-TypesVarsConsts variables data types
by
atifmugheesv
Recently uploaded
PPTX
Capital Budgeting - Risk Analysis Using Sensitivity Analysis
by
Sundar B N
PDF
Umlando kaMufi. IsiZulu Ulimi Lwebele...
by
NokwandaNzuza2
PDF
Admin Slides for Oct'25 semester - PBO - MC1.pdf
by
Mark Kor
PDF
Total Quality Management : A presentation by a third year student.
by
Mbalenhle Ndlovu
PPTX
PECTORAL REGION.pptx Human anatomy,Bmls,
by
KISMAT ALI
PDF
The Minority Caucus in Parliament has called on government to take immediate ...
by
nservice241
PDF
Phase Equilibria and Colligative Properties.pdf
by
Mithil Fal Desai
PDF
Who Owns the Narrative? Data, Disinformation, and the Missing Voice of Academia
by
Ismail Fahmi
PPTX
Welcome to our Open Evening 2025 Ballinrobe CS
by
jacollins1515
PPTX
Classification and Applied Aspects of Joints.pptx
by
Mathew Joseph
PPTX
THERAPEUTIC ENVIORNMENT.............pptx
by
AneetaSharma15
PDF
1.1 Historical background & development of Profession of Pharmacy.pdf
by
Mr. SAKHARE R. S.
PDF
Learning English by Project Based Learning: How to Make Foreign Friends
by
silvianalevana
PPTX
DPSM-BITDA Introduction Presentation Slides
by
Great Files
PPTX
Capital Budgeting - Risk Analysis Using Payback Period Method
by
Sundar B N
PDF
Yaksha Prashna | General Quiz at RLAC | Amlan Sarkar | Full Set
by
Amlan Sarkar
PPTX
Hudson Vitale "AI Essentials: From Tools to Strategies: A 2025 NISO Training ...
by
National Information Standards Organization (NISO)
PPTX
Exploring Entrepreneurial Qualities: A Curated Presentation for Grade 11 Busi...
by
SamanthaNkoana
PDF
Admin Slides for Oct'25 semester (Progression)
by
Great Files
PDF
BUSINESS ETHICS – UNIT I: Introduction to Business Ethics
by
D NANEE
Capital Budgeting - Risk Analysis Using Sensitivity Analysis
by
Sundar B N
Umlando kaMufi. IsiZulu Ulimi Lwebele...
by
NokwandaNzuza2
Admin Slides for Oct'25 semester - PBO - MC1.pdf
by
Mark Kor
Total Quality Management : A presentation by a third year student.
by
Mbalenhle Ndlovu
PECTORAL REGION.pptx Human anatomy,Bmls,
by
KISMAT ALI
The Minority Caucus in Parliament has called on government to take immediate ...
by
nservice241
Phase Equilibria and Colligative Properties.pdf
by
Mithil Fal Desai
Who Owns the Narrative? Data, Disinformation, and the Missing Voice of Academia
by
Ismail Fahmi
Welcome to our Open Evening 2025 Ballinrobe CS
by
jacollins1515
Classification and Applied Aspects of Joints.pptx
by
Mathew Joseph
THERAPEUTIC ENVIORNMENT.............pptx
by
AneetaSharma15
1.1 Historical background & development of Profession of Pharmacy.pdf
by
Mr. SAKHARE R. S.
Learning English by Project Based Learning: How to Make Foreign Friends
by
silvianalevana
DPSM-BITDA Introduction Presentation Slides
by
Great Files
Capital Budgeting - Risk Analysis Using Payback Period Method
by
Sundar B N
Yaksha Prashna | General Quiz at RLAC | Amlan Sarkar | Full Set
by
Amlan Sarkar
Hudson Vitale "AI Essentials: From Tools to Strategies: A 2025 NISO Training ...
by
National Information Standards Organization (NISO)
Exploring Entrepreneurial Qualities: A Curated Presentation for Grade 11 Busi...
by
SamanthaNkoana
Admin Slides for Oct'25 semester (Progression)
by
Great Files
BUSINESS ETHICS – UNIT I: Introduction to Business Ethics
by
D NANEE
A Powerpoint Presentation on CPP Programming
1.
Chapter 1 C++ Basics Copyright
© 2008 Pearson Addison-Wesley. All rights reserved
2.
1-2 Learning Objectives • Introduction
to C++ – Origins, Object-Oriented Programming, Terms • Variables, Expressions, and Assignment Statements • Console Input/Output • Program Style • Libraries and Namespaces Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
3.
1-3 Introduction to C++ •
C++ Origins – Low-level languages • Machine, assembly – High-level languages • C, C++, ADA, COBOL, FORTRAN – Object-Oriented-Programming in C++ • C++ Terminology – Programs and functions – Basic Input/Output (I/O) with cin and cout Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
4.
1-4 Display 1.1 A Sample
C++ Program (1 of 2) Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
5.
Display 1.1 A Sample
C++ Program (2 of 2) 1-5 Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
6.
1-6 C++ Variables • C++
Identifiers – Keywords/reserved words vs. Identifiers – Case-sensitivity and validity of identifiers – Meaningful names! • Variables – A memory location to store data for a program – Must declare all data before use in program Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
7.
Data Types: Display 1.2
Simple Types (1 of 2) 1-7 Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
8.
Data Types: Display 1.2
Simple Types (2 of 2) 1-8 Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
9.
1-9 Assigning Data • Initializing
data in declaration statement – Results "undefined" if you don’t! • int myValue = 0; • Assigning data during execution – Lvalues (left-side) & Rvalues (right-side) • Lvalues must be variables • Rvalues can be any expression • Example: distance = rate * time; Lvalue: "distance" Rvalue: "rate * time" Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
10.
1-10 Assigning Data: Shorthand
Notations • Display, page 14 Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
11.
1-11 Data Assignment Rules •
Compatibility of Data Assignments – Type mismatches • General Rule: Cannot place value of one type into variable of another type – intVar = 2.99; // 2 is assigned to intVar! • Only integer part "fits", so that’s all that goes • Called "implicit" or "automatic type conversion" – Literals • 2, 5.75, "Z", "Hello World" • Considered "constants": can’t change in program Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
12.
1-12 Literal Data • Literals –
Examples: • 2 // Literal constant int • 5.75 // Literal constant double • "Z" // Literal constant char • "Hello World" // Literal constant string • Cannot change values during execution • Called "literals" because you "literally typed" them in your program! Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
13.
1-13 Escape Sequences • "Extend"
character set • Backslash, preceding a character – Instructs compiler: a special "escape character" is coming – Following character treated as "escape sequence char" – Display 1.3 next slide Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
14.
Display 1.3 Some Escape
Sequences (1 of 2) 1-14 Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
15.
Display 1.3 Some Escape
Sequences (2 of 2) 1-15 Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
16.
1-16 Constants • Naming your
constants – Literal constants are "OK", but provide little meaning • e.g., seeing 24 in a pgm, tells nothing about what it represents • Use named constants instead – Meaningful name to represent data const int NUMBER_OF_STUDENTS = 24; • Called a "declared constant" or "named constant" • Now use it’s name wherever needed in program • Added benefit: changes to value result in one fix Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
17.
1-17 Arithmetic Operators: Display 1.4
Named Constant (1 of 2) • Standard Arithmetic Operators – Precedence rules – standard rules Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
18.
Arithmetic Operators: Display 1.4
Named Constant (2 of 2) 1-18 Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
19.
1-19 Arithmetic Precision • Precision
of Calculations – VERY important consideration! • Expressions in C++ might not evaluate as you’d "expect"! – "Highest-order operand" determines type of arithmetic "precision" performed – Common pitfall! Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
20.
1-20 Arithmetic Precision Examples •
Examples: – 17 / 5 evaluates to 3 in C++! • Both operands are integers • Integer division is performed! – 17.0 / 5 equals 3.4 in C++! • Highest-order operand is "double type" • Double "precision" division is performed! – int intVar1 =1, intVar2=2; intVar1 / intVar2; • Performs integer division! • Result: 0! Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
21.
1-21 Individual Arithmetic Precision •
Calculations done "one-by-one" – 1 / 2 / 3.0 / 4 performs 3 separate divisions. • First 1 / 2 equals 0 • Then 0 / 3.0 equals 0.0 • Then 0.0 / 4 equals 0.0! • So not necessarily sufficient to change just "one operand" in a large expression – Must keep in mind all individual calculations that will be performed during evaluation! Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
22.
1-22 Type Casting • Casting
for Variables – Can add ".0" to literals to force precision arithmetic, but what about variables? • We can’t use "myInt.0"! – static_cast<double>intVar – Explicitly "casts" or "converts" intVar to double type • Result of conversion is then used • Example expression: doubleVar = static_cast<double>intVar1 / intVar2; – Casting forces double-precision division to take place among two integer variables! Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
23.
1-23 Type Casting • Two
types – Implicit—also called "Automatic" • Done FOR you, automatically 17 / 5.5 This expression causes an "implicit type cast" to take place, casting the 17 17.0 – Explicit type conversion • Programmer specifies conversion with cast operator (double)17 / 5.5 Same expression as above, using explicit cast (double)myInt / myDouble More typical use; cast operator on variable Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
24.
1-24 Shorthand Operators • Increment
& Decrement Operators – Just short-hand notation – Increment operator, ++ intVar++; is equivalent to intVar = intVar + 1; – Decrement operator, -- intVar--; is equivalent to intVar = intVar – 1; Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
25.
1-25 Shorthand Operators: Two
Options • Post-Increment intVar++ – Uses current value of variable, THEN increments it • Pre-Increment ++intVar – Increments variable first, THEN uses new value • "Use" is defined as whatever "context" variable is currently in • No difference if "alone" in statement: intVar++; and ++intVar; identical result Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
26.
1-26 Post-Increment in Action •
Post-Increment in Expressions: int n = 2, valueProduced; valueProduced = 2 * (n++); cout << valueProduced << endl; cout << n << endl; – This code segment produces the output: 4 3 – Since post-increment was used Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
27.
1-27 Pre-Increment in Action •
Now using Pre-increment: int n = 2, valueProduced; valueProduced = 2 * (++n); cout << valueProduced << endl; cout << n << endl; – This code segment produces the output: 6 3 – Because pre-increment was used Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
28.
1-28 Console Input/Output • I/O
objects cin, cout, cerr • Defined in the C++ library called <iostream> • Must have these lines (called pre- processor directives) near start of file: – #include <iostream> using namespace std; – Tells C++ to use appropriate library so we can use the I/O objects cin, cout, cerr Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
29.
1-29 Console Output • What
can be outputted? – Any data can be outputted to display screen • Variables • Constants • Literals • Expressions (which can include all of above) – cout << numberOfGames << " games played."; 2 values are outputted: "value" of variable numberOfGames, literal string " games played." • Cascading: multiple values in one cout Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
30.
1-30 Separating Lines of
Output • New lines in output – Recall: "n" is escape sequence for the char "newline" • A second method: object endl • Examples: cout << "Hello Worldn"; • Sends string "Hello World" to display, & escape sequence "n", skipping to next line cout << "Hello World" << endl; • Same result as above Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
31.
1-31 Formatting Output • Formatting
numeric values for output – Values may not display as you’d expect! cout << "The price is $" << price << endl; • If price (declared double) has value 78.5, you might get: – The price is $78.500000 or: – The price is $78.5 • We must explicitly tell C++ how to output numbers in our programs! Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
32.
1-32 Formatting Numbers • "Magic
Formula" to force decimal sizes: cout.setf(ios::fixed); cout.setf(ios::showpoint); cout.precision(2); • These stmts force all future cout’ed values: – To have exactly two digits after the decimal place – Example: cout << "The price is $" << price << endl; • Now results in the following: The price is $78.50 • Can modify precision "as you go" as well! Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
33.
1-33 Error Output • Output
with cerr – cerr works same as cout – Provides mechanism for distinguishing between regular output and error output • Re-direct output streams – Most systems allow cout and cerr to be "redirected" to other devices • e.g., line printer, output file, error console, etc. Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
34.
1-34 Input Using cin •
cin for input, cout for output • Differences: – ">>" (extraction operator) points opposite • Think of it as "pointing toward where the data goes" – Object name "cin" used instead of "cout" – No literals allowed for cin • Must input "to a variable" • cin >> num; – Waits on-screen for keyboard entry – Value entered at keyboard is "assigned" to num Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
35.
1-35 Prompting for Input:
cin and cout • Always "prompt" user for input cout << "Enter number of dragons: "; cin >> numOfDragons; – Note no "n" in cout. Prompt "waits" on same line for keyboard input as follows: Enter number of dragons: ____ • Underscore above denotes where keyboard entry is made • Every cin should have cout prompt – Maximizes user-friendly input/output Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
36.
1-36 Program Style • Bottom-line:
Make programs easy to read and modify • Comments, two methods: – // Two slashes indicate entire line is to be ignored – /*Delimiters indicates everything between is ignored*/ – Both methods commonly used • Identifier naming – ALL_CAPS for constants – lowerToUpper for variables – Most important: MEANINGFUL NAMES! Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
37.
1-37 Libraries • C++ Standard
Libraries • #include <Library_Name> – Directive to "add" contents of library file to your program – Called "preprocessor directive" • Executes before compiler, and simply "copies" library file into your program file • C++ has many libraries – Input/output, math, strings, etc. Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
38.
1-38 Namespaces • Namespaces defined: –
Collection of name definitions • For now: interested in namespace "std" – Has all standard library definitions we need • Examples: #include <iostream> using namespace std; • Includes entire standard library of name definitions • #include <iostream>using std::cin; using std::cout; • Can specify just the objects we want Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
39.
1-39 Summary 1 • C++
is case-sensitive • Use meaningful names – For variables and constants • Variables must be declared before use – Should also be initialized • Use care in numeric manipulation – Precision, parentheses, order of operations • #include C++ libraries as needed Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
40.
1-40 Summary 2 • Object
cout – Used for console output • Object cin – Used for console input • Object cerr – Used for error messages • Use comments to aid understanding of your program – Do not overcomment Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
Download