Please help guide me in the direction what I am doing wrong. I am in the process of the code but it reached an error please guide me where I need to change before I continue the rest of the code. That is why it will be incomplete

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Please help guide me in the direction what I am doing wrong. I am in the process of the code but it reached an error please guide me where I need to change before I continue the rest of the code. That is why it will be incomplete

 

#include "stdafx.h"
#include <iostream>

#include <limits>
#include <cstdlib>
#include <array>
#include <ctime>
#include <string>
#include <vector>
#include <cctype>
#include <iterator>
#include <algorithm>
#include <cmath>
#include<windows.h>
#include <conio.h>

 


using namespace std;

double donationamount[50];
string fullname[50];
int departmentdonation[50];


struct donorinfo
{

vector<string>donor_name[50];
vector<double>donor_amount[50];
vector<double>department_donation[50];
} dvariable;

 

void inputdonor(donorinfo *);
void displaydonor(donorinfo *);
void editdonor(donorinfo *);
void displayorganization(donorinfo *);

int main()
{

int index;
donorinfo Donors[50];


int choice;
const int
Add = 1,
Search = 2,
Display = 3,
Department = 4;

here:
do {
menu:
cout << "\n";
cout << " ************************************************************" << endl;
cout << " ** ==Menu== **" << endl;
cout << " ** **" << endl;
cout << " ** **" << endl;
cout << " ** **" << endl;
cout << " ** 1. Add a contributor. **" << endl;
cout << " ** 2. Search and update contributor. **" << endl;
cout << " ** 3. Display all Donor information. **" << endl;
cout << " ** 4. Department Total. **" << endl;
cout << " ** 5. Exit. **" << endl;
cout << " ** **" << endl;
cout << " ** Choose one: **" << endl;
cout << " ** **" << endl;
cout << " ** **" << endl;
cout << " ** **" << endl;
cout << " ************************************************************" << endl;

COORD c;
c.X = 34;
c.Y = 13;

SetConsoleCursorPosition(
GetStdHandle(STD_OUTPUT_HANDLE), c);

cin >> choice;


switch (choice)
{
case Add:
{

inputdonor(Donors);
}
break;
case Search:
{

editdonor(Donors);
}
break;
case Display:
{

displaydonor(Donors);
}
break;
case Department:
{
displayorganization(Donors);
}

default:
{
cout << "Invalid choice. Please try again.";
}
}
}
while (choice != 5);

system("pause");
return 0;
}
void inputdonors(donorinfo *d)
{
int index = 0;
int NumberOfDonors;
cout << "\n|----------------------------------|" << endl;
cout << "|==== Record donor information ====|" << endl;
cout << "|----------------------------------|\n" << endl;
cout << "Please enter the number of donors you want to enter: ";
cin >> NumberOfDonors;

 

for (int i = 0; i < NumberOfDonors; i++)
{
cout << "\nPlease enter donor full name: \n";
getline(cin >> ws, fullname[i]);
dvariable.donor_name[i].push_back(fullname[i]);

 

cout << "\nPlease enter amount donor contributed: \n";
cin >> donationamount[i];
dvariable.donor_amount[i].push_back(donationamount[i]);


cout << "\n=Donation to organization= \n";
cout << "\n1.)NHTS 2.)PBL 3)PTK 4)SEA\n";
cout << "Pick the deparment number for donor:";
cin >> departmentdonation[i];
dvariable.department_donation[i].push_back(departmentdonation[i]);

 

}
}

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education