Computer Science Homework Solutions
Problem
#166831

Classes and Data Abstraction

See attachment.  Please do not make the code very complicated on this C++ program.  The topic is Classes and Data Abstraction.  Please make sure to use this concept for the program.

Attached file(s):
Attachments
Chap12_Ex.4.doc  View File

Attachment Content Summary (Note: view attachment at the above link before purchasing. Actual attachment content may vary slightly from that shown below.)

Chap12_Ex.4.doc
Example 12-9

#include

Using namespace std;

Class personType

{

Public:

Void print () const;

.

.

Void setName (string first, string last);

.

.

String getFirstName () const;

.

.

String getLastName () const;

.

.

personType (string first = “ “, string last= “ “);

Private:

String firstName;

String lastName;

};

Example 12-9 defined a class personType to store the name of a person.
The member functions that we included merely print the name and set the
name of a person. Redefine the class peronType so that, in addition to
what the existing class does, you can:

Set the first name only

Set the last name only

Store and set the middle name

Check whether a given first name is the same as the first name of this
person

Check whether a given last name is the same as the name of this person

Write the definition of the member functions to implement the operations
for this class. Also, write a program to test various operations on
this class.
Solution
What is this?
By OTA - Overall OTA Rating
Purchase Cost Now
$2.19 CAD (was ~$11.97)
Included in Download
  • Plain text response
  • Attached file(s):
    • main.cpp
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
Browse