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
ollegr [7]
3 years ago
9

The following program segment is designed to compute the product of two nonnegative integers X and Y by accumulating the sum of

X copies of Y; that is, 3 times 4 is computed by accumulating the sum of three 4s.
Is the program segment correct? Explain your answer.

Product ←0;

Count ←0;

repeat (Product ←Product + Y,

Count ←Count + 1)

until (Count = X)
Computers and Technology
1 answer:
mote1985 [20]3 years ago
5 0

The program is correct: at the beginning, product = 0. Then, we start summing Y to that variable, and we sum Y exactly X times, because with each iteration we increase Count by 1, and check if Count=X so that we can exit the loop.

You might be interested in
Array A is not a heap. Clearly explain why does above tree not a heap? b) Using build heap procedure discussed in the class, con
Aleksandr [31]

Answer:

Sorted Array A { } = { 1, 4, 23, 32, 34, 34, 67, 78, 89, 100 }

Explanation:

Binary tree is drawn given that the binary tree do not follow both minimum heap and maximum heap property, therefore, it is not a heap.

See attached picture.

6 0
3 years ago
Suppose that the domestic production of computer games creates enjoyment for those who play the games. Domestic production of co
kirill [66]

Answer:

a

Explanation:

Based on the information provided within the question it can be said that the best possible policy to encourage this would be to impose tariffs on computer game imports. This would force company's to begin domestic production of computer games in order to continue making the profits from the domestic market as opposed to losing out on all of the opportunities that the domestic market offers them.

6 0
3 years ago
Difference between volatile and non volatile memory
slega [8]
<span>Volatile memory requires electricity or some kind of current to store information, and nonvolatile memory does not.</span>
6 0
3 years ago
Read 2 more answers
Binary is best interpreted by a computer because ​
Nookie1986 [14]
Because it is the back-end programming. It is the basis of all of the other computer languages and allows the computer to function.
8 0
2 years ago
Read 2 more answers
An application programming interface (API) is ________. Select one: A. the code to interface between an application and RAM B. t
Olegator [25]

Answer:

An application programming interface (API) is the code the CPU recognizes to perform a procedure in an application.

Explanation:

An application programming interface (API) is the code the CPU recognizes to perform a procedure in an application. API allows an application to communicate with another application, or an operating system, database, network, etc.

An Application Programming Interface (API) creates a consideration for a problem and specifies how clients should interact with software components that implement a solution to that problem.

More recently, API has been used to refer to a specific type of interface between a client and a server, which has been described as a “contract” between both - such that if the client makes a request in a specific format, it will always get a response in a specific format or initiate a defined action.This is a specialized form of API, defined as a Web API.

3 0
2 years ago
Other questions:
  • What economic measure is at the highest level since the Great Depression?
    12·1 answer
  • William has an internet connection that does not allow him to make calls when connected to the Internet. What internet service c
    8·2 answers
  • Which term describes the situation wherein a jury fails to reach a unanimous verdict? A occurs when a jury cannot reach a unanim
    14·1 answer
  • When you catch an Exception object, you can call ____ to display a list of methods in the call stack so you can determine the lo
    6·1 answer
  • QUESTION
    10·1 answer
  • What is the best brand of folders
    13·2 answers
  • In the Unified Process (UP) methodology, most of the Implementation activities occurs during the _____ phase.
    14·1 answer
  • What are the characteristics of calendar sharing options in Outlook 2016? Check all that apply.
    13·2 answers
  • Imagine that a team of scientists test a certain hypothesis, and the experimental results show that it is false.
    6·1 answer
  • Kenny is asked to submit a photo for the annual photographic competition. He decided to capture a photo with the light-painting
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!