Lab2_Fullname.docx - (INTRODUCTION TO PROGRAMMING EXERCISE 2 INTRODUCTION TO C I OBJECTIVES At the end of this exercise students must be able to • •

Lab2_Fullname.docx - (INTRODUCTION TO PROGRAMMING EXERCISE...

This preview shows page 1 - 4 out of 9 pages.

(INTRODUCTION TO PROGRAMMING) EXERCISE 2 INTRODUCTION TO C++
Image of page 1

Subscribe to view the full document.

I. OBJECTIVES At the end of this exercise, students must be able to: Know the structure of C++ program Define programming terminologies Familiar with the use of Microsoft Visual Studio 2010 to develop C++ programs Know the console output and escape sequences Use the console input Enumerate and define the data types used in developing C++ programs Enumerate Operators & Expression and know they are used Know the order of precedence and associatively. Declare a variable II. BACKGROUND INFORMATION Structure of a C++ program // my first program in C++ #include <iostream> using namespace std; int main () { cout << "Hello World!"; return 0; } // my first program in C++ This is a comment line . All lines beginning with two slash signs (//) are considered comments and do not have any effect on the behavior of the program. #include <iostream> Lines beginning with a hash sign (#) are directives for the preprocessor . This specific file (iostream) includes the declarations of the basic standard input-output library in C++. cout << "Hello World!"; This line is a C++ statement. A statement is a simple or compound expression that can actually produce some effect. Each statement must be terminated by a semicolon (;) return 0; The return statement causes the main function to finish, return may be followed by a return code 0;
Image of page 2
III. LABORATORY ACTIVITY ACTIVITY 2.1: Console Output and Escape Sequences 1. Write a program that will display your weekly class schedule in a listed view. Save the program as Lab1-1.
Image of page 3

Subscribe to view the full document.

Image of page 4
  • Summer '18
  • jane smeth

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes