aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsahel <[email protected]>2024-02-01 09:26:05 -0800
committerAsahel <[email protected]>2024-02-01 09:26:05 -0800
commitc4b1a6807641d01a7a3ea3261ff6b178b71a7e77 (patch)
tree20c1dfdbc3586dcd7cde72f44b9381f404cbd0de
parentspacing and files (diff)
downloadin-class-exercise-8-asahellt-main.tar.xz
in-class-exercise-8-asahellt-main.zip
FinishedHEADmain
-rw-r--r--InClassExercise8/NestedLoops.cpp44
-rw-r--r--InClassExercise8/NestedLoops.h10
-rw-r--r--InClassExercise8/program.cpp15
3 files changed, 67 insertions, 2 deletions
diff --git a/InClassExercise8/NestedLoops.cpp b/InClassExercise8/NestedLoops.cpp
index e69de29..24407f8 100644
--- a/InClassExercise8/NestedLoops.cpp
+++ b/InClassExercise8/NestedLoops.cpp
@@ -0,0 +1,44 @@
+// Name: Asahel
+// Date: 1/31/24
+// Class: CST 116
+// Assignment: InClassExercise8
+
+#include <iostream>
+#include "NestedLoops.h"
+
+using std::cout;
+using std::cin;
+using std::endl;
+
+void NestedForLoopExamples();
+void NestedWhileLoopExamples();
+void NestedDoWhileLoopExamples();
+
+int main() {
+
+ NestedForLoopExamples();
+ {
+
+ for (int i = 0, j = 5; i < 5; ++i, --j)
+ cout << i << " " << j << "\n";
+
+ }
+ NestedWhileLoop(5, 10); {
+ int j = 10;
+ int i = 0;
+ while (i < 5 && j > 5) {
+ cout << i << "," << j << " ";
+ i++;
+ j--; }
+
+ NestedDoWhileLoop(5, 10); {
+
+ int j = 10;
+ i = 0;
+ do {
+ cout << i << "," << j << " ";
+ i++;
+ j--;
+ } while (i < 5 && j > 5);
+
+ return 0; } \ No newline at end of file
diff --git a/InClassExercise8/NestedLoops.h b/InClassExercise8/NestedLoops.h
index 8f8ea21..cefe00b 100644
--- a/InClassExercise8/NestedLoops.h
+++ b/InClassExercise8/NestedLoops.h
@@ -1,2 +1,8 @@
-#ifndef MY_NESTEDLOOPS_FILE_H
-#define MY_NESTEDLOOPS_FILE_H
+#ifndef NESTEDLOOPS_H
+#define NESTEDLOOPS_H
+
+void NestedForLoop(size_t n, size_t m);
+void NestedWhileLoop(size_t n, size_t m);
+void NestedDoWhileLoop(size_t n, size_t m);
+
+#endif NESTEDLOOPS_H
diff --git a/InClassExercise8/program.cpp b/InClassExercise8/program.cpp
index 54aaebd..42332bb 100644
--- a/InClassExercise8/program.cpp
+++ b/InClassExercise8/program.cpp
@@ -3,3 +3,18 @@
// Class: CST 116
// Assignment: InClassExercise8
+#include "NestedLoops.h"
+
+void NestedForLoop(size_t n, size_t m) {
+
+
+}
+void NestedWhileLoop(size_t n, size_t m) {
+
+
+}
+void NestedDoWhileLoop(size_t n, size_t m) {
+
+
+}
+