CodeCamp_program.cpp //alpha version, not for speakers --------------------------------------------------------- #include “my_libs.h” #include “globals.h” #define max_persons 200; #define first_dayset_date(14, 05, 2011); //attention, was changed from 13 to 14 #define second_dayset_date(15, 05, 2011); //and from 14 to 15 struct person { char first_name[20]; char second_name[30]; char company[40]; bool speech, masterclass, volunteer; char speech_title[150]; } participants[max_persons]; class CodeCamp { private: person participants[max_persons]; public: char title[9]={“CodeCamp”}; char first_day, second_day, month; short int year=get_year(); void greeting(); void registration(); void communicating(); void farewell(); } CodeCamp2011; voidCodeCamp::registration(int participant_id) { printf(“%s\n%s\n%s”, participants[participant_id].first_name, participants[participant_id].second_name, get_skills(),participants[participant_id].company); }; void CodeCamp::greeting (int participant_id) { printf(“Dear %s, we are glad to see you at %s %i”, participants[participant_id].first_name, title, year); }; void CodeCamp::communicating (int participant_id) { do { do { speak_with_neighbors(); } while(!lecture()); increment_memory(participant_memory[participant_id]=listen()); increment_memory(participant_memory[participant_id]=ask_questions()); if (dinner_time<=get_hour<(dinner_time+1)) { eat(everything_eatable); drink(coffee); } } while (get_hour()<19); }; void CodeCamp::farewell (int participant_id) { switch(get_day()) { case first_day: printf(“%s, bye!\nSee you tomorrow))”, participants[participant_id].first_name); break; case second_day:printf(“%s, bye!\nWe were glad to see you.”, participants[participant_id].first_name); break; default: printf(“OMG, what are you doing here?”); } }; void barcamping (int participant_id) { CodeCamp2011.registration(participant_id); CodeCamp2011.greeting(participant_id); CodeCamp2011.communicating(participant_id); CodeCamp2011.farewell(participant_id); }; void main(int argc, char* argv[]) { barcamping(argv[0]); sleep(night_duration); barcamping(argv[0]); goto(afterparty); };