Question: public class Project 1 { public static void main ( String [ ] args ) { / / first problem double problem 1 = 4
public class Project
public static void mainString args
first problem
double problem ;
second problem
double problem ;
print the results
System.out.printlnResult of the first problem: problem;
System.out.printlnResult of the second problem: problem;
The difference between the two outputs is that in the first problem
it will give the output in decimal where the second problem the output
will be rounded up the decimal to its nearest integer value.
The first problem is the better option because by using the floating
point division we get the most accurate and precise result where as
the second output gives a round up result.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
