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
Inessa05 [86]
2 years ago
14

Two numbers are given (numbers are entered from the keyboard). If both numbers are positive, then output their sum, if both numb

ers are negative, then output their product, if the numbers are positive and negative, then output the square of a positive number (number ** 2).
Даны два числа (числа вводим с клавиатуры). Если оба числа положительные, то выдать их сумму, если оба числа отрицательные, то выдать их произведение, если числа положительное и отрицательное, то выдать квадрат положительного числа (number**2).
Computers and Technology
1 answer:
AleksAgata [21]2 years ago
3 0

Answer:

The program in Python is as follows:

num1 = int(input())

num2 = int(input())

if num1 >=0 and num2 >= 0:

   print(num1+num2)

elif num1 <0 and num2 < 0:

   print(num1*num2)

else:

   if num1>=0:

       print(num1**2)

   else:

       print(num2**2)

Explanation:

This gets input for both numbers

num1 = int(input())

num2 = int(input())

If both are positive, the sum is calculated and printed

<em>if num1 >=0 and num2 >= 0:</em>

<em>    print(num1+num2)</em>

If both are negative, the products is calculated and printed

<em>elif num1 <0 and num2 < 0:</em>

<em>    print(num1*num2)</em>

If only one of them is positive

else:

Calculate and print the square of num1 if positive

<em>    if num1>=0:</em>

<em>        print(num1**2)</em>

Calculate and print the square of num2 if positive

<em>    else:</em>

<em>        print(num2**2)</em>

You might be interested in
Chemical reaction rates are proportional to a rate constant, k, which changes with temperature according to the Arrhenius equati
Vanyuwa [196]

Answer:

see answer below

Explanation:

the equation is given by

k=ko* e^(-Q/RT)

then replacing the known values

k=1200 min⁻¹ e^[-8000 cal/mole/ (1.987 cal/mole K *T)]

then replacing values of T every 50 K from 100 to 500 K we get the series of values

\left[\begin{array}{ccc}T&k\\100&3.924*10^{-15} min ^{-1} \\150&2.643*10^{-9} min ^{-1} \\200&2.17*10^{-6} min ^{-1} \\250&1.216*10^{-4} min ^{-1} \\300&1.781*10^{-3} min ^{-1} \\350&0.012 min ^{-1} \\400&0.051 min ^{-1} \\450&0.156 min ^{-1} \\500&0.382 min ^{-1} \end{array}\right]

7 0
3 years ago
1. Se requiere implementar un conversor unipolar que tendrá una tensión analógica variable entre 0 y 2 V pico. Deberá tener una
PolarNik [594]

Answer:

A

Explanation:

Because

7 0
3 years ago
What is green computing in non-technical term?​
DochEvi [55]

Answer:

Green computing is also known as green information technology (green IT)

4 0
3 years ago
What is an accurate definition of a goal?
notka56 [123]

Answer:

something specific a person wants to achieve m8

Explanation:

5 0
3 years ago
Read 2 more answers
a user reports that his dot matrix printer is printing dark and clear on the left of the paper but that the print is very light
yarga [219]

Answer:

Correctly position the platen of the printer to hold the paper in place.

Explanation:

Since the dot matrix printer is printing dark and clear on the left of the paper but very light on the right side of the paper, it is possible that the paper is not being held properly. So adjusting the platen will hold the paper properly and hence uniform prints on the paper.

Note: Dot matrix printers are printers that print closely related dots to form require texts (shapes) by striking some pins against an ink ribbon.

Some of the parts of these printers are; power supply, carriage assembly, Paper sensor, ribbon, platen and pins.

4 0
3 years ago
Other questions:
  • Which of the following is the rarest and most valuable mineral ore among the native elements?
    13·1 answer
  • A report formatted where the page is taller than it is wide is formatted in ____.
    12·1 answer
  • To close the ____ view, click File on the Ribbon or click the preview of the document in the Info gallery to return to the docum
    9·1 answer
  • What are the three uses of a screw?​
    13·2 answers
  • Write a function namedmake_complex that stores its twoarguments (both of type double) in acomplex structure, then returns thestr
    12·1 answer
  • What happens to a message when it is deleted?
    11·1 answer
  • Help! I’ll mark you brainly! Please help me.
    15·1 answer
  • Which of the following statements tests if users walked 10,000 or more steps and ate fewer than 25 grams of sugar?
    9·1 answer
  • What goes in between the &lt; &gt; when declaring a new ArrayList?
    14·1 answer
  • Does anyone have Rblx? if so write your username
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!