Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "hello.h"
- #include<iostream>
- using namespace std;
- void caseOne()
- {
- hello l;
- int box;
- cout<<l.isEmpty()<<endl;
- l.displayAll();
- l.addRear(1);
- l.addRear(2);
- l.addRear(3);
- l.displayAll();
- l.deleteFront(box);
- l.deleteFront(box);
- l.displayAll();
- cout<<l.isEmpty()<<endl;
- l.deleteFront(box);
- cout<<l.isEmpty()<<endl;
- }
- void caseTwo()
- {
- hello l;
- int box;
- l.addFront(5);
- l.addFront(4);
- l.deleteFront(box);
- l.addRear(6);
- l.addRear(8);
- l.addRear(9);
- l.displayAll();
- l.addbeforeIth(1,4);
- l.addbeforeIth(4,7);
- l.addbeforeIth(7,10);
- {
- //l.addbeforeIth(9,12);
- }
- catch (hello::OutOfRange)
- {cerr << "Error has occurred: out of range"; }
- try
- {
- //l.addbeforeIth(0,0);
- }
- catch (hello::OutOfRange)
- {cerr << "Error has occurred: out of range"; }
- l.displayAll();
- // l.deleteIth(1,box);
- // l.deleteIth(6,box);
- // l.deleteIth(3,box);
- try
- {
- //l.deleteIth(5,box);
- }
- catch (hello::OutOfRange)
- {cerr << "Error has occurred: out of range"; exit(1); }
- try
- {
- //l.deleteIth(0,box);
- }
- catch (hello::OutOfRange)
- {cerr << "Error has occurred: out of range"; exit(1); }
- //l.displayAll();
- /* while(!l.isEmpty())
- l.deleteRear(box);*/
- // l.displayAll();
- }
- void caseThree()
- {
- }
- int main()
- {
- int userCase;
- cout << "Which case would you like to run? 1-4." << endl;
- cin >> userCase;
- switch(userCase)
- {
- case 1:
- caseOne();
- break;
- case 2:
- caseTwo();
- break;
- case 3:
- cout<<"to";
- break;
- case 4:
- cout<<"eat";
- break;
- default:
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement