0% found this document useful (0 votes)
37 views38 pages

Intro To C

The document provides an introduction to computer programming concepts in C++, explaining the basics of variables, data types, functions, input/output, and structured and object-oriented programming paradigms. It discusses what programming is, the history of programming, popular programming languages like C++, and common applications of C++ programming such as operating systems, databases, games development, and embedded systems.
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)
37 views38 pages

Intro To C

The document provides an introduction to computer programming concepts in C++, explaining the basics of variables, data types, functions, input/output, and structured and object-oriented programming paradigms. It discusses what programming is, the history of programming, popular programming languages like C++, and common applications of C++ programming such as operating systems, databases, games development, and embedded systems.
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/ 38

INTRODUCTION TO

COMPUTER
PROGRAMMING
MARK VENCE V. DUNGCA
OBJECTIVES
 Understand basic C++ Structure
 Select the appropriate name,
datatype, and initial value for a
memory location
 Declare a memory location in C++
 Distinguish among a variable,
named constant, and literal
constant
 Distinguishes assignment, input,
and output functions.
 Describe the six expression
categories in C.
•PROGRAMMING?
• The word programming
means giving a mechanism
the direction to accomplish
a task. Now this may sound
complicated but if you think
about it, you might have
already programmed
several mechanisms.
• IN THE 1840s, Ada
Lovelace became
the first computer
programmer, inspite
the fact that
Analytical Engine
The first computer
program to Bernoulli
numbers.
• The people who write
these instructions are
called programmers. In
order to write a program
to instruct a computer, you
need to think about each
problem clearly, breaking
them into something
called methods.
• Just as human begins
communicate with each
other through the use of
languages such as
English, Spanish, Hindi
and Chinese,
programmers use a
variety of programming
languages to
communicate with the
computer.
• In able to write computer
instructions,
programmers use a
specific set of language,
called programming
languages to create
computer programs.
Some popular languages
are C++, Visual Basic,
C# and Java.
• Within a computer, all data is
represented by microscopic
switches that can be either off or
on. The off switch is designated
by a 0, and the on switch is
designated by a 1.

• Computers can understand only


these on and off switches,
therefore, the first programmers
had to write a program
instruction using nothing but
combinations of 0s and 1s;
Programming a Computer
Programming paradigms are a way to
classify programming languages based on their features.
Languages can be classified into multiple paradigms.

Two types of Programming paradigm


•1. Structured Programming
•2. Object Oriented Programming
Structured Programming
• A programming paradigm aimed to improving the
clarity, quality, and development time of a computer
program by making extensive use of subroutines, block
structures, and for and while loops – in contrast to using
simple tests and jumps such as the go to statement
which could lead to “spaghetti code” which is difficult to
both follow and to maintain.
• When writing a procedure-oriented program, the
programmer concentrates on the major tasks that
the program needs to perform. In a procedure-
oriented program, the programmer determines and
controls the order in which the computer processes
the instructions. In other words, the programmer
must determine not only the proper instructions to
give the computer, but the correct sequence of
those instructions as well.
•Examples of high-level languages
used to create procedure-oriented
programs include
•COBOL (Common Business Oriented
Language)
• BASIC (Beginner’s All-Purpose
Symbolic Instruction Code)
• and C.
Object-oriented programming (OOP)
• More advance high-level languages can be used to create object-
oriented programs in addition to procedure-oriented ones. Different
from a procedure-oriented program, which focuses on individual
tasks the program must perform.
• object-oriented language requires the programmer to focus on the
objects that the program can use to accomplish its goal. The objects
can take on many different forms. Objects can be viewed as an
independent unit and can be used in more than one program, usually
with little or no modification.
• The ability to use an object for more than one purpose enables code-
reuse, which saves programming time and money – an advantage
that contributes to the popularity of object-oriented programming
• Examples of high-level languages that can
be used to create both procedure-oriented
and object-oriented programs include
• C++
• Visual Basic
• Java
• C#.
Programming Language
What is C++?
• C++ is a cross-platform language that can be
used to create high-performance applications.

• 1979 C++ was developed by Bjarne


Stroustrup , as an extension to the C language
.

• C++ gives programmers a high level of control


over system resources and memory.
Why Use C++?
• C++ is one of the world's most popular programming
languages.

• C++ can be found in today's operating systems,


Graphical User Interfaces, and embedded systems.

• C++ is an object-oriented programming language which


gives a clear structure to programs and allows code to
be reused, lowering development costs.
• C++ is portable and can be used to develop
applications that can be adapted to multiple platforms.

• C++ is fun and easy to learn!

• As C++ is close to C, C# and Java, it makes it easy for


programmers to switch to C++ or vice versa.
Difference between C and C++
• C++ was developed as an extension of C, and both
languages have almost the same syntax.

• The main difference between C and C++ is that C++


support classes and objects, while C does not
To start using C++, you need two things:

• A text editor, like Notepad, to write C++ code

• A compiler, like GNU Compiler Collection (GCC ), to


translate the C++ code into a language that the
computer will understand
Use of C++
•C++ is used by hundreds of thousands of programmers in essentially every application
domain.

•C++ is being highly used to write device drivers and other software that rely on direct
manipulation of hardware under realtime constraints.

•C++ is widely used for teaching and research because it is clean enough for successful
teaching of basic concepts.

•Anyone who has used either an Apple Macintosh or a PC running Windows has indirectly
used C++ because the primary user interfaces of these systems are written in C++.
Applications of C+
+ Programming
• Application Software Development -
C++ programming has been used in developing almost
all the major Operating Systems like Windows, Mac
OSX, and Linux. Apart from the operating systems, the
core part of many browsers like Mozilla Firefox and
Chrome have been written using C++. C++ also has
been used in developing the most popular database
system called MySQL.
•Programming Languages
Development - C++ has been used
extensively in developing new programming
languages like C#, Java, JavaScript, Perl,
UNIX’s C Shell, PHP and Python, and Verilog
etc.
•Computation Programming -
C++ is the best friend of
scientists because of fast speed
and computational efficiencies.
•Games Development - C++ is
extremely fast which allows programmers
to do procedural programming for CPU-
intensive functions and provides greater
control over hardware, because of which
it has been widely used in the
development of gaming engines.
•Embedded System - C++ is
being heavily used in developing
Medical and Engineering Applications
like software for MRI machines, high-
end CAD/CAM systems etc.
C++ Install IDE
• An IDE (Integrated Development Environment) is used
to edit AND compile the code.

• Popular IDE's include Code::Blocks, Eclipse, and Visual


Studio. These are all free, and they can be used to both
edit and debug C++ code.
C++ Syntax
•#include <iostream> is a header file library that lets us work with input and output
objects, such as cout (used in line 5). Header files add functionality to C++ programs.

•using namespace std means that we can use names for objects and variables from
the standard library.
• Another thing that always appear in a C++ program, is int main(). This is called a
function. Any code inside its curly brackets {} will be executed.

•cout (pronounced "see-out") is an object used together with the insertion operator
(<<) to output/print text. In our example, it will output "Hello World".
• Every C++ statement ends with a semicolon ;.

• return 0 ends the main function.

You might also like