Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cmath>
  4. #include <iomanip>
  5. #include <fstream>
  6. #include <vector>
  7. #include <cmath>
  8.  
  9. using namespace std; //introduces namespace std
  10.  
  11. void getPoints(double);
  12.  
  13. int main ( void )
  14. {
  15.     const int EDGE_POINTS=6;
  16.     int lineNumber=1;
  17.     double sum=0;
  18.     double percent, cumulativePercent;
  19.     double points[EDGE_POINTS][2];
  20.     getPoints(points);
  21.     return 0;
  22. }
  23.  
  24. void getPoints(double points[EDGE_POINTS][2])
  25. {
  26.     string fileName,company,date;
  27.     ifstream fin("survey.txt");
  28.     ofstream fout("results.txt");
  29.     //print header
  30.     getline(fin, company);
  31.     cout << "Location: " << company << endl;
  32.     getline(fin, date);
  33.     cout << "Date: " << date << endl;
  34.     cout << "The number of points processed was: "<<endl;
  35.     cout << "Total boundry length is " << " feet."<<endl;
  36.     //print collumn header
  37.     //insert column header here
  38.     while (!fin.eof())
  39.     {
  40.         for(int i=0; i<EDGE_POINTS; i++)
  41.         {
  42.            
  43.             fin >> points[i][0] >> points[i][1];
  44.        
  45.         }
  46.         for (int i=0; i<EDGE_POINTS; i++)
  47.         {
  48.         int second = (i+1)%EDGE_POINTS;
  49.         int xdiff=points[second][0]-points[i][0];
  50.         int ydiff=points[second][1]-points[i][1];
  51.         double dist=hypot(xdiff,ydiff);
  52.         sum+=dist;
  53.         }
  54.  
  55.     }
  56. }
  57.  
  58. 58  18  C:\Users\Aki\Desktop\Dev C++\Project 2\main.cpp [Error] cannot convert 'double (*)[2]' to 'double' for argument '1' to 'void getPoints(double)'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement