Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Speaker Class that prints an error of name InvalidSpeakerNumber if the number of identification is not within the range 0 to 999. Implement a

Use Speaker Class that prints an error of name InvalidSpeakerNumber if the number of identification is not within the range 0 to 999. Implement a main program that shows that the exception class condition it works.

#include

template

class Speaker

{

private:

string name;

string phone;

string topic;

string fee;

string idnum;

public:

//**************************************Constructor**************************************

Speaker();

Speaker(string aName, string aPhone, string aTopic, string aFee, string anIDnum);

~Speaker();

//**************************************Setters******************************************

void setName(string aName);

void setPhone(string aPhone);

void setTopic(string aTopic);

void setFee(string aFee);

void setIDnum(string anIDnum);

//**************************************Getters******************************************

string getName() const;

string getPhone() const;

string getTopic() const;

string getFee() const;

string getID() const;

};

//Cpp

template

Speaker ::Speaker() : name("Juan del Pueblo"), phone("000-000-0000"),

topic("No Topic"), fee("0.0"), idnum("0")

{

}// end default constructor

template

Speaker ::Speaker(string aName, string aPhone, string aTopic, string afee, string anIDnum)

{

setName(aName);

setPhone(aPhone);

setTopic(aTopic);

setFee(afee);

setIDnum(anIDnum);

}

template

void Speaker ::setName(string aName)

{

name = aName;

}

template

string Speaker ::getName() const {

return name;

}

template

void Speaker ::setPhone(string aPhone) {

phone = aPhone;

}

template

string Speaker ::getPhone() const {

return phone;

}

template

void Speaker ::setTopic(string aTopic) {

topic = aTopic;

}

template

string Speaker ::getTopic() const {

return topic;

}

template

void Speaker ::setFee(string aFee) {

fee = aFee;

}

template

string Speaker ::getFee() const {

return fee;

}

template

void Speaker ::setIDnum(string anIDnum) {

idnum = anIDnum;

}

template

string Speaker ::getID() const {

return idnum;

}

#endif

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions

Question

Do you favor a civil service system? Why or why not?

Answered: 1 week ago

Question

Describe the key uses of CPM and Gantt charts.

Answered: 1 week ago

Question

What are the main objectives of Inventory ?

Answered: 1 week ago

Question

Explain the various inventory management techniques in detail.

Answered: 1 week ago

Question

5. Benchmark current training practices.

Answered: 1 week ago