Guest User

Untitled

a guest
Jun 24th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. /*
  2. SidescanSonarImages.cpp
  3.  
  4. This program was designed to read sidescan sonar data and generate a character-based graphical image of the data.
  5.  
  6. Written February 2012 by Candice Yi for the third CS 109 homework assignment.
  7.  
  8. */
  9.  
  10. #include <iostream> //for input and output functions
  11. #include <fstream> //to read and write to files
  12.  
  13. using namespace std;
  14.  
  15. int main ()
  16. {
  17. //First, define the variables to be used in the program.
  18.  
  19. string thefile;
  20. string myfile;
  21. ifstring fin;
  22.  
  23. //Next, explain the purpose of this program to the user.
  24.  
  25. cout << "Thank you for using the program SidescanSonarImages. \n\n";
  26. cout << "Written February 2012 by Candice Yi, ACCC account: csyi2. \n\n";
  27. cout << "This program is designed to read sidescan sonar data \n";
  28. cout << "from the file that you specify and generate a character- \n";
  29. cout << "based graphical image of the data, storing the image into\n";
  30. cout << "an ouput data file that you specify. \n\n";
  31.  
  32. //Then, get the input the file from the user.
  33. cout << "Please enter the name of the file you would like to have read. Example: testfile.txt\n";
  34. cin >> thefile;
  35. cout << "Please enter the name of the file you wish to send the data to";
  36. cin >> myfile;
  37.  
  38. fin.open( thefile.c_str( ) );
  39.  
  40. //Now, check the data file.
  41. if( fin.fail( ) )
  42. {
  43. cerr << "Error - failed to open " << thefile << endl;
  44. system("pause");
  45. }
Add Comment
Please, Sign In to add comment