Please send questions to
st10@humboldt.edu .
/*-----
Contract: main: void -> int
Purpose: testing program for the function sum_contents
Examples: when the user runs the program test_sum_contents, the
following should be written to the screen:
Testing sum_contents... (1 == passed, 0 == failed)
---------------------------------------------------------
1
1
by: Sharon M. Tuttle
last modified: 4-23-07
-----*/
#include <iostream>
#include "sum_contents.h"
using namespace std;
int main()
{
const int SIZE_FIRST = 4;
double first_set[SIZE_FIRST] = {1.5, 2, 0.3, 5.46};
const int SIZE_SECOND = 0;
double empty_set[SIZE_SECOND] = {};
cout << "Testing sum_contents... (1 == passed, 0 == failed)"
<< endl;
cout << "---------------------------------------------------------"
<< endl;
cout << (sum_contents(first_set, SIZE_FIRST) == 9.26) << endl;
cout << (sum_contents(empty_set, SIZE_SECOND) == 0) << endl;
return EXIT_SUCCESS;
}