//Sam Trivikraman CS1A Chapter 11, p. 647, #9 // /* ****************************************************************************** Store Speaker's Bureau Details _______________________________________________________________________________ This program stores the speaker's name, phone number, speech topic, and the speech fee. _______________________________________________________________________________ INPUT speaker name : The speaker's name speaker number : The speaker's phone number speech topic : The speech topic speech fee : The fee to attend the speech OUTPUT array of speech information : An array that stores all of the details for the speech _______________________________________________________________________________ ******************************************************************************* */ #include <iostream> using namespace std; //a struct that stores all of the information for the Speaker's bureau struct bureau { string name; //INPUT The speaker's name string phoneNum; //INPUT The speaker's phone number string topic; //INPUT The speech topic float fee; //INPUT the fee to attend the speech }; int main() { bureau speakers[10]; //OUTPUT An array that stores all of the details for the speech //get the information for the speaker and speech from the user for(int i = 0; i < 10; i++) { cout << "Please enter the speaker's name" << endl; cin >> speakers[i].name; cout << "Please enter the speaker's phone number" << endl; cin >> speakers[i].phoneNum; cout << "Please enter the speech topic" << endl; cin >> speakers[i].topic; cout << "Please enter the fee" << endl; cin >> speakers[i].fee; } //output the information for the speaker and the speech details for(int i = 0; i < 10; i++) { cout << "Speaker name: " << speakers[i].name << endl; cout << "Speaker phone number: " << speakers[i].phoneNum << endl; cout << "Speech topic: " << speakers[i].topic << endl; cout << "Speech fee: " << speakers[i].fee << endl; } return 0; }
georgie 9495788563 coffee 12 georgie 9495788563 coffee 12 georgie 9495788563 coffee 12 georgie 9495788563 coffee 12
Please enter the speaker's name Please enter the speaker's phone number Please enter the speech topic Please enter the fee Please enter the speaker's name Please enter the speaker's phone number Please enter the speech topic Please enter the fee Please enter the speaker's name Please enter the speaker's phone number Please enter the speech topic Please enter the fee Please enter the speaker's name Please enter the speaker's phone number Please enter the speech topic Please enter the fee Please enter the speaker's name Please enter the speaker's phone number Please enter the speech topic Please enter the fee Please enter the speaker's name Please enter the speaker's phone number Please enter the speech topic Please enter the fee Please enter the speaker's name Please enter the speaker's phone number Please enter the speech topic Please enter the fee Please enter the speaker's name Please enter the speaker's phone number Please enter the speech topic Please enter the fee Please enter the speaker's name Please enter the speaker's phone number Please enter the speech topic Please enter the fee Please enter the speaker's name Please enter the speaker's phone number Please enter the speech topic Please enter the fee Speaker name: georgie Speaker phone number: 9495788563 Speech topic: coffee Speech fee: 12 Speaker name: georgie Speaker phone number: 9495788563 Speech topic: coffee Speech fee: 12 Speaker name: georgie Speaker phone number: 9495788563 Speech topic: coffee Speech fee: 12 Speaker name: georgie Speaker phone number: 9495788563 Speech topic: coffee Speech fee: 12 Speaker name: Speaker phone number: Speech topic: Speech fee: 0 Speaker name: Speaker phone number: Speech topic: Speech fee: 0 Speaker name: Speaker phone number: Speech topic: Speech fee: 0 Speaker name: Speaker phone number: Speech topic: Speech fee: 8.40779e-45 Speaker name: Speaker phone number: Speech topic: Speech fee: -5.28609 Speaker name: Speaker phone number: Speech topic: Speech fee: 2.8026e-45