Definition of the member functions to implement class

Assignment Help C/C++ Programming
Reference no: EM13937906

Example 12-9

#include <string>
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:

a) Set the first name only

b) Set the last name only

c) Store and set the middle name

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

e) 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.

Reference no: EM13937906

Questions Cloud

Carbonyl compounds to the corresponding alcohol : Eugene Hur, a former undergraduate in our lab has discovered that AKR3A1, a protein from budding yeast, catalyzes the NADPH-dependent reduction of various carbonyl compounds to the corresponding alcohol. At saturating concentrations of the cosubst..
What is process that government goes through to make sure : What is the process that the government goes through to make sure that they adopt a balanced budget as prescribed by the Constitution? What roles do the governor, the Congress, and bureaucracy play in this process? (This is over Texas Govt)
Show how each transaction affects the accounting equation : Show how each transaction affects the accounting equation. Prepare the four basic financial statements for the month of April. (Balance Sheet at April 30, 2009)
Most protection from prepayment risk : What are the promised coupon payments to each of the classes during the first quarter? What is the total interest payment due? If the trustee received a payment of $4,834,796, how would the payment be applied? Assume that for the first year the trust..
Definition of the member functions to implement class : 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.
What are the total assets of the company at end of november : What are the total assets of the company at the end of November 2008? Prepare a statement of cash flows for November 2008. What was net income for November 2008?
Implement the data modelling for a database : Implement the data modelling for a database that is based on the following application scenario. The application scenario The online sale company Best Deal needs to implement a database to manage its business data. The company has delegated this t..
Benefits and challenges of integrating the operations : Apply a systems perspective to discuss why it is important to align the supply chain strategy with the design of the electronic business platform, and the benefits and challenges of integrating the operations of the two.
Compare two definitions of advanced practice nursing : Compare and contrast the two definitions of advanced practice nursing as defined by the American Association of Colleges of Nursing (AACN) DNP Essentials, the APRN consensus model, and as defined in your textbook.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Repare a c++ class derived that inherits from base class

Write a C++ class Base has two member functions: //add constructor(s) if needed int f () {return x*25;} //x is a protected data member of Base class virtual int g() {return x *35; }

  Returns a count of the steps through the sort

Please write a c++ implimentation that returns a count of the steps through the sort. (do not worry about updating count, I will rewrite that segemnt. I need help with writing the shell sort.

  Write a function template square()

Write a function template Square() that returns the square of its only argument.

  Prompt the user for 3 sentences of text

Prompt the user for 3 sentences of text. Pass these pieces of text into a function connect() which will connect all three sentences into one long sentence. Pass the combination sentence back to the main program, where it is printed.

  The manager of a football stadium

The manager of a football stadium wants you to write a program that calculates the total ticket sales after each game. There are four types of tickets-box, sideline, premium and general admission. The data is stored in a file, tickets.txt, in the fol..

  Write a program to convert between rectangular

Write a program to convert between rectangular and cylindrical coordinates, based upon user input. For example, if the user wants to convert cylindrical to rectangular coordinates, the user would input r, ?, z values and the program would output x, y..

  Documenting the testing of c program

Writing a test plan and writing a C program with reasonable comments and sensible variable names - Test and documenting the testing of your c program

  Consider the following class denition this class is

consider the following class denition. this class is considered to be in an inconsistent state if the isconsistent

  Define method get string input

For this assignment, you will be adding additional logic to handle a few additional properties of the order, the simple validation of properties, and the total cost of the order, including sales tax. You will implement these new capabilities using..

  This program need to be writen in c in this program we need

this program need to be writen in c in this program we need to create program that uses functions and reference

  Question rearding the software process models

Waterfall, V-shape, and Rapid Application Development (RAD) are among well-established software process models that have been used to develop software

  Create a data dictionary

Sequential Logic Structures are the most commonly used logic structures to accomplish a task with a sequence of steps. Using the example from Phase 1 of an online retail business, identify the sequential logic structure to capture the payment info..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd