1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
#include <iostream>
#include "donlist.h"
using namespace std;
int main()
{
const int FUNDS = 15;
int donations[FUNDS]; // Holds sets of donations
// Input amount of funds donated by each person (set)
cout << "Enter the amount donated by each person: " << FUNDS << " donations: ";
cin >> donation[0];
cin >> donation[1];
cin >> donation[2];
cin >> donation[3];
cin >> donation[4];
cin >> donation[5];
cin >> donation[6];
// Display the contents of the array
cout << "The donations you entered are: ";
cout << " " << donation[0];
cout << " " << donation[1];
cout << " " << donation[2];
cout << " " << donation[3];
cout << " " << donation[4];
cout << " " << donation[5];
cout << " " << donation[6] << endl;
return 0;
double funds[] = {5, 100, 5, 25, 10,
5, 25, 5, 5, 100,
10, 15, 10, 5, 10 };
DonationList ckGraphics(15, funds);
cout << "The donations sorted in ascending order are:\n";
ckGraphics.showSorted();
cout << "The donations in their original order are:\n";
ckGraphics.show();
system("pause");
return 0;
}
|