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
amm1812
1 year ago
5

Given x and y, each associated with an int, write a fragment of code that associates the larger of these with another variable n

amed max.
Computers and Technology
1 answer:
solmaris [256]1 year ago
8 0

Answer:

The program to this question as follows:

Program:

x=int(input('Input the first number: ')) #defining variable x and input value by user

y=int(input('Input the second number: ')) #defining variable y and input value by user

if x > y: #if block to check value x>y

   max=x #define variable max that hold variable x value

   print('max number is: ', x) #print value

else: #else block

   max=y  #define variable max that holds variable y value

   print('max number is: ', y) #print value

Output:

Input the first number: 22

Input the second number: 33

max number is:  33

Explanation:

In the above code two-variable, "x and y" is defined, which holds a value, which is input by the variable. In the next step, the if block statement is used that can be described as follows:

  • In the if block, it will check x is greater than y it will define a variable, that is "max", that holds variable x value and prints its value.
  • In the else block, if the above condition is false it uses the max variable, that holds variable y value and prints its value.
You might be interested in
QUESTION 9 of 10: Bob charged $200 for a plane ticket last month. When he received his statement, he saw that he could pay the m
IgorLugansk [536]

Answer:

yes cuz 25x8=200

Explanation:

3 0
2 years ago
Read 2 more answers
A(n) ____________________ is a named collection of stored data, instructions, or information and can contain text, images, video
Vanyuwa [196]
The answer in the blank is files for they exist in the computer that are responsible to hold or collect different types of application that could contribute in arranging them in order or showing classifications or simply storing them to put them in one place. This is essential to the computer for they are responsible in putting them in place and showing organization.
7 0
2 years ago
Read 2 more answers
Match the job skills with the correct job role.
Usimov [2.4K]

Answer:

B-1,A-4,C-2,D-3

Explanation:

5 0
1 year ago
(1) Prompt the user to enter five numbers, being five people's weights. Store the numbers in an array of doubles. Output the arr
Mashutka [201]

Answer:

weights = []

total = 0

max = 0

for i in range(5):

   weight = float(input("Enter weight " + str(i+1) + ": "))

   weights.append(weight)

   total += weights[i]

   if weights[i] > max:

       max = weights[i]

average = total / 5

print("Your entered: " + str(weights))

print("Total weight: " + str(total))

print("Average weight: " + str(average))

print("Max weight: " + str(max))

Explanation:

Initialize the variables

Create a for loop that iterates 5 times

Get the values from the user

Put them inside the array

Calculate the total by adding each value to the total

Calculate the max value by comparing each value

When the loop is done, find the average - divide the total by 5

Print the results

6 0
1 year ago
In a survey of 7200 T.V. viewers, 40% said they watch network news programs. Find the margin of error for this survey if we want
olga_2 [115]

Answer:

Margin of Error=M.E= ± 0.0113

Explanation:

Margin of Error= M.E= ?

Probability that watched network news programs = p = 0.4

α= 95%

Margin of Error =M.E= zₐ/₂√p(1-p)/n

Margin of Error=M.E= ±1.96 √0.4(1-0.4)/7200

Margin of Error=M. E = ±1.96√0.24/7200

Margin of Error=M. E- ±1.96* 0.005773

Margin of Error=M.E= ±0.0113

The Margin of Error is the estimate of how much error is possible as a result of random sampling.

6 0
2 years ago
Other questions:
  • One of the most toxic components of a computer is the
    11·1 answer
  • Write the 8-bit signed-magnitude, two's complement, and ones' complement representations for each decimal number: +25, + 120, +
    11·1 answer
  • Identify the normalized form of the mantissa in 111.01.
    14·1 answer
  • Survey Q, Non-scoring: What role are you playing in your team?
    5·2 answers
  • An electronics store purchased a CD player at a wholesale price of $60 and then sold it at a 40 percent discount off the origina
    13·1 answer
  • Windows is displaying an error about incompatible hardware. You enter BIOS/UEFI setup to change the boot priority order so that
    8·1 answer
  • Assume that a program uses the named constant PI to represent the value 3.14. The program uses the named constant in several sta
    9·1 answer
  • Jonah’s friend reminded him to check his report against the rubric provided by their teacher. His friend sent him these instruct
    12·1 answer
  • Write an expression to print each price in stock prices.
    15·1 answer
  • 1-(50 points) The function sum_n_avgcomputes the sum and the average of three input arguments and relays its results through two
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!