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]
3 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]3 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
Write Python programs to solve the following two problems. Your programs should be named according to the problem descriptions a
netineya [11]

no one is gonna write this for you lol, don't know why'd you take python and not pay attention.

7 0
3 years ago
A company has four departments: A, B, C, and D. The number of IP addresses required by each department is 100, 60, 20, and 26 re
Alex777 [14]

Answer:

deeppppuhjjuuiiijjjjk

6 0
3 years ago
The processor of a computer communicates to the other parts of the computer through a code that consists of what?
aleksklad [387]

1's and 0's


1's are On and 0's are off

6 0
4 years ago
Codehs dartboard 3.12.4
allsm [11]

Answer:

Whats the question?

Explanation:

7 0
3 years ago
A web application that is designed as a single piece of software with multiple features that are fully integrated into the main
Nookie1986 [14]

Answer:

c. Service oriented architecture (SOA)

Explanation:

In a service oriented architecture (SOA), a component of an application provides services to other components of the application or other applications majorly via a communications protocol over a network. In other words, SOA is a programming or software development technique in which services communicate with each other across different platforms.  

One key principle of SOA is to design an application (which in itself is a piece of software with multiple features) that is independent of any product, service, vendor or technology but can be integrated into other applications. SOA makes use of loose coupling -  a technique in which a client service remains independent of another service that requires it.

In contrast, a monolithic architecture aims at developing a software that is self-contained, independent and not to be integrated into other applications.

On another hand, Software as a service (SaaS), though a bit similar to SOA, is a model in which an application is made available to customers basically through a network. Users basically access the application via a browser.

Therefore, the best option is

C. Service oriented architecture.

3 0
3 years ago
Other questions:
  • Your desktop computer monitor is not displaying a picture. What would you do to troubleshoot the problem?
    9·2 answers
  • What are the names of each devices pleaseee​
    13·2 answers
  • During the Requirements Definition stage of a systems development​ project, the employees who will be the primary users of the n
    15·1 answer
  • A microphone is a type of electronic.<br><br> True/Faulse
    14·1 answer
  • Encryption has a remarkably long and varied history. Spies have been using it to convey secret messages ever since there were se
    7·1 answer
  • Create a class Str that subclasses str. Add a method to the subclass that checks if the string does not start with a given strin
    15·1 answer
  • According to Android’s suggested user interface standards, repeatedly pressing the app icon on an app’s action bar will eventual
    5·2 answers
  • A computer program uses 3 bits to represent integers. When the program adds the decimal (base 10) numbers 5 and 3, the result is
    6·1 answer
  • Write the issue related to the cyber ethnic. ​
    7·2 answers
  • What is denial service attack?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!