June 26th, 2013, 03:15 PM
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.
June 26th, 2013, 05:19 PM
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.
June 26th, 2013, 05:32 PM
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.
Originally Posted by Laurent_R
June 26th, 2013, 06:19 PM
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.
Originally Posted by stamp1982
Comments on this post
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
June 27th, 2013, 12:47 PM
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.