-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (28 loc) · 873 Bytes
/
Copy pathmain.cpp
File metadata and controls
35 lines (28 loc) · 873 Bytes
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
/*
Derek Norman
2364922
norman@chapman.edu
CPSC-350-03
Assignment 4
*/
#include "RPNCalc.h"
#include "DNAComplement.h"
int main(int argc, char** argv) //main method
{
string mode;
cout << "Please choose a mode. Modes are RPN or DNA. Please type one all caps." << endl;
cin >> mode;
if (mode == "RPN"){
RPNCalc *rpnCalc = new RPNCalc();
cin.ignore(); //ignore the cin here because it inteferes with the input in the prompt() method.
rpnCalc->prompt();
cout << "Result: " << rpnCalc->createStack() << endl;
} else if (mode == "DNA") {
DNAComplement *dna = new DNAComplement();
cin.ignore(); //ignore last input because we take input again later in outputFileDNA()
dna->outputFileDNA();
} else {
throw runtime_error("Invalid mode choice. Please try again!");
}
return 0;
}