Q2: Write a function (using full PHP syntax) named getMax that accepts two parameters. Call the function and pass two numbers, return the largest number and print out the results.
Added by Julio F.
Close
Step 1
We can do this using the following code: ```php function getMax($num1, $num2) { // code to find the largest number } ``` Show more…
Show all steps
Your feedback will help us improve your experience
Avi Bukys and 66 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Q2. Write a function named print_big_enough that accepts two parameters: a list of numbers and a number. The function should print, in order, all the elements in the list that are at least as large as the second parameter.
Florencia C.
Write a function MaxMagnitude() with two integer input parameters that returns the largest magnitude value. Use the function in a program that takes two integer inputs and outputs the largest magnitude value. Ex: If the inputs are: 5 7, the function returns: 7 Ex: If the inputs are: -8 -2, the function returns: -8 Note: The function does not just return the largest value, which for -8 -2 would be -2. Though not necessary, you may use the absolute-value built-in math function. Your program must define and call a function: int MaxMagnitude(int userVal1, int userVal2)
Samriddhi S.
Output a function max_magnitude() with two integer input parameters that returns the largest magnitude value. Use the function in a program that takes two integer inputs and outputs the largest magnitude value. Ex: If the inputs are: 5 7, the function returns: 7 Ex: If the inputs are: -8 -2, the function returns: -8 Note: The function does not just return the largest value, which for -8 -2 would be -2. Though not necessary, you may use the built-in absolute value function. Your program must define and call the following function: def max_magnitude(user_val1, user_val2)
Liam H.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD