Homework 8

Due: 3/30/04

Task: Write a program that reads in integers from a file, two at a time, and prints out to another file the result of raising the first integer to the power of the second integer.

The input file will be in the format:

5	6
3	4
10	3
13	5
2	3
Etc. The input file will be one I create that can contain any set of integers. In other words, it won't look like the example above.

The output file should look like this when your program is done:

5 to the 6th power is 15625
3 to the 4th power is 243
10 to the 3th power is 1000
13 to the 5th power is 371293
2 to the 3th power is 8

The output file should contain one line for every pair of numbers in the input file.


Purpose: To learn and practice how to use files in a program.