aboutsummaryrefslogtreecommitdiffstats
path: root/w4.cpp
diff options
context:
space:
mode:
authorzedarider <ymherklotz@gmail.com>2016-02-18 11:37:45 +0000
committerzedarider <ymherklotz@gmail.com>2016-02-18 11:37:45 +0000
commitaf98ee7ff28cff97f5f29a5d9e65f9153531b0ee (patch)
tree86bfc53a0bc04512ac2936ee067a2b43e901e688 /w4.cpp
downloadimperial_2015-af98ee7ff28cff97f5f29a5d9e65f9153531b0ee.tar.gz
imperial_2015-af98ee7ff28cff97f5f29a5d9e65f9153531b0ee.zip
Imperial C++ Directory
These are all the projects I’ve been working on at university.
Diffstat (limited to 'w4.cpp')
-rw-r--r--w4.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/w4.cpp b/w4.cpp
new file mode 100644
index 0000000..bef51a8
--- /dev/null
+++ b/w4.cpp
@@ -0,0 +1,24 @@
+#include <iostream>
+#include <vector>
+#include <sstream>
+
+using namespace std;
+
+struct point {
+ double x;
+ double y;
+
+ string returnString() {
+ stringstream ss;
+ ss << "(" << x << ", " << y << ")";
+ return ss.str();
+ }
+};
+
+int main() {
+ point userPt;
+
+ cout << "Please enter a point: ";
+ cin >> userPt.x >> userPt.y;
+ cout << "Your point was: " << userPt.returnString() << endl;
+}