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
statuscvo [17]
2 years ago
6

Design a function named "max" that accepts two integer values as arguments and returns the value that is the greater of the two.

For example, if 7 and 12 are passed as arguments to the function, the function should return 12. Use the function in a program that prompts the user to enter two integer values. The program should display the value that is the greater of the two.

Computers and Technology
2 answers:
lesya692 [45]2 years ago
4 0

Answer:

#section 1

def max(int1, int2):

   if a > b:

       return a

   else:

       return b

#section 2

print("------Enter Two Integers----------\n\n")

a = int(input('Enter First Integer:'))

b = int(input('Enter Second Integer'))

print(max(a, b))

Explanation:

The programming language used is python 3.

#section 1

The function is defined and it has two parameters (int1 and int2) that allows it to take two arguments.

The IF and ELSE statements compares both parameters and return the highest.

#section 2

A program is written to prompt the user for two inputs, and converts them to an integer, passes it to the max function and prints the result to the screen

Artyom0805 [142]2 years ago
3 0

// writing c++ function

int maximum ( int a , int b){

if(a>b)

return a;

else

return b;

}

//when this function will be called it will return the max of the integers sent.

//for example

int max = maximum ( 3,4)

//max variable will have 4 returned by the function

You might be interested in
In the early 1800's, a “computer" was not a machine, it was a person who did math
balu736 [363]

Answer:

True

brainly needs more words apparently

7 0
3 years ago
Read 2 more answers
Any mobile devices contain a(n) ___ and gyroscope that can sense even the smallest movements.
mars1129 [50]

Any mobile device contains a(n) accelerometer and gyroscope that can sense even the smallest movements.

<h3>What are accelerometers? What does an accelerometer sensor do in mobile phones?</h3>

The orientation of a mobile phone is determined by the accelerometer in the device. The gyroscope, or gyro for short, tracks rotation or twist to provide another dimension to the data provided by the accelerometer.

A smartphone's built-in accelerometer measures the device's acceleration. It tracks the different motions like shaking, tilting, swinging, and rotating and accordingly changes the orientation of your app. The accelerometer utilizes the value of XYZ to determine and detect motion.

To know more about accelerometer , Visit:

<u>brainly.com/question/27960990</u>

#SPJ4

7 0
1 year ago
You are about to install a new USB camera on your Linux system and you realize that there is no device special file available fo
Nonamiya [84]

Answer:

mknod

Explanation:

When the user wants to configure a camera device on his Linux computer and the user recognizes that his device does not have a device-specific file. Thus, the user could use the mknod command on his computer to set up an equipment file because it is the command that is used to create a fresh file and these files are not the same as the normal file.

So, the following answer is correct according to the following scenario.

3 0
2 years ago
How will you keep the buzz going post-hackathon?
Anna71 [15]

Answer:

it would be nice if you gave some form of info here

Explanation:

in other words without information no help aka I'm slow and just need points

8 0
1 year ago
The following SQL statement uses a(n) _____. SELECT P_CODE, P_DESCRIPT, P_PRICE, V_NAME FROM PRODUCT, VENDOR WHERE PRODUCT.V_COD
Trava [24]

Answer:

The answer is c. “old-style” join.

Explanation:

SELECT P_CODE, P_DESCRIPT, P_PRICE, V_NAME

FROM PRODUCT, VENDOR

WHERE PRODUCT.V_CODE = VENDOR.V_CODE;

The SELECT clause represents all the columns to be displayed.

The FROM clause represents the tables which are used to extract the columns.

The WHERE clause shows the common column that exists in both the tables. This represents the old-style join when JOIN keyword was not used.

The tables are joined in two ways.

1. Using JOIN keyword

The syntax for this is given as

SELECT column1, column2

FROM table1 JOIN table2

ON table1.column3 = table2.column3;

This returns all rows from two tables having the same value of common column.

Two tables are taken at a time when JOIN keyword is used.

If more tables are to be used, they are mentioned as follows.

SELECT column1, column2

FROM table1 JOIN table2

ON table1.column3 = table2.column3

JOIN table3

ON table3.column4 = table1.column4

( ON table3.column5 = table2.column5 )  

The part in italics shows that the third table can either share the same column with table1 or table2.

The given query can be re-written using JOIN as shown.

SELECT P_CODE, P_DESCRIPT, P_PRICE, V_NAME

FROM PRODUCT JOIN VENDOR

ON PRODUCT.V_CODE = VENDOR.V_CODE;

2. Equating common column in WHERE clause

SELECT column1, column2

FROM table1, table2

WHERE table1.column3 = table2.column3;

This returns all rows from two tables having the same value of the common column.

Here, no keyword is used except the general syntax of the query. ON keyword as shown in the above example is replaced with WHERE.

Tables to be used are mentioned in FROM clause separated by commas.

Tables are joined based on the same column having same values.

Multiple tables can be joined using this style as follows.

SELECT column1, column2

FROM table1, table2, table3, table4

WHERE table1.column3 = table2.column3

AND table3.column5=table1.column5

AND table3.column4 = table2.column4;

5 0
3 years ago
Other questions:
  • A network engineer is configuring a network to be able to relay IPv6 packets. The network only supports IPv4 and does not have d
    11·1 answer
  • The ____ contains the computer's "brain," the central processing unit (CPU).
    5·2 answers
  • Bran is writing a book on operation system errors. Help him complete the sentences.
    7·1 answer
  • Which is the hanging indent on the ruler?
    10·2 answers
  • The small company where you work needs to implement a second server for its accounting system, but does not have the funds to pu
    11·1 answer
  • Who created the first photograph
    9·2 answers
  • 6. You and your friends take an awesome selfie, and you add your name and addresses to the picture. It is a good idea to share t
    11·1 answer
  • How to Calculate the area of a rectangle in python
    13·2 answers
  • write code that removes the first and last elements from a list stored in a variable named my_list. assume that the list has bee
    13·1 answer
  • A message is sent to all hosts on a remote network. Which type of message is it?.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!