本文整理汇总了C++中Station::showTopOfORDequeLeft方法的典型用法代码示例。如果您正苦于以下问题:C++ Station::showTopOfORDequeLeft方法的具体用法?C++ Station::showTopOfORDequeLeft怎么用?C++ Station::showTopOfORDequeLeft使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Station
的用法示例。
在下文中一共展示了Station::showTopOfORDequeLeft方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PerformMenuSelection
void PerformMenuSelection(int choice, Station& myStation, bool& RunStatus) {
//MENU CHOICE 1
if (choice == 1) {
int id;
cout << "------------------------------\n";
cout << "OPTION 1: ADD CAR TO STATION\n";
cout << "------------------------------\n";
if (myStation.showCurrentCar() != -1) {
cout << "INVALID OPTION. Car already present in station.\n\n";
}
else {
cout << "Please enter the car ID you would like to add.\n>";
cin >> id;
if (cin.fail() == true) {
cin.clear();cin.ignore();
cout << "INVALID OPTION. Car not added.\n\n";
}
else if (id < 0) {
cout << "INVALID OPTION. Car not added.\n\n";
}
else if (id == myStation.showTopOfStack() || id == myStation.showTopOfQueue() || id == myStation.showTopOfDequeLeft() ||
id == myStation.showTopOfDequeRight() || id == myStation.showTopOfIRDequeLeft() ||
id == myStation.showTopOfIRDequeRight() || id == myStation.showTopOfORDequeLeft()) {
cout << "INVALID OPTION. Car ID already exists in Facilities\n\n";
}
else {
myStation.addToStation(id);
cout << "CAR SUCCESSFULLY ADDED\n\n";
}
}
}