mis4204#02

Upload: rubayat-rajeev

Post on 06-Apr-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 MIS4204#02

    1/10

    Course Title: Object-Oriented Programming

    Course Code: MIS4204

    C++ PROGRAMMING BASICS

    Presented by

    Bulbul Ah@med

    Senior Lecturer in CSE, NUB

    Lecture # 02Lecture # 02

  • 8/3/2019 MIS4204#02

    2/10

    GettingGetting StartedStarted

    Alphabets Words Sentences Paragraph

    Program/Code

    InstructionsConstants,

    Variables,

    Keywords

    Alphabets,

    Digits,Special-

    Symbols

    English LanguageEnglish Language

    C++ LanguageC++ Language

    January 8, 2012 2Bulbul Ahamed

  • 8/3/2019 MIS4204#02

    3/10

    Hello world program

    When learning a new language, the first program people usually write is

    one that salutes the world :)

    Here is the Hello world program in C++.

    #include

    using namespace std;

    int main()

    {

    cout

  • 8/3/2019 MIS4204#02

    4/10

    // Program: Display greetings

    // Author: Bulbul Programmer

    // Date: 04/05/2011

    #include

    #include using namespace std;

    int main() {

    cout

  • 8/3/2019 MIS4204#02

    5/10

    1. // Program: Display greetings

    2. // Author: Bulbul Programmer

    3. // Date: 04/05/2011

    4. #include

    5. #include

    6. int main()

    7. {8. cout

  • 8/3/2019 MIS4204#02

    6/10

    HELLO WORLD PROGRAM OUTPUT

    January 8, 2012 6Bulbul Ahamed

  • 8/3/2019 MIS4204#02

    7/10

    GENERALFORM OF A C++ PROGRAM

    // Program description

    #include directives

    using namespace std;

    intmain()

    {

    variable declarations;

    executable statements;

    return 0;

    }

    January 8, 2012 7Bulbul Ahamed

  • 8/3/2019 MIS4204#02

    8/10

    1 // First_program.cpp

    2 // A first program in C++.

    3 #include

    4

    5 // function main begins program execution

    6 int main()

    7 {

    8 std::cout

  • 8/3/2019 MIS4204#02

    9/10

    WHAT MAKES A BAD PROGRAM?

    Writing Code without detailed

    analysis and design

    Repeating trial and errorwithout

    understanding the problem

    Writing tricky and dirty programs

    January 8, 2012 9Bulbul Ahamed

  • 8/3/2019 MIS4204#02

    10/10

    AnyAnyQuestionsQuestions??

    January 8, 2012 10Bulbul Ahamed