Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "Items.h"
- using namespace std;
- void printMenu();
- int getWhatTheyWant();
- int main()
- {
- int whatTheyWant;
- Items itemsList;
- do {
- printMenu();
- whatTheyWant = getWhatTheyWant();
- switch (whatTheyWant){
- case 1:
- itemsList.printPlainItems();
- break;
- case 2:
- itemsList.printPositiveItems();
- break;
- case 3:
- itemsList.printNegativeItems();
- break;
- }
- }while(whatTheyWant<4 && whatTheyWant>0);
- return 0;
- }
- int getWhatTheyWant(){
- int choice;
- cin >> choice;
- return choice;
- }
- void printMenu(){
- cout << "1 - just plain items" << endl;
- cout << "2 - helpful items" << endl;
- cout << "3 - harmful items" << endl;
- cout << "anything else will quit program" << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment