i write the best comments/output ever.i replaced a shit ton of the code with "(some code)" so no one can cheat/copy this shit. you know how csc is about that.//----------------------------------------------------------------------// Program Name: Zeller's Algorithm// Assignment: Homework 4// Date: 21/10/07// // Programmer: Evan Kinney Student ID: 000-795-299// Course: CSC 114 - 601 Lecturer: Dulberg//// // Program Description: Determines the day of the week for a specific date.// // Input: The month, day of the month, and the year.// // Output: The day of the week.// // Assumptions/Limitations: The user will enter only integers.//----------------------------------------------------------------------//----------------------------------------------------------------------//// I can has iostream.h?////----------------------------------------------------------------------#include <iostream>//----------------------------------------------------------------------//// Let's get some functions up in here.////----------------------------------------------------------------------int getDay();// Effect: // Prompt user for the date, return the date entered.int getMonth();// Effect: // Prompt user for the date, return the month entered.int getYear();// Effect: // Prompt user for the date, return the year entered.int zeller(int theDay, int theMonth, int theYear);// Input:// theMonth, theDay and theYear are integer values of the date that// you wish to get the day of week for// Output:// Returns the day of the week that cooresponds to the input (0=Sunday ... 6=Saturday)// Effect: // NONE- no output to the screen!!!!void doStuff();// Effect:// Does all the work. Used to clean up the code.void outDay(int theDayOfWeek);// Input:// theDayOfWeek, from 0..6. // Output: // The day of the week in chars.bool goAgain();// Effect:// Asks if user wants to enter another number.//-----------------------------------------------------------------//// We're starting the main program now, yo.////-----------------------------------------------------------------int main() { doStuff(); while (goAgain()) { // do we want to doStuff again? hmmm? doStuff(); } // *wipes brow* yay, we are done! return 0;}//-----------------------------------------------------------------void doStuff() { outDay(zeller(getDay(),getMonth(),getYear()));}//-----------------------------------------------------------------int getDay() { (some code) } else { cout << "\n\nDude - seriously - what are you doing? Enter a day between 1 and 31.\n"; doItAgain = 1; } (some code)}//-----------------------------------------------------------------int getMonth() { (some code) } else { cout << "\n\nNice try - why don't we try entering a month that exists?\n\n"; doItAgain = 1; } (some code)}//-----------------------------------------------------------------int getYear() { (some code) } else { cout << "\n\nHow about we enter a more recent year.. say, greater than 1582?\n\n"; doItAgain = 1; } (some code)}//-----------------------------------------------------------------int zeller(int theDay, int theMonth, int theYear) { (some code) } else { // something else? mkay. (some code)}//-----------------------------------------------------------------void outDay(int theDayOfWeek) { (some code) (some code) (theDayOfWeek) { // okay, so what day are we dealing with here? (some code) }}//-----------------------------------------------------------------bool goAgain() { (some code) } else { cout << "\n\nOkay, you fail at life. I'm going to assume that you wanted to enter another number\nsince you can't seem to respond correctly."; return true; } // we should never get here. return true;}//----------------------------------------------------------------//// Ay yo, we done. Crank dat soulja boy.////----------------------------------------------------------------]
10/22/2007 1:35:57 AM
for the most part, i like you evan.but did you really just joke up your c++ hw and then post said jokes?
10/22/2007 1:38:37 AM
*sigh* i thought it was funny oh well.[failboat]
10/22/2007 1:40:46 AM
i'm not saying it's not funny, but something like that is only funny when done subtly.
10/22/2007 1:42:22 AM
well this shit's boring enough as it is... i already know c++, i had to do SOMETHING to make it interesting, haha
10/22/2007 1:43:29 AM
Oh noes not CSC jokes...
10/22/2007 1:49:56 AM
haha, i remember doing that same shit in javagg
10/22/2007 1:52:03 AM
^^^ by "done subtly" i meant "not posted on thewolfweb"
10/22/2007 1:55:02 AM
I wouldn't even post any of that shit onlineCSC is fucking anti-cheating-sharing crazy[Edited on October 22, 2007 at 2:14 AM. Reason : not that you're gonna get caught, but still]
10/22/2007 2:13:09 AM
printf > cout
10/22/2007 2:18:46 AM
oh zeller
10/22/2007 1:35:29 PM
this is some elementary bullshit.
10/22/2007 1:36:47 PM
i built rube goldbergian java programs for shits and giggles in 216 back in the day--haha, fucking objects for everything[Edited on October 22, 2007 at 1:42 PM. Reason : i'm sure the graders loved me]
10/22/2007 1:40:24 PM
// **********// * { ^ ^ } *// * ( __ ) *// * MONKMONK!!!*
i used to do this.for the really simple programs, i would make funny function names and integers.professors don't like sexual innuendos when describing input/output to a function.
10/22/2007 1:48:56 PM
NERD POST OF THE YEAR
10/22/2007 1:50:00 PM
If you already know c++, why are you in 114? Why not skip right to 116?Also, I thought NCSU switched to Java for the intro courses, are they back to C++ or do they give the option?
10/22/2007 1:52:33 PM
Lavim used to name things in his C++ code so you would have function calls like
suck(my->nuts);
10/22/2007 1:54:46 PM
If you want your grader to cry, do things like use the ?: operator, or do something like Duff's Device and make him really think. Don't be intentionally misleading (like putting everything on one line, which is very newbie-ish).Really elegant and simple solutions using a minimal amount of actual code that take a lot of brain power to understand are the best.Take advantage of built-in parts of the language. Why use while(true), when for(;;) does the exact same thing?Also, there's no reason an index to a for loop has to increase by a static, linear amount. There's also no reason why you can't put do-stuff-code inside the for parens. If you can find a situation where it would make sense to do this, do it.
while(true)
for(;;)
int printDots(int j) { for(int k=j; --k; ) printf("."); return j-k;}int main() { for(int i=0,j=0; i<256; i+=printDots(j)); return EXIT_SUCCESS;}
int printHello() { printf("Hello, "); return 0;}int printWorld() { printf("World!\n"); return 0;}void doNothing(int x,int y) {}int main() { doNothing(printHello(),printWorld()); return EXIT_SUCCESS;}
10/22/2007 2:18:14 PM
10/29/2007 9:19:52 PM
10/29/2007 9:39:37 PM
i saw csc and thought i smelled dirty indian
10/29/2007 9:50:11 PM
why did you name the read procedure "zeller();" ?
10/29/2007 9:53:50 PM
10/29/2007 9:55:21 PM
I love this thread.
10/29/2007 10:58:08 PM
you will get far by fucking with "the system"
10/29/2007 11:04:33 PM
He probably named it Zeller because it uses the Zeller algorithm- an equation used to determine what day of the week(Sun-Sat) a particular date of the year will be. God I hated making that fucking calendar crap in the lab for CSC 116.[Edited on October 29, 2007 at 11:16 PM. Reason : ]
10/29/2007 11:12:49 PM
yeah shittiest lab evererr the whole of csc116 lab, not just this part though this was pretty bad
10/30/2007 12:26:13 AM