Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design a class memberType: Each object of memberType can hold the name of a person, member ID, number of books bought, and amount spent. Include

Design a class memberType: Each object of memberType can hold the name of a person, member ID, number of books bought, and amount spent. Include the member functions to perform the various operations on the objects of memberType such as modify, set, and show a person's name. Similarly, update, modify, and show the number of books bought and the amount spent. Add the appropriate constructors. Write the definitions of the member functions of memberType. Write a program to test various operations of your class memberType.

This needs to be done using C++. Here is what I have so far:

//memberType.h #include #include using namespace std; class memberType { public: void setMemberID(string); void setName(string, string); void printMemberID() const; void printName() const;

memberType(); private: string memberID; string firstName; string lastName; };

//memberTypeImp.cpp #include "memberType.h" #include #include using namespace std;

void memberType::setMemberID(string ID) { memberID = ID; } void memberType::setName(string fName, string lName) { firstName = fName; lastName = lName; } void memberType::printMemberID() const { cout << "Member ID: " << memberID << endl; } void memberType::printName() const { cout << "Name: " << firstName << " " << lastName << endl; } memberType::memberType() { memberID = ""; firstName = ""; lastName = ""; }

//memberType.cpp #include "memberType.h" #include #include using namespace std;

int main() {

return 0; }

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_2

Step: 3

blur-text-image_3

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

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions

Question

b. What groups were most represented? Why do you think this is so?

Answered: 1 week ago

Question

3. Describe phases of minority identity development.

Answered: 1 week ago

Question

5. Identify and describe nine social and cultural identities.

Answered: 1 week ago