-
Notifications
You must be signed in to change notification settings - Fork 2
/
Project 2 Write Up.txt
115 lines (97 loc) · 1.25 KB
/
Project 2 Write Up.txt
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
Project 2 Write Up
-------------------
Create several test programs that cause as many different types of errors as you can in order to thoroughly test your code. (Think about code coverage). Include several test cases that show it working as well. Write up your testing results (informally) in a document in your Git repo.
Correct Code:
Test 1
-------------------
{
int i
i = 1
if (i == 1){
string i
i = "True"
print (i)
}
print (i)
}$
Test 2
-------------------
{
int i
i = 0
while (i!=10){
i = 1 +i
print(i)
}
}
Test 3
--------------------
{
string a
string b
a = "test"
b = ""
if (b!="test"){
b = "test"
}
if (b=="test"){
print (b)
}
}
Test4
------------------
should only issue warnings
{
string a
a = "test"
{
string a
print(a)
}
}
Wrong Code:
Test 1
---------------------
different type comparison test
{
string a
int b
a = "one"
b = 1
if (b!=a){
b = "test"
}
print (b)
}
Test2
------------------
{
string a
a = "test"
{
string a
print(a)
}
}
Test3
-------------------
{
boolean b
b = true
b = ( a == false)
}
Test4
------------------------------
{
{
string i
boolean b
int c
boolean d
i ="butt"
c = 1+1+1+1+1+1
b = (true == (b == (true ==true) ) )
print (i)
b = ((1+1==1+1)==(1+1==(1==1+1+1)))
d =b
}