1: //TestStuff20140908.cpp
2: //Monday, September 8, 2014
3:
4: #include <iostream>
5: using namespace std;
6:
7: int main(int argc, char* argv[])
8: {
9: //A simple C++ output statement displaying a greeting on the screen.
10: //cout is an object from <iostream> that is automatically connected
11: //to the "standard output" stream, ie, the user's screen.
12: //endl is a "manipulator" that terminates the output line.
13: //cout << "Hello, world!" << endl;
14:
15: //The above line of code is essentially the same as
16: //cout << "Hello, world!\n";
17:
18: //Note the automatic concatenation of string literals in C++.
19: //Do not use a + to connect them as you would in Java.
20: if (argc == 1) //Remember: there is always at least one
21: { //command-line parameter
22: cout << "\nLastname:Firstname:A00123456:csc34101"
23: "\nSubmission 01: Finding Augusts with Five Weekends";
24:
25: cout << "\n\nThis program analyzes an input file of calendar data "
26: "to determine which\nyears in a range of years between 2000 and "
27: "3000 (inclusive)contain a month\nof August which has five "
28: "complete weekends (Friday, Saturday, and Sunday).\n";
29: //The above two cout statements could easily be combined into one
30:
31: //The following two statements form a "C++ idiom" that causes
32: //your program to pause (at least it does in this case, but it
33: //is important to note that this will not work unless the input
34: //stream is empty.
35: cout << "Press Enter to continue ... "; cin.ignore(80, '\n');
36: return EXIT_SUCCESS; //A built in constant
37: //return 0; //Essentially the same as the above line
38: }
39:
40: cout << "\nJust carrying on ..." << endl;
41: //This statement will be executed if there are any command-line parameters
42: }