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
Lelu [443]
2 years ago
12

Write an algorithm to find perimeter of circle​

Computers and Technology
1 answer:
Anna11 [10]2 years ago
6 0

Answer:

Here’s one!

Given [math]R[/math], the radius of the circle.

Let [math]N,D\leftarrow 0[/math]

Repeat until [math]D[/math] is large enough (about 1,000,000)

[math]x,y\leftarrow U[0,1][/math]

If [math]x^2 + y^2\le 1[/math] then [math]N\leftarrow N+1[/math]

[math]D\leftarrow D+1[/math]

[math]P\leftarrow\frac{8NR}{D}[/math]

Return [math]P[/math]

[math]U[0,1][/math] is a uniform random number in the range [math][0,1][/math].

Explanation:

You might be interested in
Write a procedure named Read10 that reads exactly ten characters from standard input into an array of BYTE named myString. Use t
MatroZZZ [7]

Answer:

Following are the solution to the given question:

Explanation:

Since a procedure has the Read10 parameter, the 10 characters from the input file are stored in the BYTE array as myString. The LOOP instruction, which includes indirect addressing and also the call to the ReadChar method, please find the attached file of the procedure:

3 0
2 years ago
The part of the eye thats similar to the film of a camera is the
Lapatulllka [165]
The retina is the part pf the eye that is similar to the film of a camera. It is a thin layer of cells that is located at the back of the eyeball. This part contains photoreceptor cells which respond to light where the neural signals received undergoes complex processing by other neurons in the retina.
3 0
2 years ago
A client sends seven equal sized segments with sequence numbers 15, 25, 35,45, 55, 65, and 75. Segments with sequence numbers 35
ikadub [295]

Answer: I believe the answer is 6

Explanation: taking 35 and 65 out leaves the rest of the numbers; 15,25,45,55, and 75.

3 0
3 years ago
Give a recursive version of the algorithm Insertion-Sort (refer to page 18 in the textbook) that works as follows: To sort A[1..
Inga [223]

Answer:

see explaination

Explanation:

void insertion( int e,int *x, int start, int end)

{

if (e >= x[end])

x[end+1] = e;

else if (start < end)

{

x[end+1] = x[end];

insertion(e, x, start, end-1);

}

else

{

x[end+1] = x[end];

x[end] = e;

}

}

void insertion_recurssion(int *b, int start, int end)

{

if(start < end)

{

insertion_sort_recur(b, start, end-1);

insertion(b[end], b, start, end-1);

}

}

void main()

{

insertion_recurssion(x,0,5);

}

3 0
3 years ago
Question # 6
nika2105 [10]

Answer:

14.0

Explanation:

The loop converts each answer to a float. The accumulator variable adds the values entered.  

2.0 + 5.0 + 1.0 + 6.0 = 14.0

3 0
3 years ago
Read 2 more answers
Other questions:
  • A ___ is the basic collective unit of data in a computer.
    12·1 answer
  • When you move or size a control in the Form Designer, Visual Studio automatically adjusts the ________________ that specify the
    9·1 answer
  • The penalties for a person's third DUI conviction include fines of __________.
    11·2 answers
  • PLEASE HELP ME ASAP!!!!
    11·1 answer
  • What is considered necessary to establish OSHA
    5·1 answer
  • Discuss the different types of user-friendly interfaces and the types of users who typically use each.
    12·1 answer
  • Users of Adobe Reader, created by Adobe Systems Incorporated, are prompted to provide feedback on their experiences with the sof
    7·1 answer
  • If a triathlon is a sport combining three events, what do you think would be the word for a sport combining five events?
    7·1 answer
  • Which of the following are NOT possible using the RANDOM(a, b) and DISPLAY(expression) abstractions?
    10·1 answer
  • Braxton is writing a program to design t-shirts. Which of the following correctly sets an attribute for color?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!