Re: CAN YOU FIGURE THIS OUT?
by jimbojones (Friar) on Mar 29, 2005 at 23:25 UTC
|
| [reply] |
Re: CAN YOU FIGURE THIS OUT?
by Roy Johnson (Monsignor) on Mar 30, 2005 at 01:27 UTC
|
Why is your header supposed to misspell "Celsius"?
I congratulate you on having your inaugural post rocket to the top of the worst nodes of the day...and the week!
Update: And month! (Except for some bug that's keeping it from showing your actual Rep there.) That's a trifecta!
Update April 6: You have now topped the worst nodes of the year. Some of us are born to greatness, it seems.
Caution: Contents may have been coded under pressure.
| [reply] |
|
They're dense enough to repost their homework assignment verbatim and you think they're going to be cognizant enough to spell correctly?
Of course maybe it's because of the teacher's poor spelling they think they can get away with cribbing a solution off the 'net . . .
| [reply] |
Re: CAN YOU FIGURE THIS OUT?
by jdporter (Paladin) on Mar 30, 2005 at 00:24 UTC
|
I got all the way through college without cheating. Can you?
| [reply] |
Re: CAN YOU FIGURE THIS OUT?
by !1 (Hermit) on Mar 29, 2005 at 23:36 UTC
|
| [reply] |
Re: CAN YOU FIGURE THIS OUT?
by Errto (Vicar) on Mar 30, 2005 at 03:29 UTC
|
This isn't even that well-written a question. What the hell does "floating point or decimal number" mean? What if the difference between the two endpoints is not an integer multiple of the increment?
By the way, I don't actually recommend deleting the OP here (yes, I voted for it but I changed my mind). It's nice to have a blatant, unambiguous homework example to point to for reference, especially since we've had some disputed incidents of homework SOPWs recently.
| [reply] |
|
I know I'm new here, but I could I propose that we give it two weeks (just to make sure we allow for the possibility of spring break, and we assume that something this simplistic wouldn't be a multi-week assignment), and then see who can come up with the most creative solution, that meets all of the requirements, and yet would still fail spectacularly under realistic conditions. (and you've already suggested at least one failure scenario, but there's just sooo many more.)
| [reply] |
|
I choice for "meets all of the requirements, and yet would still fail spectacularly" would be falling into an infinite loop when the increment is 0.
| [reply] |
|
Sounds like a decent idea to me. I'll try to remember to come back and update my note.
| [reply] |
Re: CAN YOU FIGURE THIS OUT?
by ikegami (Patriarch) on Mar 29, 2005 at 23:38 UTC
|
Indeed. Can you? What's the problem? | [reply] |
Re: CAN YOU FIGURE THIS OUT?
by Cody Pendant (Prior) on Mar 30, 2005 at 01:56 UTC
|
| [reply] |
|
| [reply] |
|
But then there's another update that possibly reverses the whole thing. Plus, it wasn't April Fool's day. And the college DOES have that course.
($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss')
=~y~b-v~a-z~s; print
| [reply] |
|
Re: CAN YOU FIGURE THIS OUT?
by inman (Curate) on Mar 30, 2005 at 12:14 UTC
|
Why don't you forget Fahrenheit and Celsius and use the Kelvin scale instead? After all it does place absolute zero at zero and work upwards. You can use a conversion function to change the input to Kelvin and test for the start temp being greater than zero and less than the end temp.
Using Cody Pendants post as inspiration. Implementing the Kelvin / Fahrenheit/Celsius conversion functions and better presentation is left as an exercise for the reader...
#! /usr/bin/perl
use strict;
use warnings;
kelvin (@ARGV);
sub kelvin
{
my $start = $_[0];
my $end = $_[1];
my $inc = $_[2];
if (($start > 0) and ($start < $end))
{
print "Fahrenheit Celcius\n";
my $loop = $start;
while ($loop < $end)
{
print $loop, "\n";
$loop = $loop + $inc;
}
}
else
{
die ("You entered bad arguments dumbass!");
}
}
Or just mess with his head...
k2 (@ARGV);
sub k2 {s{}{$_[0]-$_[2]}e;while(
$_[0]>=0&&$_[0]<$_[1]&&s>([\d.]+)>
$1<$_[1]?$1+$_[2]:''>e){print+qq
+$_\n+};!$_||die ("Bad Params!")}
| [reply] [d/l] [select] |
Re: CAN YOU FIGURE THIS OUT?
by xorl (Deacon) on Mar 30, 2005 at 13:45 UTC
|
| [reply] |
|
This guy didn't ask for help.
He asked if we could figure out the posted problem. That's a distinction, yes, but an important one. The impression I got reading the OP was that the poster thought that "if I throw this up on this Perl site I just found, maybe someone will bite and give me the answer."
Now, if the OP had said ... "I'm taking an intro programming class, the teacher is no good, here's my problem, and here's what I've tried so far ... " Even if what he'd tried was "here's the formula for converting F to C".
I've gotten great responses here to problems that were killing me, and I thank the Monks for that. Asking for help is not the problem. Asking for the Monks to invest effort when the OP hasn't ... that is a problem.
- jim
| [reply] |
|
There's nothing wrong with asking about homework-related issues on Perl Monks. There's nothing wrong with asking for help related to a project you're getting paid for (I've done it). There is something wrong with posting to Perl Monks expecting people to do your work for you. That's what we have here. Big difference.
| [reply] |
|
if he's got to ask he's clearly got a teacher who can't teach.
If he's got to put the whole freaking question verbatim and doesn't show any attempts at research/solving it himself, then he's probably just plain lazy.
++ for the tips anyay.
| [reply] |
|
The original post does not say anything about the teacher. Being picky, we can not even know the student's character from it. Is he lazy? Maybe he/she is so confused by the problem not knowing even what precisely to ask (the teacher) to get more clarity?
Anyway, there have been some very good answers with hints and links, like the step-by-step post. After all, it's a valuable answer if the OP does want to take some effort, no matter if he/she has been too lazy, not intelligent enough, or a bad teacher's student.
By the way, the node's title is really silly.
| [reply] |
|
|
| [reply] |
Re: CAN YOU FIGURE THIS OUT?
by Popcorn Dave (Abbot) on Mar 30, 2005 at 04:42 UTC
|
| [reply] |