Introduction of C++ language. C++ Predecessors Early high level languages or programming languages were written to address a particular kind of computing.

Slides:



Advertisements
Similar presentations
C Language.
Advertisements

EC-111 Algorithms & Computing Lecture #1 Instructor: Jahan Zeb Department of Computer Engineering (DCE) College of E&ME NUST.
Introduction to Programming in C++ John Galletly.
CSE1301 Computer Programming Lecture 4: C Primitives I.
Three types of computer languages
1 Key Concepts:  Why C?  Life Cycle Of a C program,  What is a computer program?  A program statement?  Basic parts of a C program,  Printf() function?
 2003 Prentice Hall, Inc. All rights reserved. 1 Machine Languages, Assembly Languages, and High-level Languages Three types of computer languages 1.Machine.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
 2007 Pearson Education, Inc. All rights reserved C++ as a Better C; Introducing Object Technology.
C++ fundamentals.
Chapter 1 Introduction to Programming. Computer Hardware CPU Memory –Main or primary –Secondary or auxiliary Input device(s) Output device(s)
CHAPTER 1: INTORDUCTION TO C LANGUAGE
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
CS102 Introduction to Computer Programming
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
COMPUTER SCIENCE I C++ INTRODUCTION
Introducing Java.
Introduction to C++ - How C++ Evolved Most popular languages currently: COBOL, Fortran, C, C++, Java (script) C was developed in 1970s at AT&T (Richie)
Welcome In The World Of ‘C’.  TEXT BOOK: Programming in ANCI ‘C By: E Balagurusamy. TMH  Reference Books: 1) The ‘C Programming Language By: Kernighan.
 2008 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
Munster Programming Training
Chapter 1: A First Program Using C#. Programming Computer program – A set of instructions that tells a computer what to do – Also called software Software.
Chapter 3: Completing the Problem- Solving Process and Getting Started with C++ Introduction to Programming with C++ Fourth Edition.
Programing Concept Ken Youssefi/Ping HsuIntroduction to Engineering – E10 1 ENGR 10 Introduction to Engineering (Part A)
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer.
History of C 1950 – FORTRAN (Formula Translator) 1959 – COBOL (Common Business Oriented Language) 1971 – Pascal Between Ada.
/* Documentations */ Pre process / Linking statements Global declarations; main( ) { Local Declarations; Program statements / Executable statements; }
Sharda University P. K. Mishra (Asst.Prof) Department of Computer Science & Technology Subject Name: Programming Using C Sub Code: CSE-106 Programming.
Course Title: Introduction to C++ Course Instructor: ADEEL ANJUM Chapter No: 01 1 BY ADEEL ANJUM (MCS, CCNA,WEB DEVELOPER)
Chapter 0 Overview. Why you are here? Where will you go? What is this course for?
CPS120: Introduction to Computer Science Functions.
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
CPS120: Introduction to Computer Science Lecture 14 Functions.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Introduction to c++ programming - object oriented programming concepts - Structured Vs OOP. Classes and objects - class definition - Objects - class scope.
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 05, 2005 Lecture Number: 4.
Introducing C++ Programming Lecture 3 Dr. Hebbat Allah A. Elwishy Computer & IS Assistant Professor
DOCUMENTATION SECTION GLOBAL DECLARATION SECTION
IBM-Mainframes COBOL Class-1. Background and History  COBOL is an acronym for: Common Business Oriented Language  COBOL was developed in 1959 by the.
Agenda Computer Languages How to Write a Simple C Program
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Learners Support Publications Introduction to C++
Course Title Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
Principles of Programming CSEB134 : BS/ CHAPTER Fundamentals of the C Programming Language.
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
C++ Programming Chapter 1 Programming & Programs.
Computer Programming - Key Concepts and Terms Computer Program – A computer program is a set of instructions for computer, arranged in logical order, using.
From Algorithms to Programs Both are sets of instructions on how to do a task Algorithm: –talking to humans, easy to understand –in plain (English) language.
PROGRAMMING WITH C ++.
Basic concepts of C++ Presented by Prof. Satyajit De
Programming what is C++
C Programming Hardik H. Maheta.
Introduction to C++ Introduced by Bjarne Stroustrup of AT&T’s Bell Laboratories in mid-1980’s Based on C C++ extended C to support object-oriented programming.
History of ‘C’ Root of the morden language is ALGOL It’s first
Objectives Identify the built-in data types in C++
Beginning C++ Programming
Introduction to C Programming Language
Welcome In The World Of ‘C’.  TEXT BOOK: Programming in ANSI ‘C By: E Balagurusamy. TMH  Reference Books: 1) The ‘C Programming Language By: Kernighan.
جامعة البحر الاحمر كلية العلوم التطبيقية قسم الفيزياء التطبيقية الفصل الداسي الثاني IIالمقرر: حاسوب د. خالد عثمان العالم.
جامعة البحر الاحمر كلية العلوم التطبيقية قسمي الحاسوب وتقنية المعلومات الفصل الداسي الثاني المقرر: اساليب برمجة 1 محاضرة رقم 1 د. خالد عثمان العالم.
Introduction to C++ Introduced by Bjarne Stroustrup of AT&T’s Bell Laboratories in mid-1980’s Based on C C++ extended C to support object-oriented programming.
Introduction to Computer Programming
Programs written in C and C++ can run on many different computers
Review of C++ Language Basics
C Programming Language
CPP Programming Language
Presentation transcript:

Introduction of C++ language

C++ Predecessors Early high level languages or programming languages were written to address a particular kind of computing problem. Like:  FORTRAN: Formula Translation  COBOL: Common Business Oriented Language Other programming languages can be used to solve diverse types of computing programs:  BASIC: Beginners All-purpose Symbolic Instruction Code  C

Background C++ is based on C; in fact, C++ is a superset of C.  Developed by Bjarne Stroustrup at AT&T Bell Laboratories Standard C++  Was formally adopted by American National Standards Institute and ISO to provide a common base in our course is based on C++ as represented by “The C++ Programming Language”, Third Edition by B. Stroustrup

C and C++ C is a procedure oriented language designed to be,  As powerful  As fast  “Close to the machine”  portable C++ is object oriented language. C++ is the “next generation”. C++ is an extension version of C language.  New features for writing programs C and C++ compilers are very advanced pieces of software

What is C++ C++ can be “Object Oriented”  Describe objects (things)  What to do with them It is very fast and very powerful C++ is EASIER than C C++ is able to map the real world problem.

Applications of C++ C++ allows expression of abstract ideas. C++ has national standards. C++ is reusable and object oriented. C++ is widely used and taught.

7 The “Hello, World!” program C notation #include //include header file void main( ) { printf(“Hello, World!”); }

8 The “Hello, World!” program C++ notation #include //include header file void main( ) { cout << “Hello, World!”; }

Basic structure of C++ program The general structure of C++ program is subdivided into different sections: Documentation section Include files Global Declaration section Main C++ program function Beginning of the program using { End of the program using } Sub-program section having user defined functions

Documentation section C++ support two ways to insert comments:  Line Comment- indicates by symbol //  Block comments- start with /* and end with */ - apply to as many lines as you like Used to describe the code in English or provide non-code information E.g. to include the name of the program or the author’s name

Include files Pre-compiler statements are divided into two sections. One is link section and other is definition section. In link section we link the compiler in-built function like cin>>, cout<<, clrscr() etc with INCLUDE subdirectory header files like iostream.h, conio.h etc. Like: #include has operators for performing input and output within the program.

Include files Ends with a semicolon Follows #include directives in the code Must appear in all programs

Global declaration section Data type v1,v2,v3…….vn; Data types are int, float, char etc. and v1,v2….vn are variables. For example, global variables are declared as: int a,b,c; float x,y;

Main C++ program function called main Exactly one main function per program A function is a collection of related statements that perform a specific operation int indicates the return type of the function ( ) indicates no special information passed to the function by the operating system. Like: Main() or void main()

Beginning of the program {- the beginning of the main program can be done by using curly bracket “{“.  Local variable declaration - int a,b,c;  Executable statements - specify the actions the program will take: cout << “Enter the values of a and b:”; cin >> a>>b;

End of the program Ending of the main program:  } – by using this bracket “}” we can end the main program in C++ language.

Sub-program section having user defined functions Function 1() { user defined program or body of the function sub program } Function 2() { Another user defined sub program }

Compiling and linking Compiler refers to the processing of source code files(.c,.cpp) and creation of an ‘object’ file. The compiler is a program that takes the code that you write and translates it into machine language Machine code is made up of many simple instructions composed of 0 ’s and 1 ’s Linking refers to the creation of a single executable file from multiple object files. Now type the program from first row and the first column. This is called editing.

Compiling and linking If you want to save the program, then either press F2 function key from the keyboard or select the save option from the file menu. If you want to compile a C++ program then either select from the Compile menu or press Ctrl+F9.

IDE Integrated Development Environment. All in one system for developing programs. Can edit, compile, link and execute our programs all from the comfort of our IDE.