// ;----------------------------------------------------------- // ; Program Name: Class_Demo // ; File: Demoprob3.cpp // ; Description: Calculate the 4th power of a number // ; entered // ; // ; Author: Jim Adams // ; Assignment: None // ; Environment: MS C++ 6.0 // ; Revisions: 10/08/2000 Original version // ; // ;----------------------------------------------------------- #include // Function prototypes int get_input (void); double fourth_power (int x); void display_results (int x, double y); // Start of main logic section void main(void) { int x; double result; x = get_input(); result = fourth_power(x); display_results (x, result); } int get_input() { int number; cout << "Enter a number to be used for the 4th power calculation:"; cin >> number; return(number); } double fourth_power(int x) { double newnum; newnum = x*x*x*x; return(newnum); } void display_results(int x, double num) { cout << "The result of " << x << " to the fourth power is " << num << endl; }