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
Selma writes the following four answers in her Computer Science examination.
REY [17]

Answer:

Interrupts.

Explanation:

A software can be defined as a set of executable instructions (codes) or collection of data that is used typically to instruct a computer on how to perform a specific task and solve a particular problem.

The four (4) input-output (I/O) software layers includes the following;

I. User level software: it provides user programs with a simple user interface to perform input and output functions.

II. Device drivers: it controls the input-output (I/O) devices that are connected to a computer system through a wired or wireless connection.

III. Device-independent OS software: it allows for uniform interfacing and buffering for device drivers.

IV. Interrupt drivers (handlers): it is responsible for handling interruptions that occur while using a software on a computer system.

An interrupt is a signal from a program or device connected to a computer and it's typically designed to instruct the operating system (OS) that an event has occurred and requires an attention such as stopping its current activities or processes.

In conclusion, the computer term that Selma is describing is interrupts.

3 0
3 years ago
Read 2 more answers
Both the USB flash drive and the DVD are data storage devices, but they both have numerous differences. Both can contain insane
o-na [289]
It Is Wonderful Add That A "USB" Can Hold Anything At All But Some Thing's "System's" Need A Specific Format Like The "PlayStation Three" With "FAT32" Format.
6 0
3 years ago
A computer system has a 32KB, 8-way set associative cache, and the block size is 8 bytes. The machine is byte addressable, and p
vagabundo [1.1K]

Answer:

Offset bits: 3-bits

Set number of cache: 12-bits

Tag bits: 7-bits

22-bit physical address

Explanation:

Since the system is 32K so,

=2⁵.2¹⁰

=2¹⁵

As we know that it is 8-way set associative so,

=2¹⁵/2³

=2¹⁵⁻³

=2¹²

2¹² are cache blocks

22-bit physical address

Off-set bits are 3 as they are calulated from 8-way set associative information.

Set number of cache : 12-bits

For tag-bits:

Add off-set bits and cache bits and subtract from the total bits of physical address.

=22 - (12+3)

=22 - 15

=7

3 0
3 years ago
The multitasking, multi-user, operating system developed by Bell Laboratories that operates on a wide variety of computing platf
olasank [31]

Answer:

Unix

Explanation:

UNIX is simply an operating system developed by Bell Laboratories in the 1960s. Ever since then, it has been constantly worked upon and developed. It is an operating system because it is a suite of programs capable of making a computer to function. Unix is considered to be a stable, multi-user, and multi-tasking system for both desktops and laptops and even servers.

8 0
3 years ago
Default tab stops are set in word every _______ inch. a. ¾ b. ½ c. 1 d. ¼
Dennis_Churaev [7]
A) 3/4 inch Meow! XD
6 0
3 years ago
Other questions:
  • The source code of a java program is first compiled into an intermediate language called java ____, which are platform-independe
    8·1 answer
  • _____ _____ deals with the definitions properties of mathematical models of computation.
    8·1 answer
  • The blue bar across the top of the screen informs you of the Screen Title, or what step you are on.
    5·1 answer
  • You can get context-sensitive help information from the Code Editor by_________.A) selecting Contents from the Help menu
    9·1 answer
  • Jason is working on a project that requires him to manage a huge amount of data. The spreadsheet he is working on has data relat
    15·1 answer
  • Consider the following code snippet:
    13·1 answer
  • What is data? why is it important to collect data ? explain the points.​
    10·1 answer
  • 9.18 LAB: Exact change - methods Write a program with total change amount as an integer input that outputs the change using the
    11·1 answer
  • What is a photographic print made from a negative image?
    7·1 answer
  • You can open a movie maker project file any time in a media player. (1 point) true false
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!