#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include<string>
using namespace std;
struct Activist_funds
{
string name;
double deposit;
};
int main()
{
int i;
cout << "Please enter the counts of the donors: ";
cin >> i;
cin.get();
Activist_funds* donor = new Activist_funds[i];
for (int k = 0; k < i; k++)
{
cout << "Please enter the name of the donor#"<<k+1<<": ";
getline(cin, (donor+k)->name);
cout << "Please enter the amount of the donor#"<<k+1<<": ";
(cin >> (donor + k)->deposit).get();
}
cout << "\nGrand Patrons: \n";
int count_grand_patrons=0;
for (int index = 0; index < i; index++)
{
if ((donor + index)->deposit>10000)
{
cout << (donor + index)->name << endl;
count_grand_patrons++;
}
}
if (count_grand_patrons == 0)
cout << "none\n";
cout << "\nPatrons: \n";
int count_patrons = 0;
for (int index = 0; index < i; index++)
{
if ((donor + index)->deposit <= 10000)
{
cout << (donor + index)->name << endl;
count_patrons++;
}
}
if (count_patrons == 0)
cout << "none\n";
delete[]donor;
return 0;
}