summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/BlankConsoleLab.cpp
diff options
context:
space:
mode:
author[email protected] <[email protected]>2022-11-30 22:21:20 -0800
committer[email protected] <[email protected]>2022-11-30 22:21:20 -0800
commitdef39ba6c54e5f6200e92d81d2dd2d2e9035274a (patch)
tree516bd7e646b583dc9776743f0d1d72b73afaa36e /BlankConsoleLab/BlankConsoleLab.cpp
parentLotso of work (diff)
downloadcst116-lab3-smith-benjamin-def39ba6c54e5f6200e92d81d2dd2d2e9035274a.tar.xz
cst116-lab3-smith-benjamin-def39ba6c54e5f6200e92d81d2dd2d2e9035274a.zip
Successes are present finally
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
-rw-r--r--BlankConsoleLab/BlankConsoleLab.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp
index 4464803..5aba7c1 100644
--- a/BlankConsoleLab/BlankConsoleLab.cpp
+++ b/BlankConsoleLab/BlankConsoleLab.cpp
@@ -13,22 +13,29 @@ using namespace std;
int counter = 0;
int pickup[50], dropoff[50], passengers[50];
-double distance_trav[50], fare[50], toll[50];
+float distance_trav[50], fare[50], toll[50];
+string filename = "";
int main()
{
- ifstream newfile;
- newfile.open("C:\\Users\\cowpi\\source\\repos\\cst116-lab3-Smith-Benjamin\\large.txt");
+ ifstream infile;
+ infile.open("C:\\Users\\cowpi\\source\\repos\\cst116-lab3-Smith-Benjamin\\large.txt");
- if (newfile.is_open()) {
- while (!newfile.eof()) {
- newfile >> pickup[counter] >> dropoff[counter] >> passengers[counter] >> distance_trav >> fare[counter] >> toll[counter];
+ if (infile.is_open()) {
+ while (!infile.eof()) {
+ infile >> pickup[counter] >> dropoff[counter] >> passengers[counter] >> distance_trav[counter] >> fare[counter] >> toll[counter];
counter++;
}
}
- newfile.close();
+ infile.close();
- for (int counter = 0; counter < 50; counter++)
- cout << pickup[counter] << " " << dropoff[counter] << " " << passengers[counter] << " " << distance_trav[counter] << " " << fare[counter] << " " << toll[counter] << endl;
+ //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);
} \ No newline at end of file