Write a program that will read ina file of points in a format like this: and out
ID: 3614364 • Letter: W
Question
Write a program that will read ina file of points in a format like this:
and output them as ordered pairs, i.e.like this:
#include <iostream>
#include <string>
#include <fstream>
double* file(string,double&,double&, int);
using namespace std;
int main()
{
char junk;
int size1, size2;
size1=size2;
double* x = file("input.txt",size1);
double* y = file("input.txt",size2);
cout<<junk<<x<<junk<<y<<junk;
return 0;
}
double* file (double& x, double& y, int& size)
{
ifstream fin( input.c_str());
fin>> size;
for ( inti = 0 ; i<6; i ++)
{
fin>>x>>y;
}
return double;
}
Explanation / Answer
Please rate - thanks I think it's a lot easier then you thought #include #include #include using namespace std; int main() {int i,n; double x[10],y[10]; ifstream in; in.open("input.txt"); //open file if(in.fail()) //is it ok? { coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.