Problem with my program

I deleted this post
Last edited on
this is the right code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main () 
{
	cout<<"Enter input file: ";
	string i;
	cin>>i;
	i+=".txt";
	ifstream inf(i.c_str());


cout<<"Enter output file: ";
string o;
cin>>o;
o+=".txt";
ofstream outf(o.c_str());


cout<<"Enter seconds from now: ";
double t;
cin>>t;

double obj,x,y,velocity;
inf>>obj>>x>>y>>velocity;  //this will read from input file

outf<<"The satellite "<<obj<<" will be at position "<<x<<","<<y<<" in "<<t<<" seconds.";  //this will write in the output file


	return 0;
}




Hope I help you.
I'm afraid you probably didn't, holtaf. Giving someone a solution to your problem is a temporary help at best: it can really hurt one's C++ skills in the long run if they don't take the time to carefully examine the solution and ask questions about it.

-Albatross
I deleted this post


This is off-topic, but why do they do that?
Academic Integrity Policy. ;)
Topic archived. No new replies allowed.