diff options
| author | Griffinwizard <[email protected]> | 2021-10-06 19:03:53 -0700 |
|---|---|---|
| committer | Griffinwizard <[email protected]> | 2021-10-06 19:03:53 -0700 |
| commit | 19c973151a46a30d9262710849f59893b0befec3 (patch) | |
| tree | 4f6f1aec8a8e6bb6276922fef3857c567e546530 | |
| parent | Add online IDE url (diff) | |
| download | cst116-lab2-jacobaknox-19c973151a46a30d9262710849f59893b0befec3.tar.xz cst116-lab2-jacobaknox-19c973151a46a30d9262710849f59893b0befec3.zip | |
3a finished
| -rw-r--r-- | 4.1Exercises.txt | 7 | ||||
| -rw-r--r-- | 4.3Exercies.txt | 16 | ||||
| -rw-r--r-- | 6.1Exercies.txt | 8 |
3 files changed, 31 insertions, 0 deletions
diff --git a/4.1Exercises.txt b/4.1Exercises.txt new file mode 100644 index 0000000..38e9589 --- /dev/null +++ b/4.1Exercises.txt @@ -0,0 +1,7 @@ +1. -12.34 numeric +2. 'Hello' illegal +3. "F" String +4. "1234" String +5. '1' Character +6. A illegal +7. "Marcus' illegal
\ No newline at end of file diff --git a/4.3Exercies.txt b/4.3Exercies.txt new file mode 100644 index 0000000..a4f5979 --- /dev/null +++ b/4.3Exercies.txt @@ -0,0 +1,16 @@ +3. +a. int a, int b; + There should not be a second "int" after the comma +b. int a = b; + int b = 0; + A cannot be assigned the value b before be is declared +c. int a = 0, b = 3.5; + b is not an int +d. char grade = "A"; + '"A"' is a string not a char +e. char c = 1; + 1 is a numerical value not a char +f. int a, b, c, d, f; + No error +g. char x = "This is a test."; + '"This is a test."' is a string not a char
\ No newline at end of file diff --git a/6.1Exercies.txt b/6.1Exercies.txt new file mode 100644 index 0000000..2d754cd --- /dev/null +++ b/6.1Exercies.txt @@ -0,0 +1,8 @@ +1. y = 5x + 1; + valid statement +2. x^2 + 2x + 1 = 0; + invalid assignment can only be done on a lone variable to the left of an = +3. x = 5 * a + 4; + valid statement +4. 0 = -15 * b; + invalid variable names cannot be numerical literals
\ No newline at end of file |