diff options
Diffstat (limited to 'ee1301/wk3')
-rw-r--r-- | ee1301/wk3/hw3_directory/strap012_HW3A.cpp | 5 | ||||
-rw-r--r-- | ee1301/wk3/hw3_directory/strap012_HW3B.cpp | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/ee1301/wk3/hw3_directory/strap012_HW3A.cpp b/ee1301/wk3/hw3_directory/strap012_HW3A.cpp index 933d072..52b3ce4 100644 --- a/ee1301/wk3/hw3_directory/strap012_HW3A.cpp +++ b/ee1301/wk3/hw3_directory/strap012_HW3A.cpp @@ -12,7 +12,6 @@ One-armed Bandit Simulator #include <stdlib.h> #include <cmath> #include <iomanip> -using namespace std; int spin_the_wheels(int d, int w); @@ -28,9 +27,9 @@ int main () { winCount+=winTest; } if (w==6) { - cout << scientific; + std::cout << scientific; } - cout << "w=" << w << ", d=" << d + std::cout << "w=" << w << ", d=" << d << ": Simulated probability = m/n = " << (winCount / 1000000.0) * 100.0 << "%. " << "Theoretical probability = " << (d / (pow(d, w))) * 100 << "%." << endl; d+=2; diff --git a/ee1301/wk3/hw3_directory/strap012_HW3B.cpp b/ee1301/wk3/hw3_directory/strap012_HW3B.cpp index 4a80ae7..3a46a45 100644 --- a/ee1301/wk3/hw3_directory/strap012_HW3B.cpp +++ b/ee1301/wk3/hw3_directory/strap012_HW3B.cpp @@ -12,11 +12,11 @@ Character Detection #include <stdlib.h> #include <cmath> #include <iomanip> -using namespace std; int charTest (char character); int main () { +using namespace std; int test; char character; bool isAlphaNumeric=true; |