Problem 97
Picture Menu
In this program, you’ll see how to call functions. Functions are chunks of code with a name, and “calling” a function means to call on the function to do a task for you.
Files Needed: PictureMenu.java
What You Should See 1. Butterfly 2. Elephant 3. Teddy Bear 4. Snake Which animal to draw? 1
What You Should Do on Your Own
Assignments turned in without these things will receive no credit.
- Add the two missing function calls for menu options 3 and 4.
- Change the code in the if statement for choice 1 so that it calls the ‘butterfly’ function twice instead of just once. What happens now when you run the program and choose option 1? (Answer in a comment right underneath where you added the extra function call.)
◄ 77: Graphics Demo 1 98: Flicker Phrase ►
Adapted from ProgrammingByDoing.com
©2013 Graham Mitchell
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.