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
Consider the following code segment.
mafiozo [28]

Answer:

for (int h = k; h >= 0; h--)

Explanation:

From the list of given options, option C answers the question.

In the outer loop

Initially, k = 0

In the inner loop,

h = k = 0

The value of h will be printed once because h>=0  means 0>=0 and this implies once

To the outer loop

k = 1

The inner loop will always assume value of k;

So,

h = 1

This will be printed twice because of the condition h>=0  means 1>=0.

Since 1 and 0 are >=0; 1 will be printed twice

To the outer loop

k = 2

The inner loop

h = 2

This will be printed thrice because of the condition h>=0  means 2>=0.

Since 2, 1 and 0 are >=0; 2 will be printed thrice

To the outer loop

k = 3

The inner loop

h = 3

This will be printed four times because of the condition h>=0  means 3>=0.

Since 3, 2, 1 and 0 are >=0; 3 will be printed four times

7 0
3 years ago
DMA controllers ____.A) do not utilize an additional, special purpose, processorB) are a nonstandard component in PCs of todayC)
otez555 [7]

Answer:

D) can access main memory at the same time as the main CPU

Explanation:

DMA is short for Direct Memory Access, these controllers allow the device to transfer data directly to and from the memory modules without interfering with CPU processes. Therefore it can access main memory at the same time as the main CPU. Thus freeing up CPU processing power for other tasks while also retrieving the data necessary.

8 0
2 years ago
Which of the following is NOT true about variables?
VikaD [51]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The value stored by a variable can be changed after it is assigned(true).

The value of a variable can be changed after it is assigned, for example:

int a=10;

and we can change the value of variable a in letter program such as:

a=15;

Variables are a name for a spot in the computer's memory (true).

it is true, because the variables value stored in the computer's memory and we can access theses values by their name (variable name). so Variables are a name for a spot in the computer's memory.

Variable names can be words: such as temperature or height (true).

Yes, the variable name can be words such as height, width, temperature etc.

The value stored by a variable cannot be changed after it is assigned (false).

It is noted that the value stored by a variable can be changed after it is assigned. However, it is noted that is some programming language, you can't change the value of static variable.

3 0
3 years ago
Who wont me???????????????
Svet_ta [14]

Answer:

whatatattatata

Explanation:

what are u talking about

8 0
3 years ago
Read 2 more answers
Explain Organizational approach to System Analysis and Design
9966 [12]

Answer:

The major goal of systems analysis and design is to improve organizational systems. Often this process involves developing or acquiring application software and training employees to use it. Application software, also called a system, is designed to support a specific organizational function or process, such as inventory management, payroll, or market analysis. The goal of application software is to turn data into information. For example, software developed for the inventory department at a bookstore may keep track of the number of books in stock of the latest best seller. Software for the payroll department may keep track of the changing pay rates of employees. A variety of off-the-shelf application software can be purchased, including WordPerfect, Excel, and PowerPoint. However, off-the-shelf software may not fit the needs of a particular organization, and so the organization must develop its own product.

Explanation:

Information systems analysis and design is a method used by companies ranging from IBM to PepsiCo to Sony to create and maintain information systems that perform basic business functions such as keeping track of customer names and addresses, processing orders, and paying employees. The main goal of systems analysis and design is to improve organizational systems, typically through applying software that can help employees accomplish key business tasks more easily and efficiently. As a systems analyst, you will be at the center of developing this software. The analysis and design of information systems are based on:

Your understanding of the organization’s objectives, structure, and processes

Your knowledge of how to exploit information technology for advantage

7 0
3 years ago
Other questions:
  • 2 negative impact of excessive use of computer even in solving mathematical problem.
    11·1 answer
  • A network administrator issues the show vlan brief command while troubleshooting a user support ticket. What output will be disp
    15·2 answers
  • Write a program to add two number marie simulator.
    15·1 answer
  • If a function needs to return more than one value, as a rule of good programming style, you should change it to a(n) ___________
    6·1 answer
  • "Create a Matlab Scrapt that will take the a Matrix A and Matrix B (of AX=B), then calculate the Determinant of Matrix A, Invers
    5·1 answer
  • We will use linear interpolation in a C program to estimate the population of NJ between the years of the census, which takes pl
    10·1 answer
  • 5. Write the name of the tab, command group, and icon you need to use to access the
    11·2 answers
  • Answer This One Question Right For Brainliest
    10·1 answer
  • Changing how information is represented so that it can be read by a computer is called
    7·1 answer
  • Explain any two types of board band connection​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!