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
What is meant by Program Memory is paged?
atroni [7]

Answer:

Program memory is paged, this statement is defined as in a computer system paged memory is the process of allocation of memory and storing a portion of a process of execution. Page is a unit of logical memory in a program. It follows the process of paging, as it is a method of writing an information and reading the output from the storage drive. The main advantage of this process is that it become easy to swap because everything is the same size.

7 0
3 years ago
Write MATLAB script programs to perform the following conversions, taking a value in SI units as the input argument and returnin
IrinaVladis [17]
The answer most likely C
6 0
3 years ago
1. Where did the Industrial Revolution start and why did it begin there?​
Bingel [31]

Answer:

The first Industrial Revolution began in Great Britain in the mid-to-late 1700s, when innovation led to goods being produced in large quantities due to machine manufacturing.

This process began in Britain in the 18th century and from there spread to other parts of the world. Although used earlier by French writers, the term Industrial Revolution was first popularized by the English economic historian Arnold Toynbee (1852–83) to describe Britain's economic development from 1760 to 1840.

8 0
3 years ago
Read 2 more answers
Rint "Censored" if userInput contains the word "darn", else print userInput. End with newline.
Marta_Voda [28]

If you're coding with C++ then the solution would be:

  if (userInput.find("darn") != -1) {

     cout << "Censored" << endl;

  }

  else{

     cout << userInput << endl;

  }

Keep in mind that this will reject any input with the word "darn" in the sentence. This will not filter the word darn if the capitalization is in different formats like "Darn, dArn, daRn, darN, DARN".

7 0
3 years ago
A RESTful service, such as the open weather service use used in an activity in this class, sends and receives data in the form o
vfiekz [6]

Answer:

A key/value pair

Explanation:

JSON or JavaScript Object Notation uses key/value pairs to represent data.

Here's an example:

{

   name: "Jordan Carter"

   age: 25

}

Data can be then accessed using a key such as "name" to get the value "Jordan Carter."

8 0
2 years ago
Other questions:
  • A cast is required in which of the following situations? a. using charAt to take an element of a String and store it in a char b
    7·1 answer
  • If you are going to attach more than 15 devices to your wireless network, you should make sure your router supports which standa
    14·1 answer
  • Which one of the following items would you be most likely to keep in a database ?
    8·1 answer
  • Darpa was created to
    13·1 answer
  • Can Sombody please help me with this question, I'm struggling!
    7·1 answer
  • ________ is a process where authentication and permission will be passed on from one system to another, usually across multiple
    14·1 answer
  • Exercise#3: Write a ch program that performs the following: Declare a two arrays called arrayA and arrayB that holds integer and
    6·1 answer
  • To figure out how to use her MacBook Pro graphics software to update designs originally created on a DEC10, Marianne needs to us
    9·1 answer
  • E-commerce transactions that are executed using wireless mobile devices are known as
    15·1 answer
  • What three best practices can help defend against social engineering attacks?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!