Thread: Help for my son

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    5
    Rep Power
    0

    Help for my son


    I am a programmer and i need help for my son in Perl. He has been asked to do this so I want to see how to go about it and use it as a tutorial. I have some knowledge in Perl.
    This is the question: Write a Perl program (call it A.pl) that takes user entered lines from the keyboard and stores them in an array. When the user enters "quit", the program prints out all the lines sorted (ASCII order – i.e. a line starting with an “Ab…” would print out before one starting with “Ac…”). Now modify the program (call it B.pl) so it tells you how many lines have been entered, and then prints out only lines 2, 3, and 4.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2012
    Location
    Paris area, France
    Posts
    842
    Rep Power
    496
    1. Forums are usually not for delivering programs to students having homework.

    2. If you know Perl, you should be able to help your son, the task is really easy.

    3. Sorry, I won't give any spoiler, even though it would take me 2 minutes. You should put you son to work.

  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    5
    Rep Power
    0

    Help


    Hi

    I am only a beginner and I am not looking for the answer to spoonfeed him or make his work easy. If you can explain it to me I do the same for him. He has been working on it for a week now. I don't want him to get it easy that is why I joined the forum and not him. Please I really do need some assistance here.

    Thanks!

    Originally Posted by Laurent_R
    1. Forums are usually not for delivering programs to students having homework.

    2. If you know Perl, you should be able to help your son, the task is really easy.

    3. Sorry, I won't give any spoiler, even though it would take me 2 minutes. You should put you son to work.

  6. #4
  7. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,643
    Rep Power
    4248
    Originally Posted by stamp1982
    I am a programmer and i need help for my son in Perl. He has been asked to do this so I want to see how to go about it and use it as a tutorial. I have some knowledge in Perl.
    This is the question: Write a Perl program (call it A.pl) that takes user entered lines from the keyboard and stores them in an array. When the user enters "quit", the program prints out all the lines sorted (ASCII order – i.e. a line starting with an “Ab…” would print out before one starting with “Ac…”). Now modify the program (call it B.pl) so it tells you how many lines have been entered, and then prints out only lines 2, 3, and 4.
    Well, if you're a programmer as you claim, how about showing how you would solve it in *YOUR* programming languages of choice. That'll prove that you're just not some dude hoping for someone to solve their homework for them. This forum is always glad to help fellow programmers, if they show some effort in solving problems themselves.

    Comments on this post

    • richpri agrees : Well said.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2012
    Location
    Paris area, France
    Posts
    842
    Rep Power
    496
    When I picked up Perl some 11 years ago, I took a good tutorial on the Internet. After having worked for 3 or 4 hours on this tutorial, I was certainly able to do the task you've described (probably not the best Perl practices, but something working and doing what was needed), except possibly the sorting.

    I really suggest that you or your son give a real try.

IMN logo majestic logo threadwatch logo seochat tools logo