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
In defining security implemention, what are the roles of the following committees. 1) gateway committee 2) project committee 3)
ozzi

<u>In network, security plays important roles and implementing is a big task.</u>

1. Gateway committee: It protects the hackers and any malware spyware to attack the network. Once hardware appliance is installed schedule update is happening at regular interval time.

2. Project committee:- it is an implementation plan and with minimum downtime in network and restoring the network and bring back the activities of the network.

3. Security compliance committee: - The network administrator has to select proper hardware appliance and to place in a network with minimum downtime.

6 0
2 years ago
To open the format cells dialog box with the alignment sheet active, tap or click the alignment settings ____.
Otrada [13]
<span>To open the format cells dialog box with the alignment sheet active, tap or click the alignment setting button
</span>
3 0
2 years ago
If the input is negative, make numItemsPointer be null. Otherwise, make numItemsPointer point to numItems and multiply the value
Brilliant_brown [7]

Answer:

The code for the given statements are described below.

Explanation:

// Place code below in line 9

if(numItems < 0)  // starting of a loop

{

numItemsPointer = NULL;

}

else  

{

numItemsPointer = &numItems;

numItems = numItems * 10;   // items multiplied by 10

}   // ending of a loop

6 0
2 years ago
Suppose that a class named ClassA contains a private nonstatic integer named b, a public nonstatic integer named c, and a public
Rus_ich [418]

Answer:

b. obA.c 5;

d. ClassA.b=23;

f. ClassA.d = 99;

Explanation:

Java is a programming language for object oriented programs. It is high level programming language developed by Sun Microsystems. Java is used to create applications that can run on single computer. Static variable act as global variable in Java and can be shared among all objects. The non static variable is specific to instance object in which it is created.

6 0
2 years ago
A user complains that his computer automatically reboots after a short period of time. Which of the following computer component
satela [25.4K]

Answer:

C

Explanation:

A faulty motherboard causes a computer to reboot after a short period of time.

The motherboard is a printed circuit board, It transmits power and allows for effective communication to and between the RAM, CPU and all other computer external components. Motherboard is essential for the coordination of all the activities in the computer.

A faulty motherboard could be as a result of a leaking capacitor in it, which is caused by a bad power source.

If that occurs there is need for replacement of the Motherboard to ensure the smooth running of the computer.

8 0
2 years ago
Read 2 more answers
Other questions:
  • Two technicians are discussing lung protection in the shop. Technician A says that respiratory-protection devices can prevent yo
    5·2 answers
  • The final step of the DHCP Discovery process is known as ______.
    5·1 answer
  • Edward has started up a new company with his friend, Matthew. Currently, he has only two people working with him. Which type of
    8·1 answer
  • python Consider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". Any value that is the same as the immediately preceding value i
    7·1 answer
  • Sensors and devices connected to a model are examples of which of the following?
    6·2 answers
  • Complete this truth Table. Write a program that you can enter from the keyboard, a 1 or 0 into three Boolean variables, A,B,C. W
    14·1 answer
  • During the name resolution process, which technique is used to avoid congestion when querying a server
    8·1 answer
  • Exercise 4: Bring in program grades.cpp and grades.txt from the Lab 10 folder. Fill in the code in bold so that the data is prop
    12·1 answer
  • Through which of the devices listed are we able to connect to wireless networks? Check all that apply.
    14·1 answer
  • In this problem, you will derive the efficiency of a CSMA/CD-like multiple access protocol. In this protocol, time is slotted an
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!