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
faust18 [17]
3 years ago
14

How many times does the following loop execute? double d; Random generator = new Random(); double x = generator.nextDouble() * 1

00; do { d = Math.sqrt(x) * Math.sqrt(x) - x; System.out.println(d); x = generator.nextDouble() * 10001; } while (d != 0); exactly once exactly twice can't be determined always infinite loop
Computers and Technology
1 answer:
iren [92.7K]3 years ago
5 0

Answer:

The number of execution can't always be determines

Explanation:

The following points should be noted

Variable d relies on variable x (both of double data type) for its value

d is calculated as

d = \sqrt{x}^2 - x

Mere looking at the above expression, the value of d should be 0;

However, it doesn't work that way.

The variable x can assume two categories of values

  1. Small Floating Point Values
  2. Large Floating Point Values

<em>The range of the above values depend on the system running  the application;</em>

<em></em>

When variable x assumes a small value,

d = \sqrt{x}^2 - x will definitely result in 0 and the loop will terminate immediately because \sqrt{x}^2 = x

When variable x assumes a large value,

d = \sqrt{x}^2 - x will not result in 0  because their will be \sqrt{x}^2 \neq  x

The reason for this that, the compiler will approximate the value of \sqrt{x}^2 and this approximation will not be equal to x

Hence, the loop will be executed again.

<em>Since, the range of values variable x can assume can not be predetermined, then we can conclude that the number of times the loop will be executed can't be determined.</em>

You might be interested in
Summarize the five stages of cultural shock
Anton [14]
1. Honeymoon stage
2. Distress and anxiety
3. Adjustment
4. Adaption
5. Re-entry shock
8 0
3 years ago
Read 2 more answers
Cómo se llaman los robots que se utilizan para la exploración espacial, en medicina, en la industria, en la agricultura, los que
Andrews [41]

La respuesta correcta para esta pregunta abierta es la siguiente.

Olvidaste incluir las opciones o los incisos que contienen las respuestas.

No obstante, con la idea de poder ayudarte hicimos una investigación y te podemos compartir lo siguiente.

Los robots que se utilizan para la exploración espacial, en medicina, en la industria, en la agricultura, los que se utilizan en el hogar se llaman "espacial, médico, industrial, agrícola, y doméstico."

Estos son los tipos de robots que ya se encuentran en la mayoría de empresas e industrias de nuestros países.

La robótica se empieza a adueñar de los trabajos que antes solamente podían realizar los seres humanos. Hoy en día, los trabajadores se ven desplazados de sus empleos porque la tecnología llegó para quedarse. Esto se ve claramente en las plantas armadores industriales que están llenos de robots que realizan funciones robotizadas.

De igual manera, los artículos electrodomésticos y la tecnología digital está haciendo uso de inteligencia artificial para eficientar las funciones del hogar.

6 0
3 years ago
Which team member on a project typically understands color theory and graphic art? A Art director B Editor CProgrammer D Softwar
Serggg [28]

Answer:

(A) Art Director

Explanation:

The art director will be responsible for all of the visual graphics in a project so they would require knowledge in colour theory and graphic art.

8 0
3 years ago
Identify the tips to create a well-designed digital portfolio.
Levart [38]

Answer:

B. She created a person website with a unique URL for her online portfolio

Explanation:

8 0
3 years ago
Select the correct answer.
Vsevolod [243]

Answer:

A.  inspection

Explanation:

To find - Monica, a reviewer, wants to use a formal review for the SQA process. Which review should Monica use for this purpose?

A.  inspection

B . internal audit

C.  test review

D . walkthrough

Proof -

SQA process - Software Quality Assurance process

The correct option is - A.  inspection

Reason -

Formal review in software testing is a review that characterized by documented procedures and requirements. Inspection is the most documented and formal review technique.

The formality of the process is related to factors such as the maturity of the software development process, any legal or regulatory requirements, or the need for an audit trail.

The formal review follows the formal process which consists of six main phases – Planning phase, Kick-off phase, the preparation phase, review meeting phase, rework phase, and follow-up phase.

3 0
3 years ago
Other questions:
  • Which tool is used to create an interactive web application?
    15·1 answer
  • How many bits must be "flipped" (i.e., changed from 0 to 1 or from 1 to 0) in order to capitalize a lowercase that’s represented
    13·2 answers
  • Differences between Quality of Services and a Service of Quality approach
    9·1 answer
  • Practice problems on functions. Write C function(s) to carry out the specified tasks. For each problem, also write the suggested
    15·1 answer
  • Java variable is the name of a Group of answer choices numeric data value stored in memory data value stored in memory that can
    15·1 answer
  • How to fix this.. facing this problem to upload logo
    12·1 answer
  • Can nano gold be a way possibly reduce or kill cancer cell growth?
    13·1 answer
  • Which is the least technically experienced technical support group?
    7·1 answer
  • The conversion rate is the percentage of what? A. Customers who received cold calls B. Sales leads who reached the interest stag
    13·1 answer
  • If you wish to install a new OS without disturbing the old one so that you can boot to either OS, what type of boot setup should
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!