Write a JavaFX application that displays a series of pictures of a person with arms, legs, and of course a head. Use a happy face for the head. Use ovals for the body, arms, and legs. Draw a sequence of figures that appear one after the other, as in Listing 4.9. Make the figures assume a running position. Change the color of the person’s face in each succeeding figure, going from white to pink to red to yellow to green. Have the smiling face gradually change its mouth shape from a smile on the first person to a frown on the last person. Use a switch statement to choose the color. Embed the switch statement in a loop.
This program is based on the MultipleFaces.java program in Listing 4.9. Rather than using odd and even counter values to determine color, this program uses a switch to determine the face color and the height adjustment of the mouth. The mouth height adjustment is used to gradually change the mouth from a smile to a frown. Also, a number of constants are added for the position and size of the arms, legs, and body.
See the code in RunningFaces.java
You might also like to view...
Which of the following statements initializes the unsigned int variable counter to 10?
a. unsigned int counter = 10; b. unsigned int counter = {10}; c. unsigned int counter{10}; d. All of the above.
To find a maximum object in an array of strings (e.g., String[] names = {"red", "green", "blue"}), use
a. Arrays.max(names) b. Arrays.sort(names) c. Collections.max(names) d. Collections.max(Arrays.asList(names)) e. None of the above
A ________ occurs when an action is completed on an object, such as clicking the mouse
A) submacro B) database event C) command D) modal message
A cross-reference is a(n) ________ entry associated with a different word or phrase
Fill in the blank(s) with correct word