answer.
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
mixer [17]
2 years ago
15

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:

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)

code------------------------

#include
using namespace std;

/* Define your function here */

int main() {
/* Type your code here */

return 0;
}

Computers and Technology
1 answer:
JulsSmile [24]2 years ago
5 0

Answer:

def max_magnitude(user_val1, user_val2):

if abs(user_val1) > abs(user_val2):

return user_val1

else:

return user_val2

if __name__ == '__main__':

n1 = int(input("Enter the first integer number: "))

n2 = int(input("Enter the second integer number: "))

print("The largest magnitude value of", n1, "and", n2, "is", max_magnitude(n1, n2))

Explanation:

You might be interested in
Consider the following class:
levacccp [35]

Answer:

Option c is the correct answer for the above question.

Explanation:

  • The super is a keyword in java which is used to call the parent class constructor from the child class constructor, but the only one thing is important to write the super is the constructor that the super keyword needs to be written as a first-line where it is used.
  • The above question has three option which holds the constructor, in which option 1 and 2 holds the super keyword as the last line. So this option is not to hold the correct constructor.
  • But option 3 will hold the Super as the first line, Hence this is the correct use of the constructor.
  • And Only option c states about option 3 while the other is states about the other option. Hence option c is the correct answer.
4 0
2 years ago
Carl knows that water moves through different kinds of soil at different rates. How easily water moves through a soil is known a
Serggg [28]

Answer:

To get the same same results from all pots "amount of water should be same" for all pots.

Explanation:

As Carl want to measure and compare the amount of water that flows in pot in one minute from all all pots. He should keep the amount of water constant for all pots to get the desired results.

6 0
2 years ago
Replace any alphabetic character with '_' in 2-character string passCode. Ex: If passCode is "9a", output is:9_Hint: Use two if
Mashcka [7]

Answer:

Following is given the code as required.

I hope it will help you!

Explanation:

7 0
2 years ago
Pressing and holding _______ while clicking enables you to select multiple contiguous files or folders.
liq [111]

Answer:

Hi LizBiz! The answer is Ctrl key on Windows, or Command key for Mac.

Explanation:

The Ctrl (Windows) key or equivalent Command key on Mac has a special purpose which allows special operations to be performed when combined with another action, such as clicking on multiple pictures or files for selection.

8 0
2 years ago
A chess-playing computer program that routinely calculates all possible outcomes of all possible game moves best illustrates pro
Evgesh-ka [11]
<span>A chess-playing computer program that routinely calculates all possible outcomes of all possible game moves best illustrates problem solving by means of </span>brute force.
5 0
2 years ago
Other questions:
  • An asterisk (*) following a cell reference in a formula is the arithmetic operator that directs excel to perform the division op
    7·1 answer
  • Letitia is in high school. She wants to go to medical school in Kentucky and then become a pediatric surgeon to help children. W
    5·2 answers
  • Prompt: Which references and reference formats are you most likely to use? Why?<br><br><br> ED2020
    13·2 answers
  • Assume the existence of a Window class with a function getWidth that returns the width of the window. Define a derived class Win
    15·1 answer
  • Use the following data definitions data myBytes BYTE 10h,20h,30h,40h myWords WORD 3 DUP(?),2000h myString BYTE "ABCDE" What will
    9·1 answer
  • System design is the determination of the overall system architecture-consisting of a set of physical processing components, ___
    6·2 answers
  • You work for a car rental agency and want to determine what characteristics are shared among your most loyal customers. To do th
    10·1 answer
  • Write a complete Java program that: Prompts an employee to enter the number of hours that they have worked in a given week and s
    14·1 answer
  • For a data structure, such as a stack, who is responsible for throwing an exception if the stack is empty and a pop() is called:
    13·1 answer
  • The microprogram counter (MPC) contains the address of the next microcode statement for the Mic1 emulator to execute. The MPC va
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!