aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor McDowell <[email protected]>2024-02-09 15:26:30 -0800
committerConnor McDowell <[email protected]>2024-02-09 15:26:30 -0800
commitd92cf0d98bdf7259162234809c422bc2f576a7e7 (patch)
tree5f771ed82378321f0ef5e9fde5bf43e06a127d34
parentfiles set up (diff)
downloadhomework-4-connormcdowell275-d92cf0d98bdf7259162234809c422bc2f576a7e7.tar.xz
homework-4-connormcdowell275-d92cf0d98bdf7259162234809c422bc2f576a7e7.zip
created user dob struct and functions
-rw-r--r--Project1/Functions.cpp7
-rw-r--r--Project1/Project1.vcxproj1
-rw-r--r--Project1/Project1.vcxproj.filters3
-rw-r--r--Project1/header.h4
-rw-r--r--Project1/program.cpp37
5 files changed, 51 insertions, 1 deletions
diff --git a/Project1/Functions.cpp b/Project1/Functions.cpp
new file mode 100644
index 0000000..cb478ba
--- /dev/null
+++ b/Project1/Functions.cpp
@@ -0,0 +1,7 @@
+#include <iostream>
+#include "header.h"
+
+using std::cout;
+using std::cin;
+using std::endl;
+
diff --git a/Project1/Project1.vcxproj b/Project1/Project1.vcxproj
index 185f904..72d1ed7 100644
--- a/Project1/Project1.vcxproj
+++ b/Project1/Project1.vcxproj
@@ -130,6 +130,7 @@
<ClInclude Include="header.h" />
</ItemGroup>
<ItemGroup>
+ <ClCompile Include="Functions.cpp" />
<ClCompile Include="program.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff --git a/Project1/Project1.vcxproj.filters b/Project1/Project1.vcxproj.filters
index f72cfb9..ad7e65a 100644
--- a/Project1/Project1.vcxproj.filters
+++ b/Project1/Project1.vcxproj.filters
@@ -23,5 +23,8 @@
<ClCompile Include="program.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="Functions.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/Project1/header.h b/Project1/header.h
index a661ebb..6b81769 100644
--- a/Project1/header.h
+++ b/Project1/header.h
@@ -1,7 +1,11 @@
#ifndef HEADER
#define HEADER
+int print100();
+void printUser(userDoB newUser);
+
+userDoB inputPersonal();
diff --git a/Project1/program.cpp b/Project1/program.cpp
index 5fff3e6..174cbf2 100644
--- a/Project1/program.cpp
+++ b/Project1/program.cpp
@@ -8,4 +8,39 @@
using std::cout;
using std::cin;
-using std::endl; \ No newline at end of file
+using std::endl;
+
+// user info from lecture
+struct userDoB {
+ int month;
+ int day;
+ int year;
+};
+
+
+void main()
+{
+ userDoB newUser = inputPersonal();
+
+}
+
+void printUser(userDoB newUser)
+{
+ cout << "User's birthday is: " << newUser.month << "/" << newUser.day << "/" << newUser.year << endl;
+}
+
+userDoB inputPersonal()
+{
+ userDoB user = {};
+
+ cout << "\n Please enter just the day you were born as a number: ";
+ cin >> user.day;
+
+ cout << "\n Please enter the month you were born as a number: ";
+ cin >> user.month;
+
+ cout << "\n Now please enter the year you were born as a number: ";
+ cin >> user.month;
+
+ return user;
+}