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
(25 POINTS) Some applications work on all devices while others work on some devices. True or False?
scoray [572]

Answer:

True.

Explanation:

It is true that some applications work on some devices but not on others. This is so because it depends on the operating system of each device, that is, if the device has an operating system compatible with the application in question, said application will work, but if, on the contrary, the operating system is not compatible, the application will not be useful in this.

7 0
3 years ago
give an example of a technical issue you were not able to resolve on your first attempt. What troubleshooting steps did you take
erastovalidia [21]
One technical issue I had was on Windows 8.1, with the charm menu not working. The troubleshooting steps to fix it was I did CTRL+SHIFT+ESC to open task manager. I then found Windows Explorer and clicked "Reload." Then everything was fine.

Hope This Helped!
6 0
3 years ago
If someone said to you, “Pseudocode is a waste of time! It’s just more work because you end up writing the same program twice,”
myrzilka [38]

Answer:

It allows the designer to focus on main logic without being distracted by programming languages syntax.

* Since it is language independent, it can be translated to any computer language code.

* It allows designer to express logic in plain natural language.

* It is easier to write actual code using pseudocode.

* Unlike algorithms, pseudocodes are concise so pseudocodes are more readable and easier to modify.

Explanation:

8 0
3 years ago
A customer service representative for an Internet provider uses various techniques to help a frustrated customer with a slow Int
tia_tia [17]

Answer:

“Think of it this way: When we’re done, your connection will be faster than it ever was before.”

Correct label:

positive reappraisal

“Okay, let’s put the connection speed issue aside for later and work on changing your password for our company website.”

Correct label:

distraction

“At least your router isn’t talking back at you! I can’t get my digital assistant to shut up.”

Correct label:

humor

Explanation:

4 0
3 years ago
After the following code is executed what will be displayed on the screen? bool correntEmployee = true; double empSalary = 45000
AlexFokin [52]

Answer:

"The employee pay rate is normal" is the correct answer for the above question.

Explanation:

  • The above question code is written in the c++ language, in which there is one variable of bool type whose value is true.
  • And this variable is also tested in the if-condition which gives the true and the if-body will be executed.
  • Then the internal if-condition will give the false result because the value of the empsalary is not less than 45000. It is because the above statement "empsalary=45000" will assign the value 45000 on the empsalary variable.
  • Then the else block will be executed which prints "the employee pay rate is normal".

7 0
3 years ago
Other questions:
  • True are fulse A piece of information that is considered common knowledge does not need a citation
    5·2 answers
  • What natural boundary separated british territory from louisiana?
    7·1 answer
  • Which hypervisor works on older pcs without hardware virtualization support?
    9·2 answers
  • Write an if-else statement to describe an object. Print "Balloon" if isBalloon is true and isRed is false. Print "Red balloon" i
    9·1 answer
  • Give me 3 facts and 3 opinions
    5·1 answer
  • In terms of object-oriented programming, after a class is defined,
    11·1 answer
  • All systems have ___________.
    9·2 answers
  • Edie wants to visit her university's website. What software application should she use?
    9·2 answers
  • . Describe a way to simplify a complex problem.
    8·1 answer
  • An article explaining the uses of the parts of a computer​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!