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
Explain how loops can be utilized in list processing. Please provide Python examples in your response.
Dominik [7]

Answer:

data = [0,1,2,3,4]

for i in range(4):

   print(data[i])

   i+=1

Explanation:

Loops can be utilized in a listing process by looping back to a list with a variable while the loop increases that variable to give a different response from the list.

8 0
2 years ago
What does configsys mean​
Delvig [45]

Answer:

Definition - What does CONFIG. ... SYS is a configuration file on DOS systems. It is a text file that contains the settings and commands to load drives in a DOS system. This is a primary configuration file for OS/2 and DOS OS. This file was introduced in DOS and is replaced for 32-bit Windows versions with CONFIG.

Explanation:

6 0
3 years ago
1| def saveUserProfile(firstName, lastName, age, height, country):
Feliz [49]

Answer:

Joyner

David

USA

1.8

30

Explanation:

def saveUserProfile(firstName, lastName, age, height, country):

This is the definition of function named saveUserProfile which accepts the following parameters:

  • firstName
  • lastName
  • age
  • height
  • country

filename = lastName + firstName + ".txt"

When the file is created it will be named as the lastName and firstName string combined with .txt as extension. For example if the lastName contains the name string Joyner and firstName contains the name David then the file created to be written is named as JoynerDavid.txt

outputFile = open(filename, "w")

This statement uses open() method in write mode and uses outputFile object to access the file. "w" represents write mode i.e. file is opened in write mode to write on it.

a) Joyner is written on line 1 of that file because of the following statement of above function:

print(lastName, file = outputFile)

This statement prints the string stored in lastName i.e. Joyner. Here outputFile opens the file in "w" write mode and writes the last name to the first line of the file.

b) David is written on line 2 of that file because of the following statement of above function:

print(firstName, file = outputFile)

This statement prints the string stored in firstName i.e. David. Here outputFile opens the file in "w" write mode and writes the first name to the second line of the file.

c) USA is written on line 3 of that file because of the following statement of above function:

print(country, file = outputFile)

This statement prints the data stored in country i.e. USA. Here outputFile opens the file in "w" write mode and writes the country name to the third line of the file.  

d) 1.8 is written on line 4 of that file because of the following statement of above function:

print(height, file = outputFile)

This statement prints the value stored in height i.e. 1.8. Here outputFile opens the file in "w" write mode and writes the height value to the fourth line of the file.  

e) 30 is written on line 5 of that file because of the following statement of above function:

print(age, file = outputFile)

This statement prints the value stored in age parameter of function saveUserProfile i.e. 30. Here outputFile opens the file in "w" write mode and writes the age value to the fifth line of the file.  

7 0
3 years ago
On Microsoft teams, how do teachers know that you are on a different page?
emmasim [6.3K]

Answer:

they can view if you left the page on the teacher side of the website

Explanation:

i have made a page just for this

6 0
3 years ago
Read 2 more answers
HTML importance in web desgin<br>​
Inessa [10]

Answer:

HTML is a significant tool for building up a site. It is a programming language used to describe the structure of information on a web page.

Explanation:

6 0
3 years ago
Other questions:
  • When the tcp\ip translates a network layer address into a data link layer address (after not finding an entry for the network la
    13·1 answer
  • Which of the following variable declarations is a correct assignment?
    14·1 answer
  • Who was one of the founders of the location sharing site Foursquare​
    10·1 answer
  • How does net neutrality affect consumers actovate in a a positive way?
    8·1 answer
  • Write a program that responds to a positive integer passed on the command line with the number of bits needed to express that nu
    10·1 answer
  • Some hardware can be added to the computer without having to restart or power down the computer. After a short period of time th
    5·1 answer
  • A ____________ is a collection of commands given a name.
    11·1 answer
  • Does the security burden fall primarily on the user? On
    10·1 answer
  • How to mark a discussion as read on canvas dashboard.
    10·1 answer
  • Question 1
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!