aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Homework 4/program.cpp82
1 files changed, 67 insertions, 15 deletions
diff --git a/Homework 4/program.cpp b/Homework 4/program.cpp
index c851742..87d59e4 100644
--- a/Homework 4/program.cpp
+++ b/Homework 4/program.cpp
@@ -15,28 +15,80 @@ void Print() {
cout << i << " ";
}
}
- int main() {
- cout << "A. Print(100)" << endl;
- cout << "B. Input Personal Information" << endl;
- cout << "C. Print Fibonacci" << endl;
- cout << "D. Exit" << endl;
+void InputPersonalInfo() {
+ int i = 0;
+ do {
+ cout << i << "\n";
+ i++;
+ } while (i < 5);
+}
+
+int fib(int n) {
+
+ if (n <= 1)
+ return n;
+return fib(n - 1) + fib(n - 2);
+}
- char input = 'A';
+int main() {
+
+ cout << "A. Print(100)" << endl;
+ cout << "B. Input Personal Information" << endl;
+ cout << "C. Print Fibonacci" << endl;
+ cout << "D. Exit" << endl;
+
+ char input = 'A';
+
+ switch (input) {
+ case 'A':
+ Print();
+ break;
+ }
+
+ InputPersonalInfo(); {
- switch (input) {
- case 'A':
- Print();
- break;
- }
-
int month;
int day;
int year;
- cout << "Enter your date of birth";
- cin >> month >> day >> year;
+ cout << "Enter the month you were born in" << endl;
+ cin >> month;
+
+
+ cout << "Enter the day you were born in" << endl;
+ cin >> day;
+
+
+ cout << "Enter the year you were born in" << endl;
+ cin >> year;
+
+
+ cout << "You were born in: " << month << " " << day << " " << year << endl;
return 0;
- } \ No newline at end of file
+ }
+
+
+ int fib(int n);{
+
+ int n = 9;
+ cout << n << fib(n);
+
+
+ return 0;
+ }
+
+
+
+
+ return 0;
+}
+
+
+
+
+
+
+