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]
4 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]4 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
Define a python functions that draw a pinwheel using the pinwheel function that has input paramiters that allows you to change t
QveST [7]

Start with your draw_pinwheel() function

During each iteration of the loop decide which color to set the turtle to using the color() function

On even iterations, use color1

On odd iterations, use color2

Use an if/else statement to do the decision making

After deciding the color, surround a call to draw_triangle() with begin_fill() and end_fill() so that drawing the triangle creates a colored triangle.

If you have have forgotten, you can use an if/else to check for even/oddness in python as follows.

my_number = 3

if(my_number % 2 == 0):     # the remainder of dividing by 2 is 0

   print("The number is "+str(my_number))

   print("The number is EVEN")

else:                       # the remainder must be 1

   print("The number is "+str(my_number))

   print("The number is ODD")

Good luck <3

8 0
3 years ago
How do network intrusion detection systems (NIDS) and host-based intrusion detection systems (HIDS) differ?an NIDS focuses more
balandron [24]

Answer:

a. NIDS focuses more on analyzing incoming traffic, while an HIDS monitors valuable OS files

Explanation:

Intrusion detection system is used in analyzing, detecting, and raising alarm on suspicious network activities used by hackers to access unauthorized sites. Network intrusion detection system is meant to work in real-time, so as to analyze incoming traffic. Packets moving across the network are evaluated for threats.

Host intrusion detection system work within the operating system of the device to evaluate the history of system files that could contain threats, or unusual file permission changes, and then raise an alarm.

3 0
3 years ago
When entering a function or formula in a cell, which is the first character
AnnZ [28]

Answer:

B

Explanation:

6 0
3 years ago
The Arrange All function is used to organize multiple open workbooks at once. Select the correct navigational path to
ElenaW [278]

Answer:

1. View

2. Window

3. Arrange all

Explanation:

I did the assignment on edgenuity

5 0
3 years ago
Read 2 more answers
When nearly all Americans in a recent survey said that they believe executives base decisions primarily on what will advance the
dlinn [17]

Answer:

serious concerns about.

Explanation:

Since the reports are indicating the almost all the Americans believe executive based decisions and it is a serious concern because the people should be taking their own decisions and the career decisions are the most important ones in a person's life. Depending on other to take decisions for you shows a weak character and lack of self-confidence.

6 0
3 years ago
Other questions:
  • For a panoramic photograph, you will more than likely want to control the exposure of the photograph yourself rather than lettin
    11·1 answer
  • Assume that the variables gpa, deansList and studentName, have been declared and initialized . Write a statement that both adds
    6·1 answer
  • Point mode allows you to select cells for use in a formula by using your finger or the pointer
    7·1 answer
  • A. True <br> b. False: variables represent storage locations in the computer's memory.
    13·1 answer
  • What are two ways to access the options for scaling and page orientation? click the home tab, then click alignment, or click the
    10·1 answer
  • Amanda needs to create an informative print brochure for her local library’s fundraiser dinner. What critical detail must she ha
    14·2 answers
  • Top Down Design makes it easier to solve a problem by:___________
    10·1 answer
  • You might have trouble interpreting a message if:
    15·1 answer
  • What is a google search query that will search for xml files on the domain example.Com
    8·1 answer
  • In large organizations, there is a formal business function that includes developing an information policy, planning for data, o
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!