So I created a method in order to start the process for adding, multiplying and etc polynomials, however, when attemepting to run start(), the compiler runs, however the box remains blank, even though it shouldn't. Not exactly sure what I'm doing wrong.
Any ideas?
Here is my code.
Here is my header
#ifndef _POLY_GUARD
#define _POLY_GUARD
#include <iostream>
using namespace std;
class Polynomial
{
public:
Polynomial(int coef, int exp);
void start();
friend ostream & operator << (ostream &out, const vector<int> &c);
friend istream & operator >> (istream &in, const Polynomial &c);
void addPolynomials();
void multiplyPolynomials();
void evaluatePolynomial();
int findCoefficient();
int findLeadingExponent();
};
#endif
This is the source code.
#include "Polynomial.h"
#include <utility>
#include <iostream>
#include <vector>
#include <string>
using namespace std;
void Polynomial::start()
{
int choice;
std::cout << "What do you wish to do?" << std::endl;
std::cout << "1. Add two polynomials" << std::endl;
std::cout << "2. Multiply two polynomials" << std::endl;
std::cout << "3. Evaluate one polynomial at a given value" << std::endl;
std::cout << "4. Find Coefficent for a given polynomial and given exponent" << std::endl;
std::cout << "5. Find the leading exponent for a given polynomial" << std::endl;
std::cout << "6. Exit " << std::endl;
std::cin >> choice;
if (choice < 1 || choice > 6)
{
do
{
std::cout << "Invalid entry: please reenter choice" << std::endl;
std::cin >> choice;
} while (choice < 1 || choice > 6);
}
if (choice == 1)
{
}
}
And finally, here is my main
#include "Polynomial.h"
#include <string>
#include <vector>
#include <utility>
int main()
{
Polynomial start();
system("pause");
}