Page 1 of 2 12 LastLast
Results 1 to 20 of 21
  1. #1
    o0oNorao0o's Avatar
    o0oNorao0o is offline Member
    Join Date
    Oct 2009
    Posts
    51
    Rep Power
    0

    Default I have a simple problem

    I have a problem .. when I wrote the input ,the output didn't show :(
    the input
    public class program1
    {
    public static void main (String [] args)
    {
    double raduis,Area of circle;
    radius=5;
    Area of circle= 3.14*radius*2;
    System.out.println("value of radius is " +radius);
    System.out.println("value of Area of circle is " +Area of circle);

    }
    }

    the message
    ; expected in line 5 , 7 and 9
    ) expected in line 9

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Area of circle is not a valid variable name.
    Revise the valid identifiers chapter in your text book.

  3. #3
    o0oNorao0o's Avatar
    o0oNorao0o is offline Member
    Join Date
    Oct 2009
    Posts
    51
    Rep Power
    0

    Default

    Thank you

    it is edited

    when I check it again it says (cannot find symbol available radius) :(

  4. #4
    o0oNorao0o's Avatar
    o0oNorao0o is offline Member
    Join Date
    Oct 2009
    Posts
    51
    Rep Power
    0

    Default

    +

    I can't see the output when I press the execute button

  5. #5
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    You need to compile successfully first before you can execute to see the output.
    You currently have compilation errors so you can't run it yet.
    Also read the error messages, they are giving you a clue as to what the problem is.
    You never declared radius (what is its type for example) so the compiler says it can't find it because it is never declared.

  6. #6
    o0oNorao0o's Avatar
    o0oNorao0o is offline Member
    Join Date
    Oct 2009
    Posts
    51
    Rep Power
    0

    Default

    You need to compile successfully first before you can execute to see the output.
    You currently have compilation errors so you can't run it yet.
    Yeah I know
    I tried simple one which is
    int a,b;
    a=3;
    b=5;
    System.out.println("a is " +a);
    System.out.println("b is " +b);
    the compiler says the process completed , then I run it and it says again process completed:( (there's no output)
    You never declared radius (what is its type for example) so the compiler says it can't find it because it is never declared
    .
    How ?
    I declared
    double radius, areaOFcircle;
    radius=5;
    areaOFcircle=3.14*radius*2;

  7. #7
    o0oNorao0o's Avatar
    o0oNorao0o is offline Member
    Join Date
    Oct 2009
    Posts
    51
    Rep Power
    0

    Default

    Thank you a lot for spending your time to help me :)

  8. #8
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    raduis != radius

  9. #9
    o0oNorao0o's Avatar
    o0oNorao0o is offline Member
    Join Date
    Oct 2009
    Posts
    51
    Rep Power
    0

    Default

    finally (process completed) :)
    the problem of running the program isn't finished :(

    look at the picture (the output doesn't show) :(
    Attached Thumbnails Attached Thumbnails I have a simple problem-pro.jpg  

  10. #10
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    You compiled it successfully, now you need to run it to see the results.

  11. #11
    o0oNorao0o's Avatar
    o0oNorao0o is offline Member
    Join Date
    Oct 2009
    Posts
    51
    Rep Power
    0

    Default

    Thank you ..
    I told you I can't see the output when I press the execute button :(

    What should I do in this case to display the output? :(

  12. #12
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    You are having problems understanding your IDE then.
    If you manually compile the program on the command line using javac and run it manually using java you will see the output. The console you are displaying in your snapshot is for build output not execute output.

  13. #13
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    843
    Rep Power
    6

    Default

    Have u checked the execution path?
    Ramya:cool:

  14. #14
    o0oNorao0o's Avatar
    o0oNorao0o is offline Member
    Join Date
    Oct 2009
    Posts
    51
    Rep Power
    0

    Default

    What does IDE stand on?! sorry I only have 1 week (experience with Java)

    If you manually compile the program on the command line using javac and run it manually using java you will see the output
    I always do this step in my PC in the lab (college) but here at home it doesn't work it only displays this statement (progress completed)..

  15. #15
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    The tool you are using (google can help with some of those terms).
    Try compiling and running on the command line. Then read about how to use JCreator to compile and run Java programs if you still want to use it.

  16. #16
    o0oNorao0o's Avatar
    o0oNorao0o is offline Member
    Join Date
    Oct 2009
    Posts
    51
    Rep Power
    0

    Default

    RamyaSivakanth
    Have u checked the execution path?
    No . From where? sorry I only have 2 weeks experience with this program

    r035198x
    I'll try to read more about it :)
    Thank you a lot

  17. #17
    nassir is offline Member
    Join Date
    Dec 2009
    Posts
    33
    Rep Power
    0

    Default

    this is solution

    public class program1
    {
    public static void main (String [] args)
    {
    double raduis,AreaOfcircle;
    raduis=5;
    AreaOfcircle= 3.14*raduis*2;
    System.out.println("value of radius is " +raduis);
    System.out.println("value of Area of circle is " +AreaOfcircle);

    }
    }

    can take this copy and put in Jcreator and run

  18. #18
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by nassir View Post
    this is solution...
    1) Please use code tags when posting code (see my signature below), and
    2) You may wish to double check your math here. This is not the equation for the area of a circle:
    Java Code:
    AreaOfcircle= 3.14*raduis*2;
    :)

  19. #19
    nassir is offline Member
    Join Date
    Dec 2009
    Posts
    33
    Rep Power
    0

    Default

    Java Code:
    public class program1
    {
    public static void main (String [] args)
    {
    double raduis,AreaOfcircle;
    raduis=5;
    AreaOfcircle= 3.14*raduis*2;
    System.out.println("value of radius is " +raduis);
    System.out.println("value of Area of circle is " +AreaOfcircle);
    
    }
    }

  20. #20
    o0oNorao0o's Avatar
    o0oNorao0o is offline Member
    Join Date
    Oct 2009
    Posts
    51
    Rep Power
    0

Page 1 of 2 12 LastLast

Similar Threads

  1. a simple conversion problem
    By sweetjava in forum New To Java
    Replies: 3
    Last Post: 07-20-2009, 07:34 AM
  2. simple GUI problem
    By McChill in forum New To Java
    Replies: 4
    Last Post: 04-03-2009, 04:13 AM
  3. Simple IO problem
    By aamp in forum New To Java
    Replies: 2
    Last Post: 12-01-2008, 03:27 PM
  4. Simple JFrame Problem
    By DC1 in forum New To Java
    Replies: 4
    Last Post: 06-06-2008, 08:09 AM
  5. My Simple Refresh Problem
    By pmcastillo in forum New To Java
    Replies: 0
    Last Post: 03-26-2008, 08:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •