Please send questions to
st10@humboldt.edu .
/*-----
Contract: main: void -> int
Purpose: testing program for the function precision_play
Examples: when this program is run, the following should
be printed to the screen:
testing precision_play: should see 1.6666666 and 2.7
formatted to 3 fractional places (but not the 5):
---------------------------------------
1.667
2.700
5
...and now should see 45.222222222 and 13.2
formatted to 5 fractional places (but not the 2):
---------------------------------------
45.22222
13.20000
2
by: Sharon Tuttle
last modified: 5-4-10
-----*/
#include <iostream>
#include <iomanip>
#include <cmath>
#include "precision_play.h"
using namespace std;
int main()
{
cout << boolalpha;
cout << endl;
cout << "testing precision_play: should see 1.6666666 and 2.7 " << endl;
cout << " formatted to 3 fractional places (but not the 5): " << endl;
cout << "---------------------------------------" << endl;
precision_play(3, 1.6666666, 2.7, 5);
cout << endl;
cout << "...and now should see 45.222222222 and 13.2 " << endl;
cout << " formatted to 5 fractional places (but not the 2): " << endl;
cout << "---------------------------------------" << endl;
precision_play(5, 45.222222222, 13.2, 2);
cout << endl;
return EXIT_SUCCESS;
}