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.

22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,19 @@ Review the flow of execution through the program [Zippo.java](src/Zippo.java), a

**Questions to Answer In This README.md:**
1. Write the number 1 next to the first line of code in this program that will execute.
* zippo("rattle", 13); //1
* public static void zippo(String quince, int flag) //2
* baffle(quince); //3
2. Write the number 2 next to the second line of code, and so on until the end of the program.
3. What is the value of the parameter `blimp` when `baffle` gets invoked?
* quince: "rattle"
4. What is the output of this program?

ik <br>
rattle <br>
ping zoop <br>
boo-wa-ha-ha <br>


---

Expand All @@ -40,9 +50,13 @@ Answer questions about stack diagrams and program output without running the pro
1. Draw a stack diagram that shows the state of the program the first time `ping` is invoked.
* Hint: If you Google how to use IntelliJ's **BreakPoint** functionality, you can screenshot the **program state** instead of drawing it.
* Regardless of your methodology, a picture of the programs state should be added to this Repo and committed.
![SD](stackDiagram1.png)
2. What is the output by the following program?
* Paste your output in the bash code-block below.
```bash
```bash
No, I wug.
You wugga wug.
I wug.

```

Expand All @@ -55,7 +69,9 @@ Explore method invocations and their consequences.

**Questions to answer in the README.md via Markdown:**
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?
* the method is executed but does nothing
2. What happens if you use a void method as part of an expression? For example, try `System.out.println("boo!") + 7;`.
* you get an error message

---

Expand All @@ -68,10 +84,12 @@ Draw a stack diagram that shows the state of the program the second time `zoop`
1. Draw a stack diagram that shows the state of the program the second time `zoop` is invoked.
* Hint: If you Google how to use IntelliJ's **BreakPoint** functionality, you can screenshot the **program state** instead of drawing it.
* Regardless of your methodology, a picture of the programs state should be added to this Repo and committed.
![SD](stackDiagram2.png)
2. What is the complete output?
* Paste your output in the bash code-block below.
```bash

just for not
It's breakfast
```

## Submission
Expand Down
18 changes: 18 additions & 0 deletions src/RedesignDate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
public class RedesignDate {
public static void printAmerican(String day, String month, int date, int year){

System.out.println(day + month + date + " ," + year);
}
public static void printEuropean(String day, int date, String month, int year){
System.out.println(day +" "+ date +" "+ month + ", " + year);

}
public static void main (String[] args) {
System.out.print("American: ");
printAmerican("Saturday, ", "February ", 10 , 2024);
System.out.print("European: ");
printEuropean("Saturday", 10, "February", 2024);
}


}
6 changes: 3 additions & 3 deletions src/Zippo.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ public static void baffle(String blimp) {
System.out.println(blimp);
zippo("ping", -5);
}
public static void zippo(String quince, int flag) {
public static void zippo(String quince, int flag) {//2
if (flag < 0) {
System.out.println(quince + " zoop");
} else {
System.out.println("ik");
baffle(quince);
baffle(quince);//3
System.out.println("boo-wa-ha-ha");
}
}

public static void main(String[] args) {
zippo("rattle", 13);
zippo("rattle", 13); //1
}
}
2 changes: 1 addition & 1 deletion src/Zoop.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static void baffle() {
ping();
}
public static void ping() {
System.out.println(".");
System.out.println(".");
}
public static void main(String[] args) {
System.out.print("No, I ");
Expand Down
Binary file added stackDiagram1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added stackDiagram2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.