Results 1 to 5 of 5

Thread: Help

  1. #1
    mr.othman is offline Member
    Join Date
    Nov 2010
    Posts
    4
    Rep Power
    0

    Smile Help

    I Ask any members can help me to write this program in java

    details:

    1- reading text file
    2- gives line number
    3- the program give you all the variables ( int or double or char or string) found in this line number and give in any method they are found.

    example

    text

    1- public class Test{
    2- public int Summation(){
    3- int x=1; int y=3; int sum;
    4- sum=x+y;
    5- }
    6- System.out.println(sum);
    7- public static void main(String[] args) {
    8- summation();
    9- }
    10- }

    now you give the program line number= 3
    the program give you
    int x summation()
    int y summation ()
    int sum summation ()
    Last edited by Fubarable; 11-20-2010 at 01:12 PM. Reason: Moderator edit: email deleted

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,560
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by mr.othman View Post
    I Ask any members can help me to write this program in java

    details:

    1- reading text file
    2- gives line number
    3- the program give you all the variables ( int or double or char or string) found in this line number and give in any method they are found.

    example

    text

    1- public class Test{
    2- public int Summation(){
    3- int x=1; int y=3; int sum;
    4- sum=x+y;
    5- }
    6- System.out.println(sum);
    7- public static void main(String[] args) {
    8- summation();
    9- }
    10- }

    now you give the program line number= 3
    the program give you
    int x summation()
    int y summation ()
    int sum summation ()

    please any one can help me please my e-mail is mr.othman@yahoo.com
    You want a Java source code parser; if you click the home (index.html) page of the API documentation you'll see a big block listing all of the SE technologies; the second block on the second row reads 'javac'; click it and you'll see the complete API documentation for the javac compiler. Start reading it and implement your own processor after the text has been parsed.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    mr.othman is offline Member
    Join Date
    Nov 2010
    Posts
    4
    Rep Power
    0

    Default

    mr JosAH i need a java program to do this.

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,560
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by mr.othman View Post
    mr JosAH i need a java program to do this.
    As long as you haven't read javac's API documentation you won't understand any program that uses it; after you've read the API documentation it'll be easy to write such a program yourself and we'll be glad to help you out if you're stuck.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

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

    Default

    email deleted in initial post. Poster: please don't post your email address as all communications in this forum should be public. Also, if you need a Java program to do something, then by all means, please feel free to write this, and if you need help with your program, then please show us your code and ask your question and we'll be more than happy to help you, but please don't demand one be given you as that's not what this forum is for.

Posting Permissions

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