#include #include using namespace std; double root(double num); double root(double num, double rt); const int MAX_SIZE = 2; // This assignment is worth 3 points int main() { double input[MAX_SIZE]; int k = 0; char ch; string temp; cout << "Enter up to " << MAX_SIZE << " numbers: "; do { cin >> input[k]; ch = cin.get(); k++; } while(k < MAX_SIZE && ch != '\n'); if(k == MAX_SIZE && ch != '\n') getline(cin, temp); switch(k) { case 1: cout << "The square root of " << input[0] << " is " << root(input[0]) << endl; break; case 2: cout << "Root-" << input[1] << " of " << input[0] << " is " << root(input[0], input[1]) << endl; break; } return 0; } double root(double num) { return sqrt(num); } double root(double num, double rt) { return pow(num, 1.0/rt); }