aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301/wk5/hw5_directory/strap012_HW5B.cpp
diff options
context:
space:
mode:
authorRossTheRoss <mstrapp@protonmail.com>2020-01-30 16:55:04 -0600
committerRossTheRoss <mstrapp@protonmail.com>2020-01-30 16:55:04 -0600
commit175721a63b426355274fa9e8063f762020ab8362 (patch)
treecf2c1b33233d660c9f50de5e659b9343bb264984 /ee1301/wk5/hw5_directory/strap012_HW5B.cpp
parentMake Python thing in Python (diff)
downloadhomework-175721a63b426355274fa9e8063f762020ab8362.tar
homework-175721a63b426355274fa9e8063f762020ab8362.tar.gz
homework-175721a63b426355274fa9e8063f762020ab8362.tar.bz2
homework-175721a63b426355274fa9e8063f762020ab8362.tar.lz
homework-175721a63b426355274fa9e8063f762020ab8362.tar.xz
homework-175721a63b426355274fa9e8063f762020ab8362.tar.zst
homework-175721a63b426355274fa9e8063f762020ab8362.zip
R E A R R A N G E
Diffstat (limited to 'ee1301/wk5/hw5_directory/strap012_HW5B.cpp')
-rw-r--r--ee1301/wk5/hw5_directory/strap012_HW5B.cpp51
1 files changed, 0 insertions, 51 deletions
diff --git a/ee1301/wk5/hw5_directory/strap012_HW5B.cpp b/ee1301/wk5/hw5_directory/strap012_HW5B.cpp
deleted file mode 100644
index f1e0c2c..0000000
--- a/ee1301/wk5/hw5_directory/strap012_HW5B.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-Date: April 4 2019
-Name: Matthew Strapp
-Student ID number: 5449340
-Course number: EE 1301
-Term: Spring 2019
-Lab/assignment number: HW 5B
-Short Program Description: Random Array
-*/
-
-#include <iostream>
-#include <cstdlib>
-using namespace std;
-
-int main(int argc, char *argv[])
-{
- if (argc != 4) {
- cout << "Invalid input!" << endl << " USAGE: ./rand-array m n max" << endl;
- return 2;
- }
-
- srand(time(NULL));
- int m, n, max;
- m = atoi(argv[1]); //number of rows
- n = atoi(argv[2]); //number of columns
- int randArray[m][n];
- max = atoi(argv[3]); //Maximum number in array
-
- //Loop to make the random array
- for (int curRow = 0; curRow < m; curRow++)
- {
- for (int curCol = 0; curCol < n; curCol++)
- {
- if (rand() % 2 + 1 == 2) { //Decide the sign of the number
- randArray[curCol][curRow] = -1 * (rand() % (max+1));
- } else {
- randArray[curCol][curRow] = (rand() % (max+1));
- }
- }
- }
-
- //Loop to output the array in the console
- for (int curRow = 0; curRow < m; curRow++)
- {
- for (int curCol = 0; curCol < n; curCol++)
- {
- cout << randArray[curCol][curRow] << " ";
- }
- cout << endl;
- }
-} \ No newline at end of file