diff options
| author | rPatrickWarner <[email protected]> | 2024-01-31 10:28:20 -0800 |
|---|---|---|
| committer | rPatrickWarner <[email protected]> | 2024-01-31 10:28:20 -0800 |
| commit | 56d8b0d0b8998dcb11e6c5e77b7b106e50170094 (patch) | |
| tree | 0ba9ca123650472a92bf08553dd42d44e752e286 | |
| parent | smallchanges (diff) | |
| download | homework-4-reecepwarner-56d8b0d0b8998dcb11e6c5e77b7b106e50170094.tar.xz homework-4-reecepwarner-56d8b0d0b8998dcb11e6c5e77b7b106e50170094.zip | |
| -rw-r--r-- | Homework4Reece/Homework4Reece/program.cpp | 71 |
1 files changed, 43 insertions, 28 deletions
diff --git a/Homework4Reece/Homework4Reece/program.cpp b/Homework4Reece/Homework4Reece/program.cpp index ebc21f6..b3083cc 100644 --- a/Homework4Reece/Homework4Reece/program.cpp +++ b/Homework4Reece/Homework4Reece/program.cpp @@ -4,8 +4,7 @@ //CST 116 #include <iostream> -//#include <iomanip> - +#include <iomanip> using std::cout; using std::cin; @@ -34,12 +33,18 @@ int main() return 0; } - void print100() { for (int i = 0; i <= 100; i++) { - cout << i << ","; + if (i < 100) { + cout << i << ","; + } + if (i == 100) + { + cout << i << ". \n\n\n"; + } + } cout << "\n\n"; @@ -63,42 +68,52 @@ birthday personbd() void printuserbd(birthday newuse) { - cout << "Your birthdate ->>" + cout << setw(63) << "Your birthdate ->>" << newuse.month << "/" << newuse.day << "/" - << newuse.year << endl; + << newuse.year << "\n\n\n" << endl; + + if (newuse.month == 2 && newuse.day >= 5) + { + cout << setw(75) << "It is almost your birthday!!!\n\n\n" << endl; + } cout << "\n\n"; } - void fib(size_t b) { - size_t first = 0, second = 1, dos = 2, tres = 3, next = 0; + size_t first = 0, second = 1, next = 0; for (int i = 0; i <= b; ++i ) { - - if (i == 0) + if (i < b) { - cout << 0 << ", "; - } - - if (i == 1) - { - cout << 1 << ", "; - } - - next = first + second; + if (i == 0) + { + cout << 0 << ", "; + } + + if (i == 1) + { + cout << 1 << ", "; + } - first = second; + next = first + second; - second = next; + first = second; - cout << next << ", "; + second = next; + + cout << next << ", "; + } + if (i == b) + { + cout << "... off to infinity->>> " << endl; + } } - cout << "\n\n"; + cout << "\n\n\n"; } @@ -108,11 +123,11 @@ void menu() do { - cout << "Welcome to the main menu" - << "\na)Go from 0 to 100" - << "\nb)Input your birthdate" - << "\nc)Check out the Fibonacci Sequence to the nth term" - << "\nd)Exit" << endl; + cout << setw(75) << "<<<Welcome to the Main Menu>>>\n\n\n" << endl; + cout << setw(69) << "a)Go from 0 to 100\n\n\n" + << setw(71) << "b)Input your birthdate\n\n\n" + <<setw(83) << "c)Check out the Fibonacci Sequence to the nth term\n\n\n" + << setw(60) << "d)Exit" << endl; cin >> userinput; switch (userinput) |