At Westonci.ca, we connect you with experts who provide detailed answers to your most pressing questions. Start exploring now! Get immediate and reliable solutions to your questions from a community of experienced professionals on our platform. Join our platform to connect with experts ready to provide precise answers to your questions in different areas.
Sagot :
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


We hope this information was helpful. Feel free to return anytime for more answers to your questions and concerns. Thank you for visiting. Our goal is to provide the most accurate answers for all your informational needs. Come back soon. Thank you for visiting Westonci.ca. Stay informed by coming back for more detailed answers.