-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathControl.cc
More file actions
62 lines (53 loc) · 1.45 KB
/
Copy pathControl.cc
File metadata and controls
62 lines (53 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include <iostream>
#include <string>
#include <vector>
#include "Control.h"
const vector<string> Control::menu ={
"Set province",
"Sort by animal name",
"Sort by number of farms",
"Sort by number of animals",
"Print all data",
"Print current data"
};
// void sortByAnimalName();
// void sortByNumberOfFarms();
// void sortByNumberOfAnimals();
// void printAllData();
// void printCurrentData();
void Control::launch(){
//make a view, get input, launch the appropriate test
View view;
int choice = -1;
string province;
while (choice!= 0){
view.menu(menu, choice);
switch(choice){
case 1:
view.getProvince(province);
farmData.setProvince(province);
break;
case 2:
farmData.sortByAnimalName();
break;
case 3:
farmData.sortByNumberOfFarms();
break;
case 4:
farmData.sortByNumberOfAnimals();
break;
case 5:
farmData.printAllData();
break;
case 6:
farmData.printCurrentData();
break;
case 0:
cout<<"Goodbye!"<<endl;
break;
default:
cout<<"Invalid choice"<<endl;
break;
}
}
}