I tried your code and it works.
I managed to figure it out yesterday with the following code:
import java.util.Scanner;
public class Check
{
Type: Posts; User: SilentPirate
I tried your code and it works.
I managed to figure it out yesterday with the following code:
import java.util.Scanner;
public class Check
{
Oke, I figured it out with the help of your link.
My problem was the 0 in %0.1f. It should look like this: %.1f
Thank you!
I know what it means...the format specifier "%0.1f" doesnt work, my question is how could I interprate this into java to show a single decimal place.
I decided to use printf() since I'm more familiar with it, but it doesnt seem to work the same:
In C this would normally work:
printf("The area of the triangle is %0.1f",...
I managed to fix it in the main():
From:
System.out.println("The area of the triangle is "+ areaTri);
To:
EDITED..
Oke, I managed to sort everything out, except, it does not calculate the area in area() method:
public static double area(double side1, double side2, double side3, double areaTri)...
Sorry about that. It doesn't give me any errors, just the wrong output.
When running the code:
Enter Numbers: 5 7 9[ENTER]
Output: Enter Numbers: Enter Numbers: Enter Numbers
Thanks
Hello, i've just started using java, but I don't seem to be getting the following output correct:
import java.util.Scanner;
public class MinNum
{
public static void main(String[] args)...