aboutsummaryrefslogtreecommitdiff
path: root/CST116F2021-Proj3/Pseudocode.txt
blob: e60b5eb4eabd633baa45c8dbd63457e54ba44c8a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
James Lawrance and Kaeden Grubb Project 3 Pseudocode
----------------------------------------------------
//Preprocessor/Global (Kaeden)
<include #iostream>

using namespace std;



void getMatrices(int matrice1, int matrice2);

void addMatrices(int matrice1, int matrice2);

void multiplyMatrices(int matrice1, int matrice2);

//Menu (Kaeden)

int matrice1[3][3];

int matrice2[3][3];



main()

{

bool exit = false;

int choice;

while (exit = false)

print menu

cin choice

switch(choice)

case 1:

getMatrices();

case 2:

addMatrices();

case 3:

multiplyMatrices();

case 4:

exit = true;

}

//Get New Matrices (James)

Get User Input starting at Matrix1[0][0], ending at Matrix1[2][2], filling whole array
Get User Input starting at Matrix2[0][0], ending at Matrix2[2][2], filling whole array

Return to Menu

//Add Matrices (James)

Initialize Float Array "DisplayMatrix" at [3][3]

For loop with counter that terminates once counter is greater than 2, counter increases by 1 each loop
	For loop with counter2 that terminates once counter2 is greater than 2, counter2 increases by 1 each loop
		DisplayMatrix[counter][counter2] = Matrix1[counter][counter2] + Matrix2[counter][counter2]

Print Upper Corner Left
Print Spacing
Print Upper Corner Right

For loop with counter that terminates once counter is greater than 2, counter increases by 1 each loop
	Print Spacing
	For loop with counter2 that terminates once counter2 is greater than 2, counter2 increases by 1 each loop
		Print DisplayMatrix[counter][counter2]
		Print Spacing
	End line

Print Lower Corner Left
Print Spacing
Print Lower Corner Right

Return to Menu

//Multiply Matrices (Kaeden)

void multiplyMatrices(int matrice1, int matrice2)

{

int product[3][3];

for (int i = 0, i < 3, i++)

{

for (int j = 0, j < 3, j++)

{

product[i][j] = (matrice1[i][1] * matrice2[j][1]) + matrice1[i][2] * matrice2[j][2]) + matrice1[i][3] * matrice2[j][3]);

}

}

print product;

return;

}



James:

void getMatrices(int matrice1, int matrice2)

{

}

void addMatrices(int matrice1, int matrice2)

{

}