Skip navigation.
Try to figure it out before asking for help

Chapter 11 Hints and Help

QUESTION: I'm having trouble getting the correct result for modify5 but I'm sure my code is right!

ANSWER:A common mistake in modify5 is to use the same variable name for the variable being used to read each line from the file as the name already being used for the array. Since the array is named $income be sure to use a different name for the variable that is reading each line from the file.

QUESTION: Code Exercise 3 asks me to calculate the count of orders for more than one bush but doesn't explain how to display this. The code template already includes print statements that display the sum and the count of ALL orders. Should I add a THIRD print statement to display the count of all orders for more than one bush?

ANSWER:The wording of the exercise is unclear. Yes, you will need to add a third print statement to display the count of all orders for more than one bush.

QUESTION: Code Exercise 4 wants me to print the license in the $parkingPermits array based on the parking space number that the user submits. How do I do that?

ANSWER:The parking space number that the user submits and is stored in a variable is a number from 0 to 19. The array contains license plates that are indexed by the parking space numbers 0 to 19. Remember that a variable can be used to reference an array index.