blob: 5aba7c13572640d02bfc29117e8c5d66196fa338 (
plain) (
blame)
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
|
// BlankConsoleLab.cpp : This file contains the 'main' function. Program execution begins and ends there.
/*
* Benjamin Smith
* CST 116
* Lab 3
*/
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
int counter = 0;
int pickup[50], dropoff[50], passengers[50];
float distance_trav[50], fare[50], toll[50];
string filename = "";
int main()
{
ifstream infile;
infile.open("C:\\Users\\cowpi\\source\\repos\\cst116-lab3-Smith-Benjamin\\large.txt");
if (infile.is_open()) {
while (!infile.eof()) {
infile >> pickup[counter] >> dropoff[counter] >> passengers[counter] >> distance_trav[counter] >> fare[counter] >> toll[counter];
counter++;
}
}
infile.close();
//for (int counter = 0; counter < 50; counter++)
// cout << pickup[counter] << " " << dropoff[counter] << " " << passengers[counter] << " " << distance_trav[counter] << " " << fare[counter] << " " << toll[counter] << endl;
cout << "Please enter the name of the file you wish to export the results into: ";
cin >> filename;
ofstream outfile;
outfile.open(filename);
}
|