Question: 1. Convert the following C++ code to equivalent Java. (For Java, Math.abs (double x) returns the absolute value of x) double poly(double x) {

1. Convert the following C++ code to equivalent Java. (For Java, Math.abs 

1. Convert the following C++ code to equivalent Java. (For Java, Math.abs (double x) returns the absolute value of x) double poly(double x) { return 3* x* x + 2 * x - 3; } double dpoly(double x) { return 6* x + 2; } double findZero (double start) { if (abs (poly (start)) < .00001) return start; double next = start poly (start) / dpoly (start); return findZero (next); } int main() { double first = 0.0; cout < < "One zero of 3x^2 + 2x - 3 is approximately: " < < findZero (first) < < endl; return 0;

Step by Step Solution

3.45 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here is the equivalent Java code for the given C code java pu... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!