Respuesta :
C++ program to register data from presenters for colleges, using a menu interface and array-type data structure. Below is an image of the code.
C++ code
#include<iostream>
#include<cstdlib>
using namespace std;
int main() {
- // Define variables
int ans,x,z;
string name, data[100][5];
bool found;
x = 0;
do {
found = false;
- // Data menu
cout << " Data Menu" << endl;
cout << "*****************" << endl;
cout << "1.- Entry" << endl;
cout << "2.- Change" << endl;
cout << "3.- Display" << endl;
cout << "0.- Exit" << endl;
do {
cin >> ans;
} while (!(ans!=1 || ans!=2 || ans!=3 || ans!=0));
switch (ans) {
case 1:
- // Presenter 'personal data
x = x+1;
cout << "Name: ";
cin >> data[x-1][0];
cout << "Presentation topic: ";
cin >> data[x-1][1];
cout << "Address: ";
cin >> data[x-1][2];
cout << "Telephone: ";
cin >> data[x-1][3];
cout << "Fee required: ";
do {
cin >> data[x-1][4];
} while (atof(data[x-1][4].c_str())<0);
break;
case 2:
- // Changing presenter' data
z = x;
cout << "Presenter name: ";
cin >> name;
do {
if (name==data[z-1][0]) {
found = true;
cout << "Name: " << data[z-1][0] << endl;
cout << "New name: ";
cin >> data[z-1][0];
cout << "Presentation topic: " << data[z-1][1] << endl;
cout << "New presentation topic: ";
cin >> data[z-1][1];
cout << "Address: " << data[z-1][2] << endl;
cout << "New address: ";
cin >> data[z-1][2];
cout << "Telephone: " << data[z-1][2] << endl;
cout << "New telephone: ";
cin >> data[z-1][3];
cout << "Fee required: " << data[z-1][3] << endl;
cout << "New fee required: ";
do {
cin >> data[z-1][4];
} while (atof(data[z-1][4].c_str())<0);
}
z = z-1;
} while (!(found==true || z==0));
if (found==false) {
cout << "Not found" << endl;
}
break;
case 3:
- // Display presenter' data
z = x;
cout << "Presenter name: ";
cin >> name;
do {
if (name==data[z-1][0]) {
found = true;
cout << "Name: " << data[z-1][0] << endl;
cout << "Presentation topic: " << data[z-1][1] << endl;
cout << "Address: " << data[z-1][2] << endl;
cout << "Telephone: " << data[z-1][3] << endl;
cout << "Fee required: " << data[z-1][4] << endl;
}
z = z-1;
} while (!(found==true || z==0));
if (found==false) {
cout << "Not found" << endl;
}
break;
}
} while (!(ans==0 || x>100));
return 0;
}
To learn more about array data structure in C++ see: https://brainly.in/question/1849908
#SPJ4

