SOURCE FILE: 030_powCalcB_skel.cpp
/*
This is a skeleton for a program that
caclulates ONE power for the user.
The program inputs two positive integers n and m.
It calculates n to the power m (the answer).
It then displays n, m, and the answer.
For example if you enter 2 and 3, the program calculates
2*2*2 = 8, and then tells you that 2 to the power 3 is 8.
If the user enters a non-positive number, the program
stops without producing any further output.
*/
#include <iostream>
using namespace std ;
/* PROTOTYPES */
void PrintInfo() ;
int GetInt() ;
bool GoodInput(int first, int second) ;
int MyPow(int base, int exponent) ;
void WriteAnswer (int base, int exp, int ans) ;
/* ************** */
/* FUNCTION: MAIN */
/* ************** */
int main (void)
{
return 0;
}
/* FUNCTION: PRINT INFO */
/* Print information explaining how to use the program */
void PrintInfo()
{
cout << "\n" ;
cout << " This program inputs two positive integers n and m. \n" ;
cout << " It calculates and displays n to the power m. \n" ;
cout << " For example if you enter 2 and 3, the program calculates\n" ;
cout << " 2*2*2 = 8. \n" ;
cout << "\n" ;
cout << " If the user enters a non-positive number, the program\n" ;
cout << " stops without producing any further output.\n" ;
cout << "\n" ;
}
/* FUNCTION: GET INT */
/* WHAT THIS FUNCTION DOES:
Prompt the user to enter a positive integer at the keyboard,
read in the input, and return it. */
int GetInt()
{
}
/* FUNCTION: GOOD INPUT */
/* WHAT THIS FUNCTION DOES:
Returns the boolean value true if both parameters are positive
numbers, else returns false. */
bool GoodInput(int first, int second)
{
}
/* FUNCTION: MY POW */
/* WHAT THIS FUNCTION DOES:
Works with two parameters called base and exponent.
It returns the value of base raised to the power exponent.
Precondition: both base and exponent are positive integers */
int MyPow(int base, int exponent)
{
}
/* FUNCTION: WRITE ANSWER */
/* WHAT THIS FUNCTION DOES:
Tells the user that the value of base raised to the power exp
is equal to ans
After writing the information on a line, this function finishes
up by printing a blank line. */
void WriteAnswer (int base, int exp, int ans)
{
}