#include <iostream>
#include <cmath>
#include <cstdlib>
#include <cstring>
using namespace std;
//prototypes for all separate functions
int chooseFunc(int, double, double, double, double);
int shape(int, double, double, double, double);
int numShapes(int, double, double, double, double);
int startPoint(int, double, double, double, double);
int endPoint(int, double, double, double, double);
double chooseMNgo1(int, double, double, double, double);
double chooseMNgo2(int, double, double, double, double);
double chooseMNgo3(int, double, double, double, double);
double chooseMNgo4(int, double, double, double, double);
double chooseMNgo5(int, double, double, double, double);
double func1_r(int, double, double, double, double);
double func2_r(int, double, double, double, double);
double func3_r(int, double, double, double, double);
double func4_r(int, double, double, double, double);
double func5_r(int, double, double, double, double);
double func1_t(int, double, double, double, double);
double func2_t(int, double, double, double, double);
double func3_t(int, double, double, double, double);
double func4_t(int, double, double, double, double);
double func5_t(int, double, double, double, double);
//calls all the functions
int main(int argc, char *argv[]){
double choose, start, end, number;
int choose2;
if(argc==11){
for(int i = 1; i < argc; i += 2){
if(argv[i][0] == '-' && argv[i][1]=='f')
choose = atoi(argv[i+1]);
else if(argv[i][0] == '-' && argv[i][1]=='n')
number = atoi(argv[i+1]);
else if(argv[i][0] == '-' && argv[i][1]=='a')
start = atoi(argv[i+1]);
else if(argv[i][0] == '-' && argv[i][1]=='b')
end = atoi(argv[i+1]);
else if(argv[i][0] == '-' && argv[i][1]=='m')
choose2 = atoi(argv[i+1]);
else {
cout << "ERROR!!!" << endl;
break;}
chooseFunc(choose, number, choose2, start, end);/*
start = startPoint(choose, number, choose2, start, end);
end = endPoint(choose, number, choose2, start, end);
choose2 = shape(choose, number, choose2, start, end);
number = numShapes(choose, number, choose2, start, end);*/
}
return 0;
}
}
//asks user which function they want to use
int chooseFunc(int choose2, double number, double choose, double start, double end){
//cout<<"Choose a function (1,2,3,4, or 5): "<<endl;
//cin>>choose;
/*cout << endl << "Choose" << choose << endl << "Choose2" << choose2 << endl << "Number" << number << endl << "Start" << start << endl << "End" << end << endl <<endl;*/
if (choose == 1)
chooseMNgo1(choose, number, choose2, start, end);
else if (choose == 2)
chooseMNgo2(choose, number, choose2, start, end);
else if (choose == 3)
chooseMNgo3(choose, number, choose2, start, end);
else if (choose == 4)
chooseMNgo4(choose, number, choose2, start, end);
else if (choose == 5){
chooseMNgo5(choose, number, choose2, start, end);}
}
int shape(int choose2, double end, double choose, double start, double number){
return choose2;
}
int numShapes(int choose2, double number, double choose, double start, double end){
return number;
}
double chooseMNgo1(int choose2, double end, double choose, double start, double number){
//cout << "What method would you like to use? Press 1 to use rectangles, 2 to use trapezoids or 3 to use both." << endl;
//cin >> choose2;
/*()start = startPoint(start, end, number, choose, choose2);
end = endPoint(start, end, number, choose, choose2);*/
if (choose2 == 1){
func1_r(start, end, number, choose, choose2);}
else if (choose2 == 3){
func1_r(start, end, number, choose, choose2);
func1_t(start, end, number, choose, choose2);}
else if ( choose2 == 2){
func1_t(start, end, number, choose, choose2);}
}
double chooseMNgo2(int choose2, double end, double choose, double start, double number){
//cout << "What method would you like to use? Press 1 to use rectangles, 2 to use trapezoids or 3 to use both." <<endl;
//cin >> choose2;
//start = startPoint(start, end, number, choose, choose2);
//end = endPoint(start, end, number, choose, choose2);
cout << "here";
if (choose2 == 1){
func2_r(start, end, number, choose, choose2);}
else if (choose2 == 3){
func2_t(start, end, number, choose, choose2);
func2_r(start, end, number, choose, choose2);}
else if (choose2 == 2){
func2_t(start, end, number, choose, choose2);}
}
double chooseMNgo3(int choose2, double end, double choose, double start, double number){
//cout << "What method would you like to use? Press 1 to use rectangles, 2 to use trapezoids or 3 to use both." <<endl;
//cin >> choose2;
//start = startPoint(choose, choose2, start, end, number);
//end = endPoint(choose, choose2, start, end, number);
if (choose2 == 1){
func3_r(start, end, choose, choose2, number);}
else if (choose2 == 3){
func3_r(start, end, choose, choose2, number);
func3_t(start, end, choose, choose2, number);}
else if(choose2 == 2){
func3_t(start, end, choose, choose2, number);}
}
double chooseMNgo4(int choose2, double end, double choose, double start, double number){
//cout << "What method would you like to use? Press 1 to use rectangles, 2 to use trapezoids or 3 to use both." <<endl;
//cin >> choose2;
//start = startPoint(start, end, choose, choose2, number);
//end = endPoint(start, end, choose, choose2, number);
if (choose2 == 1){
func4_r(start, end, choose, choose2, number);}
else if(choose2 == 3){
func4_r(start, end, choose, choose2, number);
func4_t(start, end, choose, choose2, number);}
else if(choose2 == 2){
func4_t(start, end, choose, choose2, number);}
}
double chooseMNgo5(int choose2, double end, double choose, double start, double number){
//cout << "What method would you like to use? Press 1 to use rectangles, 2 to use trapezoids or 3 to use both." <<endl;
//cin >> choose2;
//start = startPoint(start, end, choose, choose2, number);
//end = endPoint(start, end, choose, choose2, number);
if (choose2 == 1){
func5_r(start, end, choose, choose2, number);}
else if(choose2 == 3){
func5_r(start, end, choose, choose2, number);
func5_t(start, end, choose, choose2, number);}
else if(choose2 == 2){
func5_t(start, end, choose, choose2, number);}
}
|