New Text Document

New Text Document -...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 #include<iostream> #include<fstream> #include<string> #include <iomanip> using namespace std const int MAX=25 const string CONTRIBUTORS_FILE = "names.txt" const string CONTRIBUTION_FILE = "slush.txt" struct Contributor { string company double amount } Contributor ContributorArray[MAX] C void Initialize (Contributor[], int &) void SortContributions(Contributor[], int) int main () { int numContributors = 0 i cout<<"-----------------------------------------"<<endl cout<<" Campaign Contributions "<<endl cout<<"-----------------------------------------"<<endl Initialize (ContributorArray, numContributors) cout<<"_=_=_=_"<<endl<<endl SortContributions(ContributorArray, numContributors) for(int i = 0 i < numContributors i++) { cout<<i<< ". "<<ContributorArray[i].company<<endl cout<< "has donated a total of: " cout<<ContributorArray[i].amount cout<<endl<<endl } return 0 } void Initialize ( Contributor ContributorArray[], int &numContributors) { string temp
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Sheet1 Page 2 string temp2 double amt=0 bool isValid b ifstream firstFile,secondFile firstFile.open(CONTRIBUTORS_FILE.c_str()) f firstFile>>numContributors for( int i = 0 i < numContributors i++) { getline(firstFile, ContributorArray[i].company, '\n')
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern