From d92cf0d98bdf7259162234809c422bc2f576a7e7 Mon Sep 17 00:00:00 2001 From: Connor McDowell Date: Fri, 9 Feb 2024 15:26:30 -0800 Subject: created user dob struct and functions --- Project1/program.cpp | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'Project1/program.cpp') 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; +} -- cgit v1.2.3