Search:

Type: Posts; User: SilentPirate

Search: Search took 0.10 seconds.

  1. Replies
    6
    Views
    2,127

    Re: New To Java (Help with arrays)

    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
    {
  2. Re: Area of a triangle (using 2 extra methods) error help

    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!
  3. Re: Area of a triangle (using 2 extra methods) error help

    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.
  4. Re: Area of a triangle (using 2 extra methods) error help

    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",...
  5. Re: Area of a triangle (using 2 extra methods) error help

    I managed to fix it in the main():

    From:



    System.out.println("The area of the triangle is "+ areaTri);


    To:
  6. Area of a triangle (using 2 extra methods) error help

    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)...
  7. Replies
    6
    Views
    2,127

    Re: New To Java (Help with arrays)

    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
  8. Replies
    6
    Views
    2,127

    New To Java (Help with arrays)

    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)...
Results 1 to 8 of 8