Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Datalgo Lesson 3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

BOARD

DATA STRUCTURES AND


ALGORITHM
(DATALGO)

Lesson 1:
Introduction to Data Structures

Lecturer:
Ms. Jochelle P. Plazo

ACCESS COMPUTER COLLEGE


BOARD

TOPIC

Introduction/Definitions
a. Introduction to Data Structures
b. Classification of Data Structures
c. Structured of C++
d. The Basics of C++
- Simple Data Types
- Arithmetic Operators
BOARD
Topic 1: Introduction: Data

Statistics Information

Details
Facts

What is DATA?

REFERENCE ANALYSIS
BOARD
Topic 1: Introduction: Data Structure
Person
What is Data Structure?
•It is a particular way of Student Sport Team
Member
organizing data in a computer so
that it can be used effectively. Student
Assistant
Coach

Captain
BOARD
Topic 2: Classification Data Structure

Data Structure

Simple Data Structure Compound Data Structure

Array Structure

Linear Non-Linear

Tree
Stack Queue Linked Lists
BOARD
Topic 2: Data Structure
What is programming?
“Programming is how you get computers to solve
problems.”
Computer programs (or software) just about
everything. ) are what make computers work.
Without software, modern computers are just
complicated machines for turning electricity into
heat. It’s software on your computer that runs
your operating system, browser, email, games,
movie player.
BOARD
Topic 2: Data Structure

What is C++?

C++ is a very popular language for


performance-critical applications that rely on speed
and efficient memory management. It’s used in a
wide range of industries including software and
game development, VR, robotics, and scientific
computing.

Bjarne Stroustrup
Creator of C++
BOARD
Topic 2: Turbo C++
Turbo C++ is a discontinued C++ compiler and
Integrated development environment originally
from Borland.
BOARD
Topic 3: Structured of a C++ Program

Source code Output


BOARD
Topic 3: The Basics of C++ Program

Function : collection of statements; when


execute, accomplishes something
- May be predefined or standard
Syntax : rules that specify which
statements (instructions) are legal
Programming Language: a set of rules,
symbols, and special words
Semantic rule : meaning of the
instruction
BOARD
Topic 3: Comments
Comments are for the reader, not the compiler

Two types: Special Symbols Operators


Single line
+ ?
//This is a c++ program. It prints the sentence - ,
// Welcome to C++ Programming * <=
/ !=
Multiple line . ==
/*
; >=
You can include comments that can occupy
several lines.
*/
BOARD
Topic 3: Identifiers (Variable names)
Example of Identifiers in C++
(LEGAL)
• Consist of letters, digits, and the First
convert12
underscore character ( _ ) Pay_Rate
• Must begin with a letter or underscore
(ILLEGAL)
• C++ is a case sensitive employee Salary
- NUMBER is not the same as number Hello!
one+two
• Two predefined identifiers are cout 2nd
and cin
BOARD
Topic 3: Whitespaces

• Every C++ program contains whitespaces


- Include blanks, tabs and newline characters
• Used to separate special symbols,
reserved words and identifiers
• Proper utilization of whitespaces is
important
- Can be used to make the program readable
BOARD
Topic 3: Sample Program
BOARD
Topic 3: Simple Data types

Name Descriptions Examples


int integers(whole numbers) 42, -3, 0, 92657
String sequence of zero more characters “Juan Luna”
float real numbers 3.14, -0.25, 9.4e3
char single text characters a, X, ?, \n
boolean logical values true or false
BOARD
Topic 3: Sample Program
BOARD
Topic 3: Arithmetic Operators
Order of Precedence
C++ Arithmetic Operators: •All operations inside of () are
evaluated first.
(+) Addition
•*, / and % are at the same level of
(-) Subtraction precedence and are evaluated
next.
(*) Multiplication •+ and – have the same level of
(/) Division precedence and are evaluated
last.
(%) Modulus •When operators are on the same
level
- Performed from left to right.
3 * 7 – 6 + 2 * 5 / 4 + 6 means
(((3*7) – 6((2*5) / 4)) + 6
BOARD
Topic 3: Sample Program
BOARD

Try This Activity


Create a program that will display the same output.

Input Name: Juan Dela Cruz


Input Age: 20
Input Course: BSIT

STUDENT INFORMATION:
Juan Dela Cruz
20
BSIT
BOARD

Reference
• www.slideshare.net/vigneras/data-structures-and-algo
rithms
BOARD

Next Session

1. Expressions
2. Declaring & Initializing Variables
3. Allocating Memory w/ Constants
4. Assignment Statement
5. Input and Output Statements

THANK YOU FOR WATCHING

You might also like