I\'ve been working on this assignment and I\'ve been having some trouble. Thats
ID: 3672096 • Letter: I
Question
I've been working on this assignment and I've been having some trouble.
Thats what i have so far
I've been having problem returning the result and I''ve got an error for the second method
Thats my Irrational Class:
Will give Positive like.
Please Help.
Thanks in advance
2. Implementing Java Interface (30 marks) Given the following Java interface. l public interface Irrationalf 2 public double computePI(int precision); 3 public double computeEulerConstant (int precision); public double computeSquareRootofTwo (int precision); Add IrrationalApprorimation Java class that implements the interface Irrational? (a) To implement public double computePI(int precision) abstract method use Leibniz (10 marks) formula for II (use equation 3 on page 6) 2 i+1 (b) To implement public double computeEulerConstant (int precision) abstract method (10 marks) use the formula for e given by equation 4 on page 6. 6 12 Factorial of non-negative integer N is denoted by N! is given by the the following formulae (see equations 5 6) N! 1 × 2 × 3 × 4 × … × (N-1) × N (c) To implement public double computeSquareRootofTwo (int precision) abstract method use the Babylonian method for approzimating V2 (see equation on page (10 marks) 6) Start with an initial approximation Xo Compute a new approximation x, using Xi-(X)+ Xo Repeat step until you get an approximation with the specified precisionExplanation / Answer
The error is because you put semi-colon ';' at the end of function definition, which is invalid for a function definition. remove that semi-colon
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.