1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
snow_lady [41]
3 years ago
7

11.19 LAB: Max magnitude Write a function max_magnitude() with two integer input parameters that returns the largest magnitude v

alue. 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 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_val1, user_val2)

Computers and Technology
1 answer:
AlekseyPX3 years ago
3 0

Answer:

# the user is prompt to enter first value

user_val1 = int(input("Enter first value: "))

# the user is prompt to enter second value

user_val2 = int(input("Enter second value: "))

# max_magnitude function is defined

# it takes two parameters

def max_magnitude(user_val1, user_val2):

# if statement to compare the values

# it compare the absolute value of each

if(abs(user_val2) > abs(user_val1)):

return user_val2

elif (abs(user_val1) > abs(user_val2)):

return user_val1

# max_magnitude is called with the

# inputted value as parameter

print(max_magnitude(user_val1, user_val2))

Explanation:

The code is written in Python and well commented. A sample image of program output is attached.

You might be interested in
Each device attached to your computer comes with a special program called a(n ________ that enables the device and operating sys
Serhud [2]
Driver- comes with a driver installed.
7 0
3 years ago
A coworker is concerned about the veracity of a claim because the sender of an email denies sending it. The coworker wants a way
Aleks04 [339]

<u>Some recommend way to prove the authenticity of an email:</u>

  • The coworker as truthful to the company or organization he or she has to check where the same mail is sent long back to the same sender.
  • If search on emails sent item if he sends it will be well and good. Some time backup the mail will be help to proven authenticity of an email.
  • Sometimes once mail is downloaded into ms-outlook or lotus domino some time mail persists in the mail server.
  • He or she can coordinate with the mail server administrator to possible get a log file of sending mail and he can proceed as a record to management.
5 0
3 years ago
Which of these are examples of a bug?
nadya68 [22]
The answer is b and c
7 0
3 years ago
Where is the BIOS chip located?
masya89 [10]

Answer:

on the motherboard inside the computer

6 0
3 years ago
Read 2 more answers
Design and implement a class called Sphere that contains instance data that represent the sphere’s diameter. Define the Sphere c
Zolol [24]

Answer:

Import java.awt.*;

import java.util.*;

public class Sprhere

{// Instance Data private double surfaceA, volume, r, diameter; //Constructors public Sphere ()

{r = 0;diameter = 0; surfaceA = 0;volume = 0;}

public Sphere (double radius, double d, double SA, double v)

{this. r = radius; this. diameter = d; this. surfaceA = SA;this.volume = v;}

//--------------------------------------------------------------------// Accesors.//--------------------------------------------------------------------public double get Radius()

{return r;}

public double get Diameter()

{return diameter;}

public double get SurfaceA()

{return surfaceA;}

public double get Volume()

{return volume;}

//--------------------------------------------------------------------// Mutators.//--------------------------------------------------------------------

3 0
3 years ago
Other questions:
  • How can you best protect yourself when using social media
    5·2 answers
  • Write a program that lets a maker of chips and salsa keep track of their sales for five different types of salsa they produce: mi
    8·1 answer
  • How are computers used in producing weather forecasts?
    8·1 answer
  • Don is visiting digital stores and searching the internet to learn about high-definition DVD players before he buys one. This is
    8·1 answer
  • Cisco Next Generation Intrusion Prevention System (NGIPS) devices include global correlation capabilities that utilize real-worl
    9·1 answer
  • What is the name of the unique identifier assigned to any personal computer that is connected to the internet?
    11·1 answer
  • Who is tim berners-lee
    14·2 answers
  • What are the different Stape of data processing cycle?​
    8·1 answer
  • Assume that students in a course are required to produce a written report on an ICT-related
    14·1 answer
  • Which of the following offers a combination of the features of ram and rom?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!