aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch10-Debugging-Ahmed/CST116-Ch10-Debugging-Pseudocode-Ahmed.txt
blob: b6c6f4d3655ed3542c9fa1739384c693d409f00a (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
Initialize a void function GetAndDisplayWelcomeInfo() which takes no input
Initialize a void function FunctionOne(int varX[], int varY[]), which takes two int arrays as inputs
Initialize a void function FunctionTwo(int varX[], const int varY[], int varZ[]) which takes three int arrays as inputs
Initialize a void function PrintFunction(int varX[], const int varY[], const int varZ[]) which also takes three int arrays as inputs

Initialize a constant int SIZE to be equal to 10

Start Main 

Initialize three int arrays, varX, varY, and varZ, all with a length of SIZE

Call the function GetAndDisplayWelcomeInfor
	
	(inside function. Not in main)
	
	Initialize a char array with 2 rows and 20 columns

	Ask the user for an input of their first name
		Store it into the first row of name
	Ask the user for an input of their last name
		Store it into the last row of name

	Print out the names by referencing their position in the array and print "Hope all is well"

Call the function FunctionOne, and pass varX and varY into it as the two arrays
	
	(inside function. Not in main)
	
	Create a for loop and loop until the variable x is no longer less than SIZE (from 0 -> 9)
		Assign x to every value of varX until the for loop breaks
	Create another for loop and loop until the veriable x is no longer less than SIZE (from 0 -> 9)
		Assing x + 100 to every value of varY until the for loop breaks

Call the function FunctionTwo and pass varX, varY, and varZ as the three int arrays
	
	(inside function. Not in main)
	
	Set the second value of the array varX to 99
	Create a for loop and loop until the variable x is no longer less than SIZE (from 0 -> 9)
		Assign varX + varY at that index equal to varZ at the current index until the for loop breaks

Assign the first value of the array varZ to -99

Call the function PrintFunction which takes varX, varY, and varZ as inputs for the three int arrays
	
	(inside function. Not in main)

	Create a variable int x
	Print out headers for x, y, and z
	Create a for loop which iterates until int x is no longer less than SIZE (from 0 -> 9)
		Print out each value of the arrays varX, varY, and varZ with a spacing of 3. 

End Main