aboutsummaryrefslogtreecommitdiffstats
path: root/C++/w4.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'C++/w4.cpp')
-rw-r--r--C++/w4.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/C++/w4.cpp b/C++/w4.cpp
new file mode 100644
index 0000000..bef51a8
--- /dev/null
+++ b/C++/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;
+}