1.1 Overview Programming

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 20

Programming Concepts and Overview

CITE002- Programming 1

By: Eduardo S. Rodrigo


Intended Learning Outcomes (ILO)
INTENDED LEARNING OUTCOMES

At the end of the lesson, the students are expected to :

1) define what program is;


2) differentiate some program terminologies;
3) realize how programming is applied in real-world;
4) create business-transactional C++ program;
Intended Learning Outcomes (ILO)
TOPICS

1) What is a Program ?
2) Some Program Terminologies.
3) Short History of C++.
4) C++ Data types, Variables, Identifiers and Constants
Intended Learning Outcomes (ILO)
What is a Computer Program ?

A Computer Program is a sequence of statements


whose objectives is to accomplish a task.

Programming is a process of planning and creating a


program.

Program vs. Software


Intended Learning Outcomes (ILO)
Programming Terminologies

1) Text Editor

• A text editor is a type of computer program


that edits plain text. Such programs are
sometimes known as "notepad" software,
following the naming of Microsoft Notepad.
Intended Learning Outcomes (ILO)
Programming Terminologies

2) Compiler

• A Compiler is a program translator.

• It is primarily used for programs that


translate source code from a high-level
programming language to a lower level
language to create an executable
program.
The Compiler
Intended Learning Outcomes (ILO)
Programming Terminologies

3) I.D.E
• An Integrated Development Environment
(IDE) is a software application that provides
comprehensive facilities to computer
programmers for software development. An
IDE normally consists of at least a source
code editor, build automation tools and a
debugger or compiler.
Intended Learning Outcomes (ILO)
Short History of C++

• C++ was designed as an improvement of C programming, which was


developed by Dennis Ritchie at Bell Labs.

• C++ was developed by Bjarne Stroustrup.

• In1979, Bjarne Stroustrup was doing work for his Ph.D. thesis.

Dennis Ritchie Bjarne Stroustrup 


Intended Learning Outcomes (ILO)
Short History of C++

• Stroustrup began with the idea that object-oriented programming would be


an important addition to C, and created C with Classes.

• In 1983, the name of the language was changed from C with Classes to C++. 

• In 1985, Stroustrup's reference to the language entitled The C++


Programming Language was published. 

• In 1990, The Annotated C++ Reference Manual was released. The same


year, Borland's Turbo C++ compiler would be released as a commercial
product.
Intended Learning Outcomes (ILO)
Sample C++ Program

#include <iostream> Library/Header Files

using namespace std; Parameter in naming.

main() Main Function

{ Opening/Start

cout << “My Name is Bjarne"; Console Out

} Closing/End
Program Demonstration
Intended Learning Outcomes (ILO)
C++ Data types, Variables, Identifiers and Constants

1) Data Type – type of data.

2) Variable – container.

3) Identifier – unique name or identification.

4) Constant – fixed value.


Example of C++ Data types, Variables, Identifiers and Constants

Cheey Yum : 52.00


Sundae : 35.00
Amount : 87.00
Vat Amount : 9.32

Jenelyn Bolda
2019/02/09
3:21 PM

Image Source : https://travelorientedlife.wordpress.com/2020/05/06/philippines-the-journey-begin-in-philippines-from-jollibee/


Intended Learning Outcomes (ILO)
C++ Primitive Data Types

Type Keyword
Boolean bool
Character char
Integer int
Floating point float
Double floating point double
Valueless void
Wide character wchar_t
The following table shows the variable type, how much memory it takes to
store the value in memory.

Type Typical Bit Width Typical Range

char 1byte -127 to 127 or 0 to 255

unsigned char 1byte 0 to 255


signed char 1byte -127 to 127
int 4bytes -2147483648 to 2147483647
unsigned int 4bytes 0 to 4294967295

signed int 4bytes -2147483648 to 2147483647

short int 2bytes -32768 to 32767

unsigned short int 2bytes 0 to 65,535

signed short int 2bytes -32768 to 32767


The following table shows the variable type, how much memory it takes to
store the value in memory.

Type Typical Bit Width Typical Range

long int 8bytes -2,147,483,648 to


2,147,483,647
signed long int 8bytes same as long int

unsigned long int 8bytes 0 to 4,294,967,295


long long int 8bytes -(2^63) to (2^63)-1
unsigned long long int 8bytes 0 to
18,446,744,073,709,551,615
float 4bytes
double 8bytes
long double 12bytes
wchar_t 2 or 4 bytes 1 wide character
Sample Declaration of Data Type and Variables
Integer : Long :

int age = 13; long b = 4523232;


long int c = 2345342;
Float and Double : long double d = 233434.56343;

float area = 64.74;


double volume = 134.64534;

Char : Invalid Declaration :


short d = 3434233; // Error! out of range
char test = 'h'; unsigned int a = -5; // Error! can only store
positive numbers or 0
Boolean :

bool answer = false;


Intended Learning Outcomes (ILO)
References

1) https://www.w3schools.com/cpp/cpp_operators_comparison.asp

2) 2) https://www.tutorialspoint.com/cplusplus/cpp_operators.htm

3) http://www.cplusplus.com/doc/tutorial/operators/
Proprietary Clause :
Property of Technological Institute of the Philippines (TIP).
No part of the materials, made and uploaded in this learning management system by
TIP may be copied, photographed, printed, reproduced, shared, transmitted, or
reduced to any electronic medium or machine-readable form, in whole or in part,
without prior consent of TIP.

Copyright © 2020 by Technological Institute of the Philippines. All rights reserved.

You might also like