Why is my file not reading into my program?

I created the file where my .cpp file is stored in Visual Basic 2010, and the path it needs. The system has used the file before but it won't use it now to read in the information I need and output it to a different file.


This is the content of the file:
Mark Spitz E RP NO 2 21.5 24.2 18 6 30 26 20.5 7.5
Michael Jordan B RP M4 3 53.7 14.1 9.2 15.0 24.2 5.2 9.3 16.2 109.2 12.1 9.6 23.0
Dorothy Hamill E RP NO 2 55.8 27.1 17.2 18.6 15.0 35.2 21.3 9.2




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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <ostream>

using namespace std;

int main()
{
   ifstream in ("data3.txt");
    string fname, lname, fclass, military, membership;
    unsigned int n;
	int w;
	int l;
	int h;
	int i;
	int weight = w*l*h;


    while(in >> fname >> lname >> fclass >> military >> membership >> n)
   
	{
        double weight, l, w, h;
        for(unsigned int i = 0; i < n; ++i)
        {
            in >> weight >> l >> w >> h;
		}
	}

unsigned int cost=0;

if(i == 0) 


    cost += 25;

else if(i == 1) 

    cost += 35;

else 
	cost += 100;

if(weight > 50.0)
    cost += 100;


if(weight > 70.0)
    cost += 100; 

if(weight > 100.0) 


if(max(max(w, l), h) > 62.0)

    cost += 100;


if(max(max(w, l), h) > 115.0);

  ofstream myfile;
  myfile.open ("summary.txt");
  myfile << fname, lname;            
  myfile.close();


}
Delete line 28

You seem to have mangled my code - you can go and look at my posts again to get an idea of how it originally looked.
Last edited on
I'm starting to think I mangled the entire project :/ but I'm trying
Topic archived. No new replies allowed.