Programming C Week 3 4
Programming C Week 3 4
R o m e l P. S a l a z a r, M i n d Te c h
The basic structure of C++
Pro gramming
#include <iostream>
Example:
Example:
Error
cout << "Four Score/nAnd seven/nYears ago./n";
Four Score/nAnd seven/nYears ago. /n
cout << "Good" << \n;
cout << "Morning" << \n;
Proper
cout << "Good\n";
cout << "Morning\n";
“\n” or Newline escape sequence:
Escape sequence:
Here are some specific rules that must be followed with all iden-
tifiers:
Here are some specific rules that must be followed with all iden-
tifiers:
Example: cout << "The value in number is" << number << endl;
Integer Data Types
Integers are whole numbers like 12, 157, −34, and
2. Floating point numbers have a decimal point, like 23.7,
189.0231, and 0.987. Additionally, the integer and floating
point data types are broken into even more classifications.
The primary considerations for selecting a numeric data
type are:
unsigned speed;
short month;
unsigned short amount;
long deficit;
unsigned long insects;
long long grandTotal;
unsigned long long lightYearDistance;
Integer Data Types
Notice in Table 4 that the int and long data types have the
same sizes and ranges, and that the unsigned int data type has the
same size and range as the unsigned long data type. This is not
always true because the size of integers is dependent on the type of
system you are using. Here are the only guarantees:
Integer Data Types
#include <string>
Example:
string movieTitle;
movieTitle = "Wheels of Fury"; (You can assign a string
literal to movieTitle with the assignment operator.)
Example:
cin >> hours;
cin >> rate;
Process:
Example:
cout << "How many hours did you work? ";
cout << "How much do you get paid per hour? ";
cout << "You have earned $" << pay << endl;
Output:
Read A, B
C=A+B
Flowchart
Example 3: A flowchart that finds the greater number
between two numbers.
Graphic Design
VS
Information Design
Graphic
Is mostly concerned with elements of
Design
design such as typography, color, images, and the
use of space.
Is the effective presentation of information using design elements
and techniques.
Information
Design
The absence of the proper
planning and research in the devel-
opment of information dissemi-
nated via images may cause com-
munication
problems.
Info raphics
Other term of infographics is Data Visualization -- the
representation of the data using colors, shapes, lines, and other
visual.
Charts and graphs were the most common methods of data visualization
in the past.
Things to consider when making infographics:
Cheat Sheet
Serves as a quick reference for different kinds of
information. Can also be in the form of a step – by – step process on
how to do things.
Thank You
Fully Editable Icon Sets : A
FREE
PPT TEM-
PLATES
www.allppt.com
Fully Editable Icon Sets : B
FREE
PPT TEM-
PLATES
www.allppt.com
Fully Editable Icon Sets : C
FREE
PPT TEM-
PLATES
www.allppt.com