W-ing167

Friday, February 27, 2009

CS1101C

I attempted my CS midterm paper today. BRAVO. 7/26!!! WELL DONE. How do u expect me to think like a compiler. I'm human...not computer.

#include
int main ()
{
int temptation=1, hraday=24, freehr, sleepinghr=7, eatinghr=2, slackinghr=4;
int studyhr, youtubinghr;
float studyslackratio;
freehr = hraday-sleepinghr-eatinghr;
printf("Number of hours per day: %d hours\n", hraday);
printf("Number of hours spend on sleeping: %d hours\n", sleepinghr);
printf("Number of hours spend on eating: %d hours\n", eatinghr);
printf("Amount of free time: %d hours\n", freehr);
if (temptation)
{
for (youtubinghr = 0; youtubinghr < 8; ++youtubinghr)
{
slackinghr ++;
}
}
studyhr = freehr - slackinghr;
printf("Number of hours spend on studying: %d hour\n", studyhr);
printf("Number of hours spend on slacking: %d hour\n", slackinghr);
printf("Number of hours spend on youtube: %d hours\n", youtubinghr);
studyslackratio = (float)studyhr / slackinghr;
printf("Ratio of the time spent on studies over slacking: %.3f\n", studyslackratio);
if (studyslackratio > 1)
{
printf("You have worked hard for your midterm. Can expect good result.\n");
}
else
{
if (youtubinghr > studyhr)
{
printf("OMG, you slack too much!!! Especially on YOUTUBE!!! Midterm...Doom...\n");
}
else
{
printf("OMG, you slack too much!!! Midterm...Doom...\n");
}
}
return 0;
}

This code works in C programming!!! ^^ But sad to say, it also works in the reality...(this reflects my daily life...TOTALLY)

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home