Question: Write one or two PHP statements that print even if an integer variable $num is even. ( Hint: Use the modulus operator ) . Write

Write one or two PHP statements that print "even" if an integer variable $num is even. (Hint: Use the modulus operator).
Write one or more PHP statements that print "even" if an integer variable $num is even, and "odd" otherwise. These must be new lines of code and not the same lines of code as in item 1.
Write one or more PHP statements that print "A" for a grade of 90-100,"B" for 80-89,"C" for 70-79,"D" for 60-69 and "F" otherwise. If you don't like 101 being an "F", you can modify these for grades greater than 100. Name your variable $grade.
Write a switch statement and other necessary statements that take an integer variable $num and print the corresponding month, e.g. "January" for 1, "February" for 2,...
Test your code with different values for $num and $grade. Use arrays or loops or arrays and loops to test.
Test item 1. with a variable or array using values 3 and 6.
Do not use 3 or 6 in any PHP conditional statement (if, else if, else, ? :).
Test item 2. with a variable or array using values 3 and 6.
Do not use 3 or 6 in any PHP conditional statement (if, else if, else, ? :).
Test item 3. with values 0,59,60,69,70,79,80,89,90,99,100,101
Test item 4. with values 1,2,3,4,5,6,7,8,9,10,11,12,13
Add PHP comments before each of these items to keep them separate. The code for each is its own code. Do NOT write code that tries to do 1 and 2 together.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!