Homework 1
This commit is contained in:
parent
49bca7f856
commit
12f678a924
43 changed files with 3703 additions and 0 deletions
24
javali_tests/HW1_nop90/noParentheses.javali
Executable file
24
javali_tests/HW1_nop90/noParentheses.javali
Executable file
|
@ -0,0 +1,24 @@
|
|||
/* test what happens if there are no parentheses */
|
||||
|
||||
class Main {
|
||||
void main() {
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
|
||||
x = 5;
|
||||
y = 10;
|
||||
z = 100;
|
||||
|
||||
write( x + y + z); writeln();
|
||||
/* */
|
||||
write( - x + y - z); writeln();
|
||||
|
||||
/* should output 205 */
|
||||
write( x + 2 * z); writeln();
|
||||
|
||||
write( x + 2 * z / x + 1); writeln();
|
||||
write(+x); writeln();
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue