Does anyone have a C program that solves the Cigarette Smoker's problem? I would like to see how the problem is worked out. If anyone would be able to post the coding, would be much appreciated. Thanks.
Printable View
Does anyone have a C program that solves the Cigarette Smoker's problem? I would like to see how the problem is worked out. If anyone would be able to post the coding, would be much appreciated. Thanks.
Yeah, right
Straight from the board to your tutor no doubt
Post your code so we can give you some hints!
Maybe
Quote:
Does anyone have a C program that solves the Cigarette Smoker's problem?
Are you kidding? The problem is that these smokers don't realize how bad the habit really is! Surely you know that these things take determination and self-control? I'm afraid no program can do this for you. It is similar to students that refuse to do their own homework - addicted to the idea that someone might write their code for them - denying the truth that others cannot help those that cannot help themselves....
Nice one Sebastiani :)
thanks :p
Well........... I was bored... :oCode:#include <life.h>
#include <stdinhale.h>
#include <cancer.h>
#include <badsmells.h>
int main(void)
{
struct life mylife;
CreateNewLife(&mylife); // And we all know what that function does ;-))
while (mylife.Alive)
{
LiveAYear(&mylife);
if (mylife.age > 13 && mylife.peer_pressure > 50)
mylife.smoker = TRUE;
if (mylife.smoker)
SmokeLots(&mylife);
if (mylife.Cancer == TRUE)
mylife.Alive = FALSE;
if (RandomDeath(&mylife))
mylife.Alive = FALSE;
}
if (mylife.smoker)
return (EXIT_FAILURE);
else
return (EXIT_SUCCESS);
}
>>#include <stdinhale.h>
HAHAHA! That's my favorite part! Good play on words, Hammer.