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
Paha777 [63]
1 year ago
12

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

r 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
1 answer:
RoseWind [281]1 year ago
6 0

Answer:

The solution code is written in Python

  1. def max(a, b):
  2.    if(a > b):
  3.        return a  
  4.    else:
  5.        return b
  6. num1 = int(input("Please input the first number: "))
  7. num2 = int(input("Please input the second number: "))
  8. print(max(num1, num2))

Explanation:

Firstly create a function max that accepts two input, a and b, as required by question (Line 1). In the function, create if statement to check if a greater than b return a and vice versa (Line 2 -5).

In the main program (Line 7 - 10), prompt user to input two numbers (Line 7 - 8). At last call the function by passing num1 and num2 as arguments and print the result (Line 10).

You might be interested in
Remember that ""state space"" refers to the space of all potential possibilities. Which dichotomous questions below will success
egoroff_w [7]

Answer:

Please check options are not given. Please check explanation for corrected version.

Explanation:

Options are not mentioned. Please post the complete question.

However, if "below" is removed, the question makes sense. I am taking it that way.

Dichotomous question means those questions which has two outcomes: true or false.

For the given condition, this is possible only if:

  • coin shows head and dice shows 1
  • coin shows head and dice shows 2
  • head, 3
  • head, 4
  • head, 5
  • head, 6
  • tails, and all above cases

However, each time, each mentioned condition should be strictly followed.

And fewer outcome than 1 is virtually or realistically impossible, as both coin and dice will roll out one outcome in any condition certainly.

7 0
2 years ago
Wesley has to create a web banner to announce a “Back to School” sale by an online retailer. Which information should he determi
olganol [36]
I would say A :)))))))
4 0
2 years ago
Read 2 more answers
Which technology can be used to protect the privacy rights of individuals and simultaneously allow organizations to analyze data
iren [92.7K]

Answer:

De-identification or data anonymization.

Explanation:

Privacy rights are fundamental right of individuals to privatise all personal information, when creating an account.

The de-identification and data anonymization technology is provided by the organisation to user, to prevent their information to be viewed by others. It commonly used in cloud computing, communication, internet, multimedia etc. Reidentification is the reversing of the de-identification effect on personal data.

4 0
2 years ago
When you complete a form online with your name, address, and credit card information in order to make a purchase, you are giving
mafiozo [28]

Answer:

Structured

Explanation:

A data dictionary can be defined as a centralized collection of information on a specific data such as attributes, names, fields and definitions that are being used in a computer database system.

In a data dictionary, data elements are combined into records, which are meaningful combinations of data elements that are included in data flows or retained in data stores.

This ultimately implies that, a data dictionary found in a computer database system typically contains the records about all the data elements (objects) such as data relationships with other elements, ownership, type, size, primary keys etc. These records are stored and communicated to other data user when required or needed.

A relational database can be defined as a type of database that is structured in a manner that there exists a relationship between its elements.

Hence, when a user completes a form online by providing his or her name, address, and credit card information in order to make a purchase, he or she is giving the company structured data (pre-defined and formatted to a set structure) that can be used to make up (populate) a relational database or spreadsheet.

A spreadsheet can be defined as a file or document which comprises of cells in a tabulated format (rows and columns) typically used for formatting, arranging, analyzing, storing, calculating and sorting data on computer systems.

3 0
2 years ago
A Consider the following method definition. The method printAllCharacters is intended to print out every character in str, start
ozzi

Answer:

<em>(c) The method call, which worked correctly before the change, will now cause a run-time error because it attempts to access a character at index 7 in a string whose last element is at index 6.</em>

<em />

Explanation:

Given

printAllCharacters method and printAllCharacters("ABCDEFG");

Required

What happens when  x < str.length() is changed to x <= str.length()

First, we need to understand that str.length()  gets the length of string "ABCDEFG"

There are 7 characters in "ABCDEFG".

So: str.length()  = 7

The first character is at index 0 and the last is at index 6

Next, we need to simplify the loop:

for (int x = 0; x< str.length(); x++) means for (int x = 0; x< 7; x++)

The above loop will iterate from the character at the 0 index to the character at the 6th index

while

for (int x = 0; x<=str.length(); x++) means for (int x = 0; x<=7; x++)

The above loop will iterate from the character at the 0 index to the character at the 7th index

Because there is no character at the 7th index, the loop will return an error

Hence: (c) is correct

7 0
2 years ago
Other questions:
  • Writing a program in a language such as c or java is known as _____ the program.
    10·1 answer
  • What is the formula equivalent to the function =SUM(B1:B5)?
    11·2 answers
  • Which feature of Badoo helped members make their profile more prominent?
    14·1 answer
  • A computer is a multipurpose device that accepts input, processes data, stores data, and produces output, all according to a ser
    9·1 answer
  • Together with some anthropologists, you’re studying a sparsely populated region of a rainforest, where 50 farmers live along a 5
    15·1 answer
  • XYZ Corp.’s facilities in Nashua, New Hampshire, are two office buildings 400 feet apart, each with its own LAN. To connect the
    9·1 answer
  • With respect to the general classes of computers, a ________ is the most expensive and most powerful kind of computer, which is
    7·1 answer
  • Translate the following MIPS code to C. Assume that the variables f, g, h, i, and j are assigned to registers $s0, $s1, $s2, $s3
    8·1 answer
  • If parties in a contract are not ____, the contract can be canceled.
    12·1 answer
  • [20 points] 3.3 Code Practice: Question 2
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!