TRENDING NEWS

POPULAR NEWS

First To Answer Gets Best Answer Beginner

First Best Answer Gets Best Answer: Beginner's Java Coding Easy Math Newton Raphson?

import java.io.Console;
import java.util.Scanner;

public class TestNewton {

public static void main(String[] args) {

Scanner reader = new Scanner(System.in);
System.out.println("Enter a number you would like to find the square root of");
//get user input for a
int a = reader.nextInt();
NewtonRaphson nr = new NewtonRaphson(5.0, a);

nr.findSqRtA();



}
}


import java.text.NumberFormat;
import java.text.DecimalFormat;

public class NewtonRaphson {

static final double DIFFERENCE = 0.00005;
double n;
double x;
double derivative;
double function;
double xold;
double xnew;
int i;

public NewtonRaphson(double n2, int x2)

{
n=n2;
x=x2;
function = Math.pow(n, 2)-x;
derivative = 2*n;
xnew=n-function/derivative;
xold=0;
}

boolean positive()

{
return (n >= 0);
}

public double findXNew(double xold2)

{
function = Math.pow(xold2, 2)-x;
derivative = 2*xold2;

return xold2-function/derivative;
}

public void findSqRtA()

{



i=0;
while(Math.abs(xnew-xold)> DIFFERENCE)
{
xold=xnew;
xnew=findXNew(xold);

i++;
System.out.println(this);

}
System.out.println("\nIteration completed, difference is less than 0.00005");

}

public String toString()

{
NumberFormat nf = NumberFormat.getInstance(); DecimalFormat df = (DecimalFormat)nf;
df.applyPattern("0.00000000");
return "The approximate value of the square root of "+x+" is " + xnew + "\n" +

"The number of iterations is " + i;

}
}

What is the best type of bicycle for adult beginners?

WHERE & HOW do you plan on riding? Answer that question first. Then get your butt over to a REAL bicycle shop. Why? Because you can TEST RIDE them before the sale. Plus friendly & knowledgeable sales help. Try that at Kmart, Target or Wally World, where all you'll find is junk bikes & clueless, minimum wage "associates".

Basically, this SAME QUESTION was asked 2 weeks ago. Same answer. Here's a link to that question & answer...
https://answers.yahoo.com/question/index...

Best blunt wrap for beginners please answer?

What's the least harsh blunt for me? I recently started smoking. Which blunt would be the best for me for the first time? Backwoods, swisher sweets, dutch etc. And when I inhale and I cough like crazy do I keep going or save the blunt for later? I wanna get used to it so I can get high

PHYSICS!? BEST ANSWER?

A resistor, capacitor, and switch are all connected in series to an ideal battery of constant terminal voltage. Initially, the switch is open. What is the voltage across the resistor and the capacitor at the moment the switch is closed?

a) The voltage across both the resistor and the capacitor is equal to one-half of the terminal voltage of the battery.
b) The voltage across the resistor is zero, and the voltage across the capacitor is equal to the terminal voltage of the battery.
c) The voltage across both the resistor and the capacitor is equal to the terminal voltage of the battery.
d) The voltage across the resistor is equal to the terminal voltage of the battery, and the voltage across the capacitor is zero.
e) The voltage across both the resistor and the capacitor is zero

Which psychology books should I read first as a beginner ?

Holy crap that's a lot of books. Ok. First of all, welcome to the course of study. I got my degree in general psych. So, my advice: I'd stay away from the research methods books for now. You'll get to that after a couple of years.

I've always found the abnormal psych interesting and easy to follow. Cognitive psych is pretty dense. I don't know how good you are at science, but the biology stuff can get pretty dense too.

So, to start you off, (keeping in mind I have no idea what your specific program requires), most schools start you off with the intro psych material. All of the authors will basically say the same thing. Freud did this, said that. Jung agreed and disagreed with... etc. It doesn't look like you have any intro psych books. Just as well. That will come easily enough.

I'd start off with the abnormal psych stuff. You'll hear a lot about that in your intros, and not so much the biological stuff or the research methods. Start with one of the things that interest you the most. I'd go with Child psychology, and human development. You'll hear a lot of that stuff over the next year or so. Also, depression and schizophrenia. You'll touch a lot on those subjects as well.

Hope this was helpful. Good luck!

Help me solve this equation in a simple way? BEST ANSWER GETS POINTS?

5- 5x +5x > 12 -4x +5x (adding 5x on both sides)

5 > 12 + x

5 - 12 > 12 +x - 12 (subtracting 12 on both sides)

-7> x

thus, x < -7

TRENDING NEWS