#ifndef TEDIOUS_MATH_FUNCTIONS_H_INCLUDED
#define TEDIOUS_MATH_FUNCTIONS_H_INCLUDED
#include <iostream>
usingnamespace std;
constdouble pi = 3.1415926535897;
double areaofcircle() // make this work with more shapes later
{
cout << "Will you be using the radius or the diameter? (type \"r\" for radius, and \"d\" for diameter)" << endl;
char radiusordiameter;
cin >> radiusordiameter;
double area = 0;
for(bool flag = false; flag != true;) //makes a loop to where you don't have to keep restarting program if you input the wrong thing
{
switch(radiusordiameter) //calculates area depending on if radius or diameter is used
{
double input = 0;
case'r': //calculates area using radius
cout << "Input the radius" << endl;
cin >> input;
area = pi * input * input;
return area;
case'd': // calculates area using diameter
cout << "Input the diameter" << endl;
cin >> input;
area = pi/4 * input * input;
return area;
default: // wrong input
cout << "You did not tell me if you are using diameter or radius, please try again" >> endl;
}
}
}
#endif // TEDIOUS_MATH_FUNCTIONS_H_INCLUDED