Question
/* 09: Create an associative array named vh with the following key / value pairs: vocals: Dave guitar: Eddie bass: Michael drums: Alex Output the
/* 09: Create an associative array named vh with the following
key / value pairs:
"vocals": "Dave"
"guitar": "Eddie"
"bass": "Michael"
"drums": "Alex"
Output the following phrase using the vh array associations:
"Van Halen band members include Dave, Eddie, Michael, and Alex."
*/
/*10: Loop through the vh associative array with foreach.
Output "Key: vocals, Value: Dave" and repeat for each key/value pair
*/
/*11: Create a function named simpleMsg that outputs
"Here is a simple message" when it is called.
Remember to call the function, too.
*/
/*12: Create a function named hello that has a
$name parameter and outputs "Hello Dave!" when
it is called, and the value of the argument
passed in is "Dave". It should work with other
values, too.
Remember to call the function with the argument.
*/
$myName = "Walt";
// Don't change the value of $myName above
/* NOTE: It is important to understand the variable name
that holds the argument value does NOT have to be
the same as the $name parameter in the definition
of the function. Functions should be reusable.
You should be able to pass in different argument
variables and your function should still work.
*/
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started