Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Review the flow of execution through the program [Zippo.java](src/Zippo.java), a
3. What is the value of the parameter `blimp` when `baffle` gets invoked?
4. What is the output of this program?

The value of the parameter blimp when baffle gets invoked is "ping".
The output of this program will be: "ik rattle ping zoop boo-wa-ha-ha"
---

## Part 3: Stack Diagram and Program Output
Expand All @@ -43,7 +45,9 @@ Answer questions about stack diagrams and program output without running the pro
2. What is the output by the following program?
* Paste your output in the bash code-block below.
```bash

No, I wug.
You wugga wug.
I wug.
```

---
Expand All @@ -57,6 +61,10 @@ Explore method invocations and their consequences.
1. What happens if you invoke a value method and don’t do anything with the result; that is, if you don’t assign it to a variable or use it as part of a larger expression?
2. What happens if you use a void method as part of an expression? For example, try `System.out.println("boo!") + 7;`.

1. If you invoke a value method but don't do anything with the result (such as assigning it to a variable or using it as part of a larger expression), the method still executes as usual, but the returned value is essentially discarded. This means any side effects of the method (such as printing to the console or modifying state) will still occur, but you won't be able to access or use the returned value in your program.

2. Using a void method as part of an expression, such as in System.out.println("boo!") + 7;, will result in a compilation error. The reason for this is that the println method has a return type of void, meaning it does not return any value. Therefore, it cannot be used as part of an expression that expects a value to be returned, such as the addition operation (+).

---

## Part 5: Stack Diagram and Program Output
Expand All @@ -71,7 +79,10 @@ Draw a stack diagram that shows the state of the program the second time `zoop`
2. What is the complete output?
* Paste your output in the bash code-block below.
```bash

just for
any not more
It's breakfast
!
```

## Submission
Expand Down
2 changes: 1 addition & 1 deletion src/Part5.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ public static void main(String[] args) {
zoop("just for", bizz);
clink(2 * buzz);
}
}
}