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
creativ13 [48]
4 years ago
11

Write, compile and test (show your test runs!) program that calculates and returns the fourth root of the number 81, which is 3.

Your program should make use of the sqrt() method. Math.sqrt(number).

Computers and Technology
1 answer:
lys-0071 [83]4 years ago
5 0

Answer:

I am writing a JAVA program. Let me know if you want the program in some other programming language.

public class FourthRoot{ //class to calculate fourth root of 81

public static void main(String[] args) { //start of main() function body

   double square_root; //declares to hold the fourth root of 81

   double number=81; // number is assigned the value 81

/* calculates the fourth root of number using sqrt() method twice which means sqrt() of sqrt(). This is equivalent to pow(number,(0.25)) where pow is power function that computes the fourth root by raising the number 81 to the power of 0.25 which is 1/4 */

   square_root=Math.sqrt(Math.sqrt(number));

//displays the fourth root of 81 i.e. 3

     System.out.println("Fourth Root of 81 is "+ square_root); } }

Explanation:

The program is well explained in the comments given along with each statement of the program . Since it was the requirement of the program to user Math.sqrt() method so the fourth root of number= 81 is computed by taking the sqrt() of 81 twice which results in the fourth root of 81 which is 3.

So the first sqrt(81) is 9 and then the sqrt() of the result is taken again to get the fourth root of 81. So sqrt(9) gives 3. So the result of these two computations is stored in square_root variable and the last print statement displays this value of square_root i.e. the fourth root of number=81 which is 3.

Another way to implement the program is to first take sqrt(81) and store the result in a variable i.e. square_root. After this, again take the sqrt() of the result previously computed and display the final result.

public class FourthRoot{

   public static void main(String[] args) {

   double square_root;

   double number=81;

   square_root=Math.sqrt(number);

  System.out.println("Fourth Root of 81 is: "+ Math.sqrt(square_root)); } }

The program along with its output is attached in a screenshot.

You might be interested in
Which wildcard character replaces a single character in the command-line interface?
pantera1 [17]

Answer:

? (the question mark)

Explanation:

The asterisk (*) matches one or more occurrences of any character, but the question mark matches exactly one.

6 0
3 years ago
What does a rung lock do to an extension ladder?
Stells [14]
What’s a rung lock and an extension ladder
8 0
4 years ago
After submitting a résumé by mail, how long should you wait before following up with an employer? a. 1 day b. 2-3 days c. 1 week
inn [45]
C is the correct answer. One week is an appropriate amount of time to wait when mailing a resum<span>é</span><span>, because it takes at least a couple of days for mail to arrive. However, you still want a decisive response, so two weeks is probably a little too long.</span>
7 0
3 years ago
Theresa is a certified teacher. She just had a baby and would like to stay home, but still wants to teach. Which career would be
vesna_86 [32]
I think it will be online classes (B.)
8 0
3 years ago
Read 2 more answers
Who want to go on scratch<br> I really need people to favorite and like my projects
mariarad [96]

Answer:

Sure

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • Assume the existence of a Building class with a constructor that accepts two parameters: a reference to an Address object repres
    9·1 answer
  • After a worksheet has been displayed in page layout view, page breaks are indicated by ________ in normal view.
    14·1 answer
  • The number of protons plus the number of nuetrons equal the <br> A.atomic weight<br> B.atomic number
    10·1 answer
  • If wire rope guard rails are used what must also be done?
    10·1 answer
  • What is working with others to find a mutually agreeable outcome?
    8·2 answers
  • Complete this code in main to perform the requested operations for a date entered by the user in this format: month dd, yyyy
    10·1 answer
  • Which of the following statements is true? The Wireshark protocol analyzer has limited capabilities and is not considered multi-
    15·1 answer
  • Ok I'm sorry to all those who are trying to messasge me on brainly my brainly inbox is not working and hasn't work since the beg
    12·2 answers
  • Which statement about broadcasting a slideshow online is true?
    14·2 answers
  • There is a group of 10 people who are ordering pizza. If each person gets 2 slices and each pizza has 5 slices, how many pizzas
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!