Fundamentals of Programming C++ Programming Language CS 1400 Dennis A. Fairclough Version 1.1 C++ Programming Language CS 1400 Dennis A. Fairclough Version.

Slides:



Advertisements
Similar presentations
Chapter 3: Beginning Problem Solving Concepts for the Computer Programming Computer Programming Skills /1436 Department of Computer Science.
Advertisements

Introduction to C Programming CE Lecture 1 Introduction to C.
CSE1301 Computer Programming Lecture 4: C Primitives I.
Three types of computer languages
Unix Continuum of Tools Do something once: use the command line Do something many times: –Use an alias –Use a shell script Do something that is complex.
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?
Liang, Introduction to C++ Programming, (c) 2007 Pearson Education, Inc. All rights reserved X 1 Chapter 1 Introduction to Computers, Programs,
 2003 Prentice Hall, Inc. All rights reserved. 1 Machine Languages, Assembly Languages, and High-level Languages Three types of computer languages 1.Machine.
CMSC 104, Version 9/011 Introduction to C Topics Compilation Using the gcc Compiler The Anatomy of a C Program 104 C Programming Standards and Indentation.
Introduction to C. A Brief History Created by Dennis Ritchie at AT&T Labs in 1972 Originally created to design and support the Unix operating system.
Introduction To C++ Programming 1.0 Basic C++ Program Structure 2.0 Program Control 3.0 Array And Structures 4.0 Function 5.0 Pointer 6.0 Secure Programming.
Brief History of C and Unix Systems Programming Concepts.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
COMPUTER PROGRAMMING. Introduction to C++ History Merges notions from Smalltalk and notions from C The class concept was borrowed from Simular67 Developed.
“C” Programming Language CIS 218. Description C is a procedural languages designed to provide lowlevel access to computer system resources, provide language.
C: A VERY BRIEF HISTORY & STANDARDS © 1/4.
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.
“C” Programming Language What is language ? Language is medium of communication. If two persons want to communicate with each other, they have to use.
Introduction to C Programming. A Brief History u Created by Dennis Ritchie at AT&T Labs in 1972 u Originally created to design and support the Unix operating.
Programming Design Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.
 2008 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
Bjarne Stroustrup began work on "C with Classes" in The idea of creating a new language originated from Stroustrup's experience in programming for.
COMPSCI 174- Introduction to C++ Class hour Section 01: MWF 9:55am – 10:45am. Hyer Hall 210.
Introduction By: Dr. Javad Razjouyan. Programming Languages.
Instructor: Tina Tian. About me Office: RLC 203A Office Hours: Wednesday 1:30 - 4:30 PM or .
Introduction of C++ language. C++ Predecessors Early high level languages or programming languages were written to address a particular kind of computing.
Chapter 3: Completing the Problem- Solving Process and Getting Started with C++ Introduction to Programming with C++ Fourth Edition.
C Programming Language Bill Jensen CS 354 May, 3 rd 2007.
Programming With C.
History of C 1950 – FORTRAN (Formula Translator) 1959 – COBOL (Common Business Oriented Language) 1971 – Pascal Between Ada.
 2008 Pearson Education, Inc. All rights reserved. 1 CISC 1600 – Computer Science I Fall 2010 Introduction to C++ Programming Chapters 1 and 2 (Deitel.
Subject: Programming in C++ 1. LEARNING OUTCOME  At the end of this slide, student able to:  Know the brief history of C++.  Explore Microsoft Visual.
CS CS CS IA: Procedural Programming CS IB: Object-Oriented Programming.
Prepared by: Elsy Torres Shajida Berry Siobhan Westby.
CGS 3460 Course Web Site –Get CISE Account –Submit via Web Ct –Late Policy –50% Per Day –Missubmission policy –Academic Honesty –Class Scheduling.
Algorithms  Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
Program & Programming Languages. Introduction to Programming Programming is the process of writing a computer program in a language that the computer.
Monday, Jan 6, 2003Kate Gregory with material from Deitel and Deitel CO 204 Object Oriented Programming 2003 Trent University Kate Gregory.
CS Computer Science I. BCPL was developed in 1967 as a language for writing operating systems and software compilers In 1970, the creators of the.
Programming in C++ Dale/Weems/Headington Chapter 1 Overview of Programming and Problem Solving.
Chapter 1: Introducing C Copyright © 2008 W. W. Norton & Company. All rights reserved. 1 Chapter 1 Introducing C.
A History of the C Languages By: Kevin Burnette. Outline History  Ancestor languages overview Development of C Development of C++
Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Reminders: Course Web Site: Have you filled out the questionnaire.
Introduction to C Programming Language. History of C  C was evolved by Dennis Ritchie at AT&T Bell Laboratories in early of 1970s  Successor of: ALGOL.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
Copyright © 2014 Pearson Addison-Wesley. All rights reserved. Chapter 2 C++ Basics.
小型系統 心情 vs. 古典樂 心情 vs. 古典樂 浪漫求籤系統 美食導航系統 季潔亭雅鈺熒岱芸 美食導航系統 楊氏音樂模擬大會考人瑋 若維 芷萱 伽倩 楊氏音樂模擬大會考 麥當勞熱量計算系統 火星文困擾你嗎 ? 火星文困擾你嗎 ? 歌詞知多少 - 挑戰你的腦容量英琪 日馨 青雪 鈺娟.
Introduction to C Programming I Subject: T0016 – ALGORITHM AND PROGRAMMING Year: 2013.
C++ Programming Chapter 1 Programming & Programs.
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.
C language--Introduction. History 1970: B by Ken Thompson at AT&T Bell Lab 1972: C by Dennis Ritchie and Ken Tompson at At&T Bell Lab for UNIX 1978: “The.
Main Part of a Computer.
PROGRAMMING WITH C ++.
UMBC CMSC 104 – Section 01, Fall 2016
Programming what is C++
1. INTRODUCING C.
Module 1: Introduction to Programming
History of ‘C’ Root of the morden language is ALGOL It’s first
Learning C Language.
CISC/CMPE320 - Prof. McLeod
Overview of C.
CGS 3460 Course Web Site Get CISE Account.
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.
Programming 1 (CS112) Dr. Mohamed Mostafa Zayed 1.
CISC/CMPE320 - Prof. McLeod
Introducing C Chapter 1 Copyright © 2008 W. W. Norton & Company.
C Programming Language
The C Language: Intro.
Chapter 2 part #1 C++ Program Structure
Presentation transcript:

Fundamentals of Programming C++ Programming Language CS 1400 Dennis A. Fairclough Version 1.1 C++ Programming Language CS 1400 Dennis A. Fairclough Version 1.1

History of C++ CPL Published by Juan SoulieLast update on Jul 19, 2008 at 2:26pmJuan Soulie History of C++ CPL Published by Juan SoulieLast update on Jul 19, 2008 at 2:26pmJuan Soulie In 1963 the CPL (Combined Programming language) appeared with the idea of being more specific for concrete programming tasks of that time than ALGOL or FORTRAN. Nevertheless this same specificity made it a big language and, therefore, difficult to learn and implement. 2 Copyright © 2008 by Dennis A. Fairclough all rights reserved.

BCPL In 1967, Martin Richards developed the BCPL (Basic Combined Programming Language), that signified a simplification of CPL but kept most important features the language offered. Although it too was an abstract and somewhat large language. 3 Copyright © 2008 by Dennis A. Fairclough all rights reserved.

B Language In 1970, Ken Thompson, immersed in the development of UNIX at Bell Labs, created the B language. It was a port of BCPL for a specific machine and system (DEC PDP-7 and UNIX), and was adapted to his particular taste and necessities. The final result was an even greater simplification of CPL, although dependent on the system. It had great limitations, like it did not compile to executable code but threaded-code, which generates slower code in execution, and therefore was inadequate for the development of an operating system. Therefore, from 1971, Dennis Ritchie, from the Bell Labs team, began the development of a B compiler which, among other things, was able to generate executable code directly. This "New B", finally called C, introduced in addition, some other new concepts to the language like data types (char). 4 Copyright © 2008 by Dennis A. Fairclough all rights reserved.

C Language In 1973, Dennis Ritchie, had developed the basis of C. The inclusion of types, its handling, as well as the improvement of arrays and pointers, along with the later demonstrated capacity of portability without becoming a high-level language, contributed to the expansion of the C language. It was established with the book "The C Programming Language" by Brian Kernighan and Dennis Ritchie, known as the White Book, and that served as de facto standard until the publication of formal ANSI standard (ANSI X3J11 committee) in Copyright © 2008 by Dennis A. Fairclough all rights reserved.

C++ Language (C with Classes) In 1980, Bjarne Stroustrup, from Bell labs, began the development of the C++ language, that would receive formally this name at the end of 1983, when its first manual was going to be published. In October 1985, the first commercial release of the language appeared as well as the first edition of the book "The C++ Programming Language" by Bjarne Stroustrup. 6 Copyright © 2008 by Dennis A. Fairclough all rights reserved.

C++ Language Enhancements During the 80s, the C++ language was being refined until it became a language with its own personality. All that with very few losses of compatibility with the code with C, and without resigning to its most important characteristics. In fact, the ANSI standard for the C language published in 1989 took good part of the contributions of C++ to structured programming. 7 Copyright © 2008 by Dennis A. Fairclough all rights reserved.

C++0x From 1990 on, ANSI committee X3J16 began the development of a specific standard for C++. In the period elapsed until the publication of the standard in 1998, C++ lived a great expansion in its use and today is the preferred language to develop professional applications on all platforms. C++ has been evolving, and a new version of the standard, c++09 (C++0x), is being developed to be published before the end of 2009, with several new features. From 1990 on, ANSI committee X3J16 began the development of a specific standard for C++. In the period elapsed until the publication of the standard in 1998, C++ lived a great expansion in its use and today is the preferred language to develop professional applications on all platforms. C++ has been evolving, and a new version of the standard, c++09 (C++0x), is being developed to be published before the end of 2009, with several new features. 8 Copyright © 2008 by Dennis A. Fairclough all rights reserved.

C++ Programming Language (C with classes) Hybrid –Procedural (C part) + –Classes (Objects) Hybrid –Procedural (C part) + –Classes (Objects) 9 Copyright © 2008 by Dennis A. Fairclough all rights reserved.

C++ Language C Language CPL BCPL B 10Copyright © 2008 by Dennis A. Fairclough all rights reserved.

Anatomy of C++ Program int main() { return 0; } int main() { return 0; } entry point (start) exit point (end/return) start/end braces 11 Copyright © 2008 by Dennis A. Fairclough all rights reserved.

How does that work? int main() { return 0; } C++ Compiler C++ Linker Windows Operating System source file.cppobject file.obj program execution (DOS Window) executable file.exe 12Copyright © 2008 by Dennis A. Fairclough all rights reserved.

Hello world program #include int main() { std::cout << “Hello world!\n”; system(“pause”); return 0; } #include int main() { std::cout << “Hello world!\n”; system(“pause”); return 0; } 13 Copyright © 2008 by Dennis A. Fairclough all rights reserved.

The Art of Programming “The process of preparing programs for a digital computer is especially attractive because it not only can be economically and scientifically rewarding, it can also be an aesthetic experience much like composing poetry or music.” Donald Knuth, The Art of Computer Programming Volume I: Fundamental Algorithms, Addison-Wesley, Reading MA, 1969 “The process of preparing programs for a digital computer is especially attractive because it not only can be economically and scientifically rewarding, it can also be an aesthetic experience much like composing poetry or music.” Donald Knuth, The Art of Computer Programming Volume I: Fundamental Algorithms, Addison-Wesley, Reading MA, Copyright © 2008 by Dennis A. Fairclough all rights reserved.

Program Anatomy #include //include file for cout, << operator and system() using namespace std; //use standard namespace int main() //main() function header & return datatype { //opening brace cout << "Hello world!\n";//cout statement system("PAUSE");//pause console return 0; //return to OS } //closing brace #include //include file for cout, << operator and system() using namespace std; //use standard namespace int main() //main() function header & return datatype { //opening brace cout << "Hello world!\n";//cout statement system("PAUSE");//pause console return 0; //return to OS } //closing brace Copyright © 2008 by Dennis A. Fairclough all rights reserved. 15

Program Pieces //starts single line comment #include provides C++ code for –cout (object) –<< insertion operator –system(…) function using namespace std; –Opens up the namespace for “standard” //starts single line comment #include provides C++ code for –cout (object) –<< insertion operator –system(…) function using namespace std; –Opens up the namespace for “standard” Copyright © 2008 by Dennis A. Fairclough all rights reserved. 16

Program Pieces int main() – function header –int – return datatype must be an integer –main – function name (identifier) –() – empty parameter list int main() – function header –int – return datatype must be an integer –main – function name (identifier) –() – empty parameter list Copyright © 2008 by Dennis A. Fairclough all rights reserved. 17

Program Pieces { - opening brace to function body } – closing brace to function body cout << “Hello world\n”; –statement that insersts (<<) string into console stream { - opening brace to function body } – closing brace to function body cout << “Hello world\n”; –statement that insersts (<<) string into console stream Copyright © 2008 by Dennis A. Fairclough all rights reserved. 18

system(“PAUSE”); –Call to system() function to pause console return 0; –returns to Operating System with no error system(“PAUSE”); –Call to system() function to pause console return 0; –returns to Operating System with no error Copyright © 2008 by Dennis A. Fairclough all rights reserved. 19

DEMO Program Copyright © 2008 by Dennis A. Fairclough all rights reserved. 20