- Code: Select all
// AlgebraCalculatorWIN32.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int type;
bool monomial;
bool binomial;
cout<<"Hello.\n\n";
cout<<"If your problem is a monomial, enter 1.\n";
cout<<"If your problem is a binomial, enter 2.\n";
cin>>type;
if (type == 1){
cout<<"Your problem is a monomial.\n";
monomial = 1;
binomial = 0;
}
if (type == 2){
cout<<"Your problem is a binomial.\n";
monomial = 0;
binomial = 1;
}
/* else function is broken.
else {
cout<<"Enter 1 or 2 next time!\n";
monomial == 0;
binomial == 0;
}
*/
int num1;
int num2;
//int num3; Uncomment when TRINOMIAL support is added
int exp1;
int exp2;
//int exp3; Uncomment when TRINOMIAL support is added
int a1;
int a2;
//double answer3; Uncomment when TRINOMIAL support is added
while (monomial == 1) {
cout<<"Now, what is the first term's number?\n";
cin>>num1;
cout<<"The monomial's number is "<<num1<<"\n";
cout<<"What is the exponent?\n";
cin>>exp1;
cout<<"The exponent is "<<exp1<<"\n\n";
(num1*(num1*exp1))==a1;
cout<<"The answer is "<<a1<<"\n\n";
}
system("PAUSE");
return 0;
}


