UMBC CMSC 202
This code is a modified version of the textbook example 1.1
found on page 5.
//---------------------------------------------------
// File : Hello.cpp
// Author : D. Frey
// Date : 13 June 2003
// UMBC Email: frey@cs.umbc.edu
// Project : none
// Section : 0123
// Description:
// This file is a modified version of the textbook
// example 01-01. It's purpose is to provide a basic
// example of C++ coding.
//---------------------------------------------------
#include
using namespace std;
int main( )
{
// greet the user
cout << "Hello reader.\n"
<< "Welcome to C++.\n";
// prompt user and get response
int numberOfLanguages;
cout << "How many programming languages have you used? ";
cin >> numberOfLanguages;
// determine appropriate response
if (numberOfLanguages < 1 )
cout << "Read the preface. You may prefer" << endl
<< "a more elementary book by the same author" << endl;
else
cout << "Enjoy the book." << endl;
return 0;
}
Last Modified: Monday, 28-Aug-2006 10:15:54 EDT