#include //struct holding the users date of birth struct UserBirthday { int month; int day; int year; }; // function that loops to print numbers 1-100 void Print100() { for (int i = 0; i <= 100; ++i) { std::cout << i << std::endl; } } //function to recieve user birth day/month/year and return a struct UserBirthday InputBday() { UserBirthday bday; std::cout << "enter your birth day: "; std::cin >> bday.day; std::cout << "enter your birth month: "; std::cin >> bday.month; std::cout << "enter your birth year: "; std::cin >> bday.year; return bday; } // basic fibonacci sequence function void fibonacci(size_t n) { int a = 0, b = 1, c; std::cout << "fibonacci sequence elements up to term number: " << n << std::endl; for (size_t i = 0; i < n; ++i) { std::cout << a << " "; c = a + b; a = b; b = c; } std::cout << std::endl; } int main() { //loop to display menu and process user input while keeping them in menu until they choose exit char userChoice; do { //manu options std::cout << "options:" << std::endl; std::cout << "a: print100" << std::endl; std::cout << "b: input personal information" << std::endl; std::cout << "c: print fibonacci" << std::endl; std::cout << "d: exit" << std::endl; std::cout << "choose: a, b, c, or d: "; std::cin >> userChoice; // switch to give the user the right output for their aselection, added case insensitivity switch (userChoice) { case 'A': case 'a': Print100(); break; case 'B': case 'b': { UserBirthday userBday = InputBday(); std::cout << "your birthday is: " << userBday.month << "/" << userBday.day << "/" << userBday.year << std::endl; break; } case 'C': case 'c': { size_t n; std::cout << "enter how many fibonacci terms: "; std::cin >> n; fibonacci(n); break; } case 'D': case 'd': std::cout << std::endl << "exiting, goodbye" << std::endl << std::endl; break; default: std::cout << std::endl << "invalid input" << std::endl << std::endl; break; } } while (userChoice != 'D' && userChoice != 'd'); return 0; }