* Input Base number
* WHILE base is not quit
* IF (Base is in range)
* input exponit
*
* IF (exponent is in range)
*
Int answear = 1
FOR(exponent number of time)
* ans = base * ans
* total = total + base
*
END FOR
*
* Display Total
*
IF (base is out of range)
* Display error
* END IF
* IF (exponent is out of range)
* Display error
* END IF
* Prompt user for next input
* END WHILE
* END Lab 04 - Calculate the total for park
**********************************************************************/
#include <cmath>
#include <iostream>
#include <iomanip>
usingnamespace std;
void main()
{
// local constants
constint QUIT = -1;
constint BASE_MAX = 10;
constint BASE_MIN = 0;
constint EX_MAX = 10;
constint EX_MIN = 1;
// local variables
int Base_Total;
int Base;
int Exp = 1;
int Total;
int Count = 0;
/*********************************************************************/
//Prompt for number input
cout << "\n\n\n\n\n\n\n";
cout << setw(52) << "--------------------------------------" << endl;
cout << setw(50) << " Input A base Number Between 1 & 10 " << endl;
cout << setw(50) << " Or -1 to quit " << endl;
cout << setw(52) << "--------------------------------------" << endl;
cout << "\n" << setw (46) << "Base: ";
cin >> Base;
// Clear the screen
system ("cls");
//Calculate the product of the two numbers
while(Base != QUIT)
{
if (Base < BASE_MAX && Base > BASE_MIN)
{
cout << "\n\n\n\n";
cout << setw(46) << "Enter Exponent" << endl;
cin >> Exp;
}
if (Exp < EX_MAX && Exp > EX_MIN)
{
for(int Count; Count == Exp; Count++)
Base_Total = Base * Base;
Total = Base_Total + Base;
}
else (Base > BASE_MAX && Base < BASE_MIN);
{
cout << "\n\n\n\n";
cout<< setw(46) << "Error" << endl;
}
}