Had a crazy week at school. Projects, term papers, midterms... After all that, come up with the following code:
being_a_programmer.cpp
#include "all the crazy stuffs"
using namespace std;
class Programmer
{
private:
energy;
knowledge;
satisfaction;
public:
Programmer() {energy = :-) ;}
~Programmer() {energy = :-( ;}
get_energy() {return energy;}
read_code(source code) {energy--;}
google(internet, books) {knowledge++;}
write_code();
debug(failed code);
relax() {energy++;}
increase_satisfaction() {satisfaction++;}
};
void main()
{
unsigned char *new_project;
new_project = (unsigned char *)calloc (??????, sizeof(unsigned char));
Programmer newguy;
int hours = 0;
while (project_not_done)
{
newguy.read_code();
newguy.google();
newguy.write_code();
newguy.debug();
if (get_energy() == VERY_LOW)
newguy.relax();
hours++;
}
newguy.increase_satisfaction();
cout << "Hours Used: " << hours;
}
Run the code, hopefully it works without ending up in an infinate loop. Otherwise, you are screwed. @_@