Closed Thread
Results 1 to 9 of 9

Thread: help us resolve the perl program problem

  1. #1
    gopalsd is offline Newbie
    Join Date
    Feb 2008
    Posts
    2
    Rep Power
    0

    help us resolve the perl program problem

    Dear Friends,

    Anyone pls reolve mentioned problem.............
    Code:
    #!/usr/bin/perl
    @data=N;
    $sum=0;
    print"enter the required No. of numbers to be inputed : f";
    $N=<STDIN>;
    print"enter the number";
    for($i=0;$i<$N;$i+=1)
    {$data[$i]=<STDIN>;
    # chomp $data[$i];
    $sum=$sum + $data[$i];}
    
    # for($j=0;$j=$data[$i];$j+=1)
    print"the entered numbers are",@data,"\n";
    print"sum of the number:",$sum,"\n";
    print"Average value the numbers:",$sum/$N,"\n";
    
    @sorting=sort(@data);
    $lengt=@data;
    for ($j=0;$j < $lengt;$j++)
    {# print $sorting[$j],"\n";
    }
    
    $X= (@sorting[($j-1)/2]+ @sorting[$j/2])/2;
    print"the median is :$X";
    QUES: the median is the middle value if the numbers have been sorted in
    ascending order (for even numbers of values it is your choice to pick
    the first or second of the middle numbers.
    Last edited by v0id; 02-12-2008 at 05:01 AM.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    v0id is offline Retired
    Join Date
    Apr 2007
    Posts
    2,937
    Blog Entries
    3
    Rep Power
    42
    Remember to use code-tags next time you're posting some code.

  4. #3
    fahlyn's Avatar
    fahlyn is offline Learning Programmer
    Join Date
    Nov 2007
    Posts
    35
    Rep Power
    0
    so what's your problem?
    Visit My Google Group Here: Web Development Innovation

  5. #4
    gopalsd is offline Newbie
    Join Date
    Feb 2008
    Posts
    2
    Rep Power
    0

    can u resolve this problem

    Quote Originally Posted by v0id View Post
    Remember to use code-tags next time you're posting some code.
    Hi,
    next time i will remember the code-tags ,can u resolve this problem for me

  6. #5
    fahlyn's Avatar
    fahlyn is offline Learning Programmer
    Join Date
    Nov 2007
    Posts
    35
    Rep Power
    0
    I'd still like to know what your question is. You posted your code, along with a comment, but never asked a question.
    Visit My Google Group Here: Web Development Innovation

  7. #6
    KevinADC is offline Programmer
    Join Date
    Jan 2007
    Posts
    125
    Rep Power
    0
    The question is: will somone do my school/class assignment for me?

  8. #7
    fahlyn's Avatar
    fahlyn is offline Learning Programmer
    Join Date
    Nov 2007
    Posts
    35
    Rep Power
    0
    Quote Originally Posted by KevinADC View Post
    The question is: will somone do my school/class assignment for me?
    that's what it sounds like to me too.
    Visit My Google Group Here: Web Development Innovation

  9. #8
    KevinADC is offline Programmer
    Join Date
    Jan 2007
    Posts
    125
    Rep Power
    0
    Judging by his code he is not going to get a good grade/mark. Hopefully that is not what they are teaching in school/class these days, that be some nasty looking perl code.

  10. #9
    fahlyn's Avatar
    fahlyn is offline Learning Programmer
    Join Date
    Nov 2007
    Posts
    35
    Rep Power
    0
    lol, I agree....I really like the misspelling of the word "length".
    Visit My Google Group Here: Web Development Innovation

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 10-18-2011, 02:33 PM
  2. problem in downloading a file using perl
    By Rinku27 in forum Perl
    Replies: 1
    Last Post: 07-18-2010, 09:23 PM
  3. Please I need help to resolve this question
    By PINK in forum C and C++
    Replies: 17
    Last Post: 03-23-2010, 06:54 AM
  4. cannot resolve symbol
    By dvdtomkins in forum Java Help
    Replies: 12
    Last Post: 08-06-2008, 02:28 AM

Tags for this Thread

Bookmarks

Posting Permissions

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