Instructions:
- Fork this repository to your GitHub account.
- Clone the forked repository locally to your machine.
- Create a new branch named Feature01.
Objective: Redesign code from a previous exercise into methods that take parameters.
Instructions:
- Create a new Java file named RedesignDate.java
- Write a method called
printAmericanthat takes the day, date, month, and year as parameters and displays them in American format. - Test your method by invoking it from
mainand passing appropriate arguments. The output should look something like this (except the date might be different): "Monday, July 22, 2019". - Once you have debugged
printAmerican, write another method calledprintEuropeanthat displays the date in European format.
Objective: Review the flow of execution through the program Zippo.java, a program with multiple methods.
Questions to Answer In This README.md:
- Write the number 1 next to the first line of code in this program that will execute.
- Write the number 2 next to the second line of code, and so on until the end of the program.
- What is the value of the parameter
blimpwhenbafflegets invoked? - What is the output of this program?
Objective: Answer questions about stack diagrams and program output without running the program in Zoop.java.
Questions:
- Draw a stack diagram that shows the state of the program the first time
pingis 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.
- What is the output by the following program?
- Paste your output in the bash code-block below.
Objective: Explore method invocations and their consequences.
Questions to answer in the README.md via Markdown:
- 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?
- What happens if you use a void method as part of an expression? For example, try
System.out.println("boo!") + 7;.
Objective:
Draw a stack diagram that shows the state of the program the second time zoop is invoked in file Part5.java. Determine the complete output.
Questions:
- Draw a stack diagram that shows the state of the program the second time
zoopis 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.
- What is the complete output?
- Paste your output in the bash code-block below.
Follow these steps for submission:
- Create a Feature01 branch of your code if you haven't already.
- Draw the stack diagram and determine the complete output.
- Commit your answers to your local copy/Feature01 branch.
- Push it to your Remote/origin branch (i.e., GitHub: Feature01 -> origin/Feature01).
- Issue a Pull request to my instructor repo.
- Make sure to COPY the Pull request URL and submit it for the lab/assignment in Canvas.