0% found this document useful (0 votes)
25 views19 pages

Introduction To C++ Programming

INTRODUCTION TO C++ PROGRAMMING

Uploaded by

abendanjhanine
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views19 pages

Introduction To C++ Programming

INTRODUCTION TO C++ PROGRAMMING

Uploaded by

abendanjhanine
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

INTRODUCTION TO

C++
PROGRAMMING
Prepared by: Jhanine Abendan
Course Objectives
 Understand the fundamental concepts of C++
programming.
 Understand the role and significance of C++ in the
industry.
 The concept of data types, tokens, input/output
operators, control statements and other C++
programming characteristics will be discussed to
strengthen the students’ foundation in the
development of programs.
 Develop programs using C++ applying the
fundamental OOP concepts.
Course Outline
 PART I  PART III

 Introduction to C++  Control Statements


 History of C++  Functions
 Object Oriented Concepts
 PART II
 PART IV
 C++ General Structure /
Syntax  Dev-C ++ Installation
 Comments  Write a First Program
 Variable declaration
 Tokens
 Data types
 Input and Output
Operators
WHAT IS C++ ?
C++ is a programming language.
C++ is an extension of the C language, in that most C
programs are also C++.
C++, as opposed to C, supports object-oriented programming.
History of C++ 1967 1979 1985-1989
Bjarne 1969-1973 11983
st 2011-2014
commercial C++
Stroustrop compiler Cfront,
Simula 67 began released by AT&T
developed as the developing C C++2.0 standard
first object with classes released
oriented language

?
1967 ?
1969-1973 ?
1979 ?
1983 ?
1985-1989 ?
2011
-2014
C++11 standard
The C language C with classes released
was invented by renamed to C+ C++14 released
Dennis Ritchie and +
Bell Labs
WHY C++ ?

PROS CONS
1. Better performance 1. Python, R, Matlab and
when dealing with other scripting
large amounts of data languages are faster
and ability to handle and easier to produce
complex algorithms. code.
2. Java uses c++ syntax 2. Not the easiest
and lots of good paying language to learn but
jobs for programmers. not the hardest either.
WHO USES C++ ?
● Computer makers such as Sun, SGI, IBM
and HP.
● Airport
● Computer chip manufacturers like
Motorola & Intel
● Software companies
● Banks
● Hongkong Government
● Hospital
● Telecommunications
● Universities
General Structure of C++
Program

“This is a quote, words full of


wisdom that someone important
said and can make the reader get
inspired.”

—SOMEONE FAMOUS
BASIC COMPONENTS OF C++
• PROGRAM
Comments or Documentation Section
• /* A Comment */ or // remainder of line ignored
• Pre-processor Directives (Linker Section)
• #include <iostream>
• Main () function
___
• Constant Declaration
• Ex: int I = 5;
• Variable Declaration
• Ex: int sum;
• Executable Statements
• cout << "Hello World" << endl;
C++ INTRODUCTION
Identifiers
Name given to programming elements
such as variables, functions, objects. i.e
Student, _dos
Keywords
Predefined word that gives
special meaning to the
TOKENS compiler
Literals
Smallest individual Literals / Constant are identifiers
unit in a program whose value does not change during
program execution.
Operators
Used to perform operations on
variables and values
IDENTIFIERS
Rules to be followed while creating
identifiers:
1. Should begin with either A-Z
(uppercase) or a-z (lowercase) or _
(underscore)
2. C++ treats uppercase and
lowercase differently
3. No special character allowed
except underscore
4. Should be single words. Blank
space cannot be included.
5. Reserved keywords should not be
Keywords
Despite being red, Mars
is actually a cold place

Keywords
Predefined word
that gives special
meaning to the
compiler
LITERALS / CONSTANT
Literals / Constant are identifiers whose value does not change during
program execution. A constant or literal maybe anyCharacter
one of the following:
Integer Constant
Constant
Whole number; Specified as single
either positive or negative; character enclosed in
Do not have fractional part or pair of quotation
exponent; mark;

Floating String
Constant Constant
Also called as real Zero or more character
constants; enclosed by double quotation
Values contains decimal marks;
point; Multiple character (array of
Can contain exponent or Char);
C++ INTRODUCTION
Arithmetic
Perform common mathematical
operations. i.e addition, subtraction,
multiplication, division. etc
Assignment
Used to assign values to
OPERATO variables. i.e = , += ,
RS
Used to perform
Relational
-=
Used to compare two values.
operations on variables i.e < , <= , > , >=
and values Logical
Used to determine logic
between variables or values
i.e && , || , ! ,
C++ CHARACTER SET

The valid set of


characters that C++
language can
0:50 / 2:50
recognize.
#loremipsum #loremipsum

Lorem Ipsum Dolor Sit Amet - Lorem


Ipsum Dolor Sit
300 views

Lorem Ipsum Dolor


Sit Amet
SUBSCRIBE
2.0 M
C++ DATA TYPES

A type defines a set of


values and a set of
operations that can
be applied on those
0:50 / 2:50
values.
#loremipsum #loremipsum

Lorem Ipsum Dolor Sit Amet - Lorem


Ipsum Dolor Sit
300 views

Lorem Ipsum Dolor


Sit Amet
SUBSCRIBE
2.0 M
Questions
LAB EXERCISE
Problem Statement:
Given a collection of nickels (US 5-cent coins)
and pennies (US 1-cent coins), find the
equivalent number of Philippine peso.
Input:
Nickels(integer) – no. of US nickels
Pennies (integer) – no. of US pennies
Output:
Peso (integer) – no. of peso coins to return

Initial Algorithm:
1. Read the number of nickels and pennies.
2. Compute the total value in US dollars.
3. Compute the corresponding total value in
Philippine peso.
4. Display the number of Philippine peso
coins.
REFERENCES
 Introduction to C++ ppt by Dr. Prof. K. Adisesha

You might also like