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
GREYUIT [131]
3 years ago
12

Get two positive integers from the user. Write code to multiply the two numbers together using only addition or subtraction. You

should not use the '*' operator. Remember that x*y is simply x+x+x+...+x, y times. You may use eitnher a for loop or a while loop
Computers and Technology
1 answer:
padilas [110]3 years ago
8 0

Answer:

number1 = int(input("Enter the first number: "))

number2 = int(input("Enter the second number: "))

result = 0

for i in range(number1):

   result += number2

print(str(result))

Explanation:

Ask the user for two numbers

Initialize result as 0 to hold the multiplication of the numbers

Create a for loop that iterates "number1" times. In each iteration, add number2 to the result.

When the loop is done, print the result

You might be interested in
In what form do the hexadecimal numbers need to be converted for a computer’s digital circuit to process them? Hexadecimal numbe
artcher [175]

Answer:

people45

Explanation:

3 0
2 years ago
Given that slotted ALOHA contains three active stations: X, Y, Z. The probability of generating frames by these stations in a ti
Stella [2.4K]

Answer:

Throughput of X, Y, Z will be 0.081

The network throughput will be 0.243

Explanation:

Throughput of X will be Tx = Px*(1-Py)*(1-Pz)=0.1*0.9*0.9=0.081

Throughput for Y and Z can be calculated in same way.

Throughput of network = Tx+Ty+Tz=0.081+0.081+0.081=0.243

3 0
3 years ago
Here is the API for a robot library. // moves the robot forward function moveForward(); // turns the robot to the left function
kupik [55]

Answer:

Option (A)

Explanation:

See attachment for options

From the options, the code segment of option (A) answers the question and the explanation is as follows:

I added a second attachment which illustrates the movement

function (solveMaze) {

moveForward(); ---- The robot moves up (to position 1)

moveForward(); ---- The robot moves up (to position 2)

rotateRight(); ---- The robot changes where it faces (however, it is still at position 2)

<em>while(canMove("forward")) { moveForward(); } </em>---- This is repeated until the robot reaches the end of the grid (i.e. position 3 and 4)

rotateLeft(); ---- The robot changes where it faces (however, it is still at position 4)

moveForward(); ---- The robot moves up to the gray square

5 0
3 years ago
What is cloud data storage?
bearhunter [10]
Cloud data storage is a model of data storage in which data is managed and backed up on a network.
4 0
3 years ago
Read 2 more answers
Select the correct answer from each drop-down menu.
gtnhenbr [62]

Answer:

Cloud computing allows users to sell computing resources and follows the pay once use multiple times payment model.

Explanation:

If you sell u pay once and always use.

5 0
3 years ago
Read 2 more answers
Other questions:
  • The internet may best be compared to a
    12·2 answers
  • At your job, you often have to address letters to the customer support manager, Tyson Kajewski. The problem is that you are cons
    9·1 answer
  • Explain the features of page layout software ​
    5·1 answer
  • What content is important to include in your webpage?
    9·1 answer
  • I need to create a method named "root positive". which will either print the square root of the number passed to it or if the nu
    13·1 answer
  • Visual Design includes 4 elements: shapes, texture, lines and form.
    6·1 answer
  • Who is tim berners-lee
    14·2 answers
  • The computer scientists Richard Conway and David Gries once wrote: The absence of error messages during translation of a compute
    7·1 answer
  • Pleasee help meeeeeeeeee I’m stuckk!!!!
    14·2 answers
  • Why not to use settimeout in angular.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!