Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3.18 LAB: Max magnitude Write a function max_magnitude() with two integer input parameters that returns the largest magnitude value. Use the function in a program

image text in transcribedimage text in transcribedimage text in transcribed
3.18 LAB: Max magnitude Write 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: JUT 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 to determine the max magnitude, but you must still output the input number (Ex: Output -8, not 8). Your program must define and call the following function: def max_magnitude (user_vall, user_val2)import math "' Define your function here. if _name_ == "' Type your code here. D l d Run your program as often as you'd like. before submitting for grading. Below, type any needed eve op mo e u ml mo e input values in the rst box, then click Run program and observe the program's output in the second box. Enter program input (optional) If your code requires input values, provide them here. lnput(from above) } (Vomiggyam) } Output (shown below) Program output displayed here Signature of your work What is this? History of your effort will appear here once you begin working on this zyLab. Feedback

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions