Computer and Information Sciences 192

Project 1

This exercise has two objectives:

1.  You should be able to recognize several common error message sequences and be able to relate the messages to a particular error or error sequence.

2.  You should become familiar with the operation of the editor environment.

If you intend to use Code::Blocks IDE please refer to the note in the Class Resources page. Code::Blocks and Visual C++ are similar but Visual C++ has a couple of significant "excentricities".

The following Power Point files should help in understanding the Visual C++.NET screen and entering a program. The presentations were created for an earlier version of Visual C++ but the information is substantially the same for current versions.

Understanding the Visual C++.NET screen
Entering the First Program
Using the Debugger

Often error messages generated by compilers (both Code::Blocks and Visual C++.NET) are not as expressive as they might be.  One tool for understanding error messages is to create and "Error Dictionary".  The following project will result in the beginning of such a dictionary.  As you work through the course, you should expand your dictionary to include additional error entries as you encounter them.

 

Visual C++

After booting the .NET IDE, modify the outline provided by the Wizard in the editor of your computer to the following:

 

#include "stdafx.h"
#include <iostream>
using namespace std;

int main( )
{

cout << "Hello world \n";
cout << "from -- [Your Name Goes Here]" << endl;
cin.get();
return 0;

} //End of int main( )

 

Code::Blocks

 

// Note: No stdafx.h
#include <iostream>
using namespace std;
int main( )
{

cout << "Hello world \n";
cout << "from -- [Your Name Goes Here]" << endl;
cin.get();
return 0;

} //End of int main( )

 

Now build and run the program.  Print a copy of the program and results by blocking the text of each and pasting into a separate wordprocessing or text document.

Remove a punctuation mark or change the spelling of a word in the program (one at a time).  After each change recompile (and if a "clean" compile run).  Now note the error(s) in the error window.  Block the new code and error message(s) and paste them into your document.  Number the modification sequences and highlight the error.  Do 20 runs creating a variety of errors (one error per execution).

After accumulating the errors and associated messages turn in file as an attachment to an e-mail and send it to the address indicatd on the syllabus).