please help me to display double type output. I know it round off, but i don't know now to fix it. Thanks.

import java.util.*;import java.io.*;import java.text.DecimalFormat;import java.text.NumberFormat;// calculate value of x, y, zclass Calculation{ double a, b, c, d; double t; public double findPoint () { if( a == 0 && b ==0 ) //return z { t = -d/c; NumberFormat formatter = new DecimalFormat("##"); String s = formatter.format(t); System.out.print("z is " + s + "\n"); return(t); } else if( a == 0 && c ==0 ) //return y { t = -d/b; NumberFormat formatter = new DecimalFormat("##"); String s = formatter.format(t); System.out.print("y is " + s + "\n"); return(t); } else //if( b == 0 && c ==0 ) // return x { t= -d/a; NumberFormat formatter = new DecimalFormat("##"); String s = formatter.format(t); System.out.print("x is " + s + "\n"); return(t); } } void assignValue (double first, double second, double third, double fourth) { a = first; b = second; c = third; d = fourth; }}class Demo{ public static void main ( String[] args) { double a, b, c, d; double x, y, z; Calculation item1 = new Calculation(); // supposed plane equation is 0.3x + 0.5y + 0.7z + 0.9 = 0 // a b c d item1.assignValue(0.3,0.0,0.0,0.9); // get x => y = z = 0 x = item1.findPoint(); //x = -3 item1.assignValue(0.0,0.5,0.0,0.9); // get y => x = z = 0 y = item1.findPoint(); // y= -1.8 item1.assignValue(0.0,0.0,0.7,0.9); // get z => x = y = 0 z = item1.findPoint(); // z= -1.2858 }}

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application.
For the purposes of this article, I will be u…

Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…

Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…