aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301/wk4/hw4_directory/strap012_HW4C.cpp
diff options
context:
space:
mode:
authorRossTheRoss <msattr@gmail.com>2019-03-10 16:24:04 -0500
committerRossTheRoss <msattr@gmail.com>2019-03-10 16:24:04 -0500
commite6d9e367d2e87ef00fddae9d3c61041d95488225 (patch)
treec5e51f6f3c57086a0781162aa84295aa3eb66728 /ee1301/wk4/hw4_directory/strap012_HW4C.cpp
parentC O M M E N T S (diff)
downloadhomework-e6d9e367d2e87ef00fddae9d3c61041d95488225.tar
homework-e6d9e367d2e87ef00fddae9d3c61041d95488225.tar.gz
homework-e6d9e367d2e87ef00fddae9d3c61041d95488225.tar.bz2
homework-e6d9e367d2e87ef00fddae9d3c61041d95488225.tar.lz
homework-e6d9e367d2e87ef00fddae9d3c61041d95488225.tar.xz
homework-e6d9e367d2e87ef00fddae9d3c61041d95488225.tar.zst
homework-e6d9e367d2e87ef00fddae9d3c61041d95488225.zip
Change \n to std::endl
Diffstat (limited to 'ee1301/wk4/hw4_directory/strap012_HW4C.cpp')
-rw-r--r--ee1301/wk4/hw4_directory/strap012_HW4C.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/ee1301/wk4/hw4_directory/strap012_HW4C.cpp b/ee1301/wk4/hw4_directory/strap012_HW4C.cpp
index 7c916e3..2041150 100644
--- a/ee1301/wk4/hw4_directory/strap012_HW4C.cpp
+++ b/ee1301/wk4/hw4_directory/strap012_HW4C.cpp
@@ -35,6 +35,7 @@ int main()
U++;
}
} fin.close();
+ //This bit compares to see which vowel wins.
if (A>E && A>I && A>O && A>U)
winner = 'A';
if (E > A && E > I && E > O && E > U)
@@ -46,14 +47,14 @@ int main()
if (U > E && U > I && U > O && U > A)
winner = 'U';
- std::cout << "The results are in!\n"
- << "A/a received " << A << " votes\n"
- << "E/e received " << E << " votes\n"
- << "I/i received " << I << " votes\n"
- << "O/o received " << O << " votes\n"
- << "U/u received " << U << " votes\n"
+ std::cout << "The results are in!" << std::endl
+ << "A/a received " << A << " votes" << std::endl
+ << "E/e received " << E << " votes" << std::endl
+ << "I/i received " << I << " votes" << std::endl
+ << "O/o received " << O << " votes" << std::endl
+ << "U/u received " << U << " votes" << std::endl
<< "The winner is the letter \"" << winner
- << "\"!\n";
+ << "\"!" << std::endl;
fout.open("output_files/election_results.txt");
@@ -61,10 +62,10 @@ int main()
std::cout << "File write failed!\n";
return -2;
}
- fout << "A," << A
- << "\nE," << E
- << "\nI," << I
- << "\nO," << O
- << "\nU," << U;
+ fout << "A," << A << std::endl
+ << "E," << std::endl
+ << "I," << std::endl
+ << "O," << std::endl
+ << "U," << U;
fout.close();
} \ No newline at end of file