aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301
diff options
context:
space:
mode:
authorMatthew Strapp <msattr@gmail.com>2019-02-20 13:30:37 -0600
committerMatthew Strapp <msattr@gmail.com>2019-02-20 13:30:37 -0600
commitcd88aab2bfae428bad41a51fd64d4b97d1c5c982 (patch)
tree29192e4f4c25bc09946c9c6a29e7a8d718676bc9 /ee1301
parentGet rid of bad comment (diff)
parentMORE LABS (diff)
downloadhomework-cd88aab2bfae428bad41a51fd64d4b97d1c5c982.tar
homework-cd88aab2bfae428bad41a51fd64d4b97d1c5c982.tar.gz
homework-cd88aab2bfae428bad41a51fd64d4b97d1c5c982.tar.bz2
homework-cd88aab2bfae428bad41a51fd64d4b97d1c5c982.tar.lz
homework-cd88aab2bfae428bad41a51fd64d4b97d1c5c982.tar.xz
homework-cd88aab2bfae428bad41a51fd64d4b97d1c5c982.tar.zst
homework-cd88aab2bfae428bad41a51fd64d4b97d1c5c982.zip
Merge branch 'master' of github.com:RosstheRoss/TestingFun
Diffstat (limited to 'ee1301')
-rw-r--r--ee1301/wk3/lab3/RtBab.cpp23
-rw-r--r--ee1301/wk3/lab3/fib.cpp17
-rw-r--r--ee1301/wk3/lab3/multTable.cpp18
-rw-r--r--ee1301/wk3/lab3/mysteryBox.cpp2
4 files changed, 59 insertions, 1 deletions
diff --git a/ee1301/wk3/lab3/RtBab.cpp b/ee1301/wk3/lab3/RtBab.cpp
new file mode 100644
index 0000000..d60beda
--- /dev/null
+++ b/ee1301/wk3/lab3/RtBab.cpp
@@ -0,0 +1,23 @@
+#include <iostream>
+#include <cmath>
+using namespace std;
+
+double genNewGuess(double n, double oldGuess); {
+ New=(oldGuess+n/oldGuess)/2;
+ oldGuess=New;
+ return New;
+}
+int main () {
+ double temp;
+ cout << "Enter the Number to find square root: ";
+ cin >> n;
+ if (n==0) {
+ cout << "Nah fam." << endl;
+ return -1
+ }
+ cout << "Guessing..."
+ double real=sqrt(n);
+ do {
+
+ } (while abs(New-real)/real<0.1)
+} \ No newline at end of file
diff --git a/ee1301/wk3/lab3/fib.cpp b/ee1301/wk3/lab3/fib.cpp
new file mode 100644
index 0000000..7508637
--- /dev/null
+++ b/ee1301/wk3/lab3/fib.cpp
@@ -0,0 +1,17 @@
+#include <iostream>
+using namespace std;
+int main()
+{
+ unsigned long long fib1=0, fib2=1, count, temp;
+ cout << "How many Fibonacci numbers should be computed? ";
+ cin >> count;
+ for (int i=1; i<(count+1); i++) {
+ temp=fib1+fib2;
+ fib1=fib2;
+ fib2=temp;
+ cout << temp << " ";
+ if (i%10==0 && i!=0)
+ cout << endl;
+ }
+ cout << endl;
+} \ No newline at end of file
diff --git a/ee1301/wk3/lab3/multTable.cpp b/ee1301/wk3/lab3/multTable.cpp
new file mode 100644
index 0000000..5201c07
--- /dev/null
+++ b/ee1301/wk3/lab3/multTable.cpp
@@ -0,0 +1,18 @@
+#include <iostream>
+using namespace std;
+int main() {
+ int row=1, column=1;
+ for (row; row<=10; row++) {
+ for (column=10; column>0; column--) {
+ int temp = row*column;
+ if (temp!=100) {
+ cout << " ";
+ }
+ if (temp<10) {
+ cout << " ";
+ }
+ cout << temp;
+ }
+ cout << endl;
+ }
+} \ No newline at end of file
diff --git a/ee1301/wk3/lab3/mysteryBox.cpp b/ee1301/wk3/lab3/mysteryBox.cpp
index 040197e..c1a85a4 100644
--- a/ee1301/wk3/lab3/mysteryBox.cpp
+++ b/ee1301/wk3/lab3/mysteryBox.cpp
@@ -1,5 +1,6 @@
#include <iostream>
using namespace std;
+
int main () {
int sum = 0;
for(int i=0; i<=100; i++)
@@ -8,5 +9,4 @@ int main () {
sum++;
}
cout << sum;
-
} \ No newline at end of file