aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRossTheRoss <msattr@gmail.com>2019-02-28 13:28:10 -0600
committerRossTheRoss <msattr@gmail.com>2019-02-28 13:28:10 -0600
commit68d0b1e936e7816e231410c2fb62f436feaa6e44 (patch)
tree25aa4b0545afea14d178d668eb79e27ed81b4b8f
parentInconsistency (diff)
downloadhomework-68d0b1e936e7816e231410c2fb62f436feaa6e44.tar
homework-68d0b1e936e7816e231410c2fb62f436feaa6e44.tar.gz
homework-68d0b1e936e7816e231410c2fb62f436feaa6e44.tar.bz2
homework-68d0b1e936e7816e231410c2fb62f436feaa6e44.tar.lz
homework-68d0b1e936e7816e231410c2fb62f436feaa6e44.tar.xz
homework-68d0b1e936e7816e231410c2fb62f436feaa6e44.tar.zst
homework-68d0b1e936e7816e231410c2fb62f436feaa6e44.zip
Changing namespace
-rw-r--r--ee1301/wk3/hw3_directory/strap012_HW3A.cpp5
-rw-r--r--ee1301/wk3/hw3_directory/strap012_HW3B.cpp2
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;