A driver program is given here in base8_dr.cpp . Be sure that you test your finished program with suitable values, including those on the boundary like 777.
Functions you must provide:
void display(int dig1, int dig2, int dig3)
void increment(int& dig1, int& dig2, int& dig3)
void decrement(int& dig1, int& dig2, int& dig3)
void get_digits(int input, int& dig1, int& dig2, int& dig3)
// Pre: a 3 digit base 8 number read from the terminal as if it were
// an integer, input
// Post: the dig1, dig2, dig3 hold the digits of the integer input
//(in the order they were entered, so 642 has dig1 = 6)
// Displays the base 8 number with digits dig1-3
//Pre: dig1-3 are digits of a base 8 number, N
//Post: dig1-3 are digits of N+1 (base 8)
//Pre: dig1-3 are digits of a base 8 number, N
//Post: dig1-3 are digits of N-1 (base 8)
File name: base8.cpp
Open one file for input and one for output. The input file is to be read and copied to the output file with the addition of line numbers at the beginning of each line.
In addition, the program is to display (on screen) the lengths of the shortest and longest lines of the file and display the average line length of the file.
Your program should allow the user to specify the names of the input and output files. (See text example 5.3.)
File name: stream.cpp