Compute the approximate nth root of x

Assignment Help Basic Computer Science
Reference no: EM13210194

Problem: Given a positive integer n and a positive integer x compute the approximate nth root of x. Pseudo-code: double Nroot (integer n, integer x){ integer loGuess=1; integer hiGuess = x; guess = average of loGuess and hiGuess; loop while guess^n is not within 1 of x if guess < guess^n then loGuess = guess else hiGuess=guess guess = average of loGuess and hiGuess; endLoop return guess Write this program in Java and completely analyse. PS. please send me the answer not an example!

Reference no: EM13210194

Questions Cloud

How many doughnuts will you consume : You work on a doughnut farm--you grow doughnuts. In each period, you are able to grow 20 doughnuts. If you go to the coffee & doughnut exchange, you may buy and sell doughnuts for $1 each, and buy and sell coffee for $2 each.
Explain the sign contains neon at a pressure : A neon is made of glass tubing whose inside diameter is 2.5 cm and whose length is 5.5 m. If the sign contains neon at a pressure of 1.73 torr at 31 degrees celcius
Write a c++ code that includes the following operations : Write a C++ code that includes the following operations: z=x * y z=z + 5.0 x, y, and z are floating point variables. A function (subroutine) named GetData should be declared to get data (x and y) from keyboard. The call by reference mechanism shou..
History of islam : History of Islam before the 1300's, the Spread of Islam, life of the Prophet Muhammad, or any related topics. Feel free to ask any questions, and also let me know your selection via email.
Compute the approximate nth root of x : Problem: Given a positive integer n and a positive integer x compute the approximate nth root of x.
State standard reduction potentials be arbitrarily assigned : why must one half reaction in the table of standard reduction potentials be arbitrarily assigned a value of 0 volts? why were not all of the half cell potentials
Determine how many cups of coffee could you buy : You work on a doughnut farm--you grow doughnuts. In each period, you are able to grow 20 doughnuts. If you go to the coffee & doughnut exchange, you may buy and sell doughnuts for $1 each, and buy and sell coffee for $2 each.
Determine the number of sub strings : Determine the number of sub strings that start with the character 'I' and end with 'E' in the word below. Show all the work. I N T E L L I G E N C E
What are three different ways atmospheric can find : What are three different ways atmospheric [CO2] can be determined? Under what circumstances would you chose to utilize

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Create a program to keep track of the participants

Create a program to keep track of the participants in a triathlon. Your program will keep track of the times in three events: Running, Swimming, and Biking.

  Plan the logic for a program for the sales manger

plan the logic for a program for the sales manger of the couch potato furniture company. The manger needs a program to determine the profit on any item sold. Input includes the wholesale price and retail price for an item.

  Relationship between squared biases and variances

Assume we have sample of N pairs xi, yi drawn i.i.d. from distribution characterized as given: xi ∼ h(x), design density. Illustrate relationship between squared biases and variances.

  Individual traffic light has at least three states (g.y,r)

Consider a traffic light system at a four-way crossroads (two roads intersecting at right angles) with a countdown timer, a crosswalk button, and a speaker that announces it's ok or not ok to walk

  A priority encoder has 2^n inputs

A priority encoder has 2^n inputs. It produces an N-bit binary output indiciating the most significant bit of the input that is TRUE, or 0 if none of the inputs are TRUE

  Modify solution and categorize it using big-theta notation

Sometimes a slight change in the problem can significantly modify form of its solution. For instance, determine simple algorithm for solving following problem and categorize it using big-theta notation.

  Construct the work breakdown structure

Construct the Work Breakdown Structure, define all of the activities and sequence these, schedule the project and then resource and budget the project using Microsoft Office Project.

  How matrices are calculated

Show each of the intermediate matrices. Refer to section 9-1 of the textbook for the details of how matrices are calculated. Because no translations are involved, you can use 3 x 3 matrix math for your calculations.

  Prove by solving the equations using laplace transform

For a RC circuit, we can use Laplace transforms to show that when we apply a step input of 5V, the voltage across the capacitor rises exponentially to a final value equal to step input.

  Explain use of gross domestic product-measure business cycle

Explain the use of Gross Domestic Product (GDP) to measure business cycle. Explain the roles of government bodies which determine national fiscal policies.

  Prove by contradiction that if n is a perfect square

Let n > 1 be an integer. Prove by contradiction that if n is a perfect square, then n + 3 cannot be a perfect square.

  Write a recursive method

public static boolean isSorted(List l) Write a recursive method that returns true if a linked list is sorted (nondecreasing) order and returns false otherwise. An empty list is considered to be sorted.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd