예제 #1
0
파일: Main.cpp 프로젝트: drnatinator/CS-172
int main()
{
	Venue theSpot;
	theSpot.addEvent(10, "Coffee Hour");    //Should work -works!
	theSpot.addEvent(11, "Brunch w/ Bob");  //Should work -works!
	theSpot.addEvent(11, "Bingo"); //Shouldn't work -doesn't work!

	cout << theSpot.findEvent(10).getTitle() << endl; //Should find Coffee Hour -does!
	cout << theSpot.findEvent("Brunch w/ Bob").getTime() << endl;  //Should find 11 o'clock -does!
	cout << theSpot.findEvent("Bingo").getTime() << endl; //Should print -1, because Bingo ain't there! -does!

	return 0;
}
예제 #2
0
int main()
{
	//Creates a venue to be utilized
	Venue theVenue;
	//Creates an event in the venue at 10 called wedding, displays "Event scheduled"
	theVenue.addEvent(10, "Wedding");
	//Creates an event in the venue at 8 called business meeting, displays "Event scheduled"
	theVenue.addEvent(8, "Business Meeting");
	//Will not create this event, because the time is already taken, displays error message
	theVenue.addEvent(10, "Poker Night");

	//will find and display the event at 10, wedding
	cout << theVenue.findEvent(10).getTitle() << endl;
	//will find and display the event called business meeting, 8
	cout << theVenue.findEvent("Business Meeting").getTime() << endl;
	//will return -1, because the event poker night does not exist
	cout << theVenue.findEvent("Poker Night").getTime() << endl;
	//will return Free, because there is no event at 6
	cout << theVenue.findEvent(6).getTitle() << endl;

	return 0;
}