Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- SidescanSonarImages.cpp
- This program was designed to read sidescan sonar data and generate a character-based graphical image of the data.
- Written February 2012 by Candice Yi for the third CS 109 homework assignment.
- */
- #include <iostream> //for input and output functions
- #include <fstream> //to read and write to files
- using namespace std;
- int main ()
- {
- //First, define the variables to be used in the program.
- string thefile;
- string myfile;
- ifstring fin;
- //Next, explain the purpose of this program to the user.
- cout << "Thank you for using the program SidescanSonarImages. \n\n";
- cout << "Written February 2012 by Candice Yi, ACCC account: csyi2. \n\n";
- cout << "This program is designed to read sidescan sonar data \n";
- cout << "from the file that you specify and generate a character- \n";
- cout << "based graphical image of the data, storing the image into\n";
- cout << "an ouput data file that you specify. \n\n";
- //Then, get the input the file from the user.
- cout << "Please enter the name of the file you would like to have read. Example: testfile.txt\n";
- cin >> thefile;
- cout << "Please enter the name of the file you wish to send the data to";
- cin >> myfile;
- fin.open( thefile.c_str( ) );
- //Now, check the data file.
- if( fin.fail( ) )
- {
- cerr << "Error - failed to open " << thefile << endl;
- system("pause");
- }
Add Comment
Please, Sign In to add comment