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

  Downloading movies, and completing schoolwork

Allison spends a lot of time socializing with friends on Facebook, downloading movies, and completing schoolwork. But her older computer needs to be replaced because the latest operating system cannot be installed on her older machine without signifi..

  Write a program using a function and a switch statement

Write a program using a function and a switch statement. The user should be prompted to enter a number in main. The function is called and the number entered is passed to the function. This function parameter will then be used in a switch to disco..

  Declare an array of integers

Declare an array of 10 integers and initialize its elements to the following values: -10; -8; -6; -4; -2; 0; 2; 4; 6;8;10

  Write a class with name time

Write a class with name Time. Make a constructor which calculates the given time in minutes

  An evaluation of blogger

*An evaluation of Blogger *Identify and discuss the online blogs you examined and their usefulness Discuss the place blogging holds in today's availability of information, *and its advantages/disadvantages over more traditional formats such as newspa..

  Demonstrate overriding of their getter and setter methods

Organize following animals using classes and virtual function. tigers,crocodile, elephants,pythons,zebras,hawks, chickens,rabbits using at least 3 properties some of the animals share. demonstrate overriding of their getter and setter methods.

  Questions of c programming

Write a program in C++ to ask the user to input a set of characters, one at a time separated by the carriage return (Enter). Each character, as well as, its corresponding ASCII value should be stored in a linked list node.

  Write an lc-3 machine language program

Write an LC-3 machine language program starting at location x3000 which divides the number in memory location x4000 by the number in memory location x4001 and stores the quotient at x5000 and the remainder at x5001.

  Each clone will communicate to the parent process

Write a program that will create 3 clones. Each clone will communicate to the parent process over a pipe (There are 3 pipes) Each process will write Process n.

  Rewrite the overloaded input operator for the ratio class

Rewrite the overloaded input operator for the Ratio class so that, instead of prompting for the numerator and denominator, it reads a fraction type as "22/7".

  State a program that reads an integer from the keyboard

Write a program that reads an integer from the keyboard, and prints the integer to the screen. You must write a function to do this task. After the integer is printed, you must call a function (that you write) which asks the user to enter a ‘Y' or..

  Problem on c++ tools

When working in teams (at most two students per team), send one solution file per team.

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