-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInputOutput.cpp
More file actions
45 lines (38 loc) · 1.05 KB
/
Copy pathInputOutput.cpp
File metadata and controls
45 lines (38 loc) · 1.05 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
#include "InputOutput.hpp"
InputOutput::InputOutput()
{
}
string InputOutput::askName()
{
/*ask for the name of the image file that must be executed
* returns a string
*/
string file_name;
cout<<"Tell me the file name without the extension: "<<endl;
cin>>file_name;
return file_name;
}
StackOperations* InputOutput::askOper()
{
//returns a stack
StackOperations* st = new StackOperations();
char oper = 'R';
//while the operation inserted by the user is one of the valid operations
//this is done so that X or any other letter wont be stored in the stack
while ((oper=='R')||(oper=='S')||(oper=='V')||(oper=='H')||(oper=='O'))
{
cout<<"Which operation do you want to do (in caps, just the letter)?: "<<endl;
cout<<"R: reverse"<<endl;
cout<<"S: sort"<<endl;
cout<<"V: flip"<<endl;
cout<<"H: flop"<<endl;
cout<<"O: darken"<<endl;
cout<<"X: exit"<<endl;
cin>>oper;
st->push(oper);
}
return st;
}
InputOutput::~InputOutput()
{
}