Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cmath>
- #include <iomanip>
- #include <fstream>
- #include <vector>
- #include <cmath>
- using namespace std; //introduces namespace std
- void getPoints(double);
- int main ( void )
- {
- const int EDGE_POINTS=6;
- int lineNumber=1;
- double sum=0;
- double percent, cumulativePercent;
- double points[EDGE_POINTS][2];
- getPoints(points);
- return 0;
- }
- void getPoints(double points[EDGE_POINTS][2])
- {
- string fileName,company,date;
- ifstream fin("survey.txt");
- ofstream fout("results.txt");
- //print header
- getline(fin, company);
- cout << "Location: " << company << endl;
- getline(fin, date);
- cout << "Date: " << date << endl;
- cout << "The number of points processed was: "<<endl;
- cout << "Total boundry length is " << " feet."<<endl;
- //print collumn header
- //insert column header here
- while (!fin.eof())
- {
- for(int i=0; i<EDGE_POINTS; i++)
- {
- fin >> points[i][0] >> points[i][1];
- }
- for (int i=0; i<EDGE_POINTS; i++)
- {
- int second = (i+1)%EDGE_POINTS;
- int xdiff=points[second][0]-points[i][0];
- int ydiff=points[second][1]-points[i][1];
- double dist=hypot(xdiff,ydiff);
- sum+=dist;
- }
- }
- }
- 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