aboutsummaryrefslogtreecommitdiff
path: root/Project1/helper.cpp
diff options
context:
space:
mode:
authorConnor McDowell <[email protected]>2024-02-24 16:31:01 -0800
committerConnor McDowell <[email protected]>2024-02-24 16:31:01 -0800
commit4affe13bb3e69ca19cea9a6790d1c9ffa5842515 (patch)
treef287e87b1543fe4d2092ba90d9508aec27c6e1d2 /Project1/helper.cpp
parentadding fibonacci functions. added cArray, stdArray and myVector (diff)
downloadlab-01-connormcdowell275-main.tar.xz
lab-01-connormcdowell275-main.zip
std::lists are wack.HEADmain
Diffstat (limited to 'Project1/helper.cpp')
-rw-r--r--Project1/helper.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/Project1/helper.cpp b/Project1/helper.cpp
index 48a04cd..c51a05e 100644
--- a/Project1/helper.cpp
+++ b/Project1/helper.cpp
@@ -40,7 +40,7 @@ void Print(const std::list<int>& myList)
{
for (auto& i : myList)
{
- std::cout << i << std::endl;
+ cout << i << endl;
}
}
@@ -94,4 +94,16 @@ void Fibonacci(std::vector<int>& myVector)
{
cout << myVector[i] << " ";
}
+}
+
+void Fibonacci(std::list<int>& myList)
+{
+ int y = 0;
+ cout << "enter the last element of the Fibonacci sequence you would like to see: ";
+ cin >> y;
+ for (auto& i : myList)
+ {
+ i = (i - 1) + (i - 2);
+ cout << i << " ";
+ }
} \ No newline at end of file