📄 phonenumber.cpp
字号:
// Tutorial 22: PhoneNumber.cpp
// PhoneNumber class member-function and nonmember-function
// definitions.
#include <iostream> // required to perform C++ stream I/O
#include "PhoneNumber.h" // PhoneNumber class definition
// constructor
PhoneNumber::PhoneNumber()
{
setAreaCode( "" );
setExchange( "" );
setLine( "" );
} // end constructor
// returns the PhoneNumber's area code
string PhoneNumber::getAreaCode()
{
return areaCode;
} // end function getAreaCode
// sets the area code
void PhoneNumber::setAreaCode( string inputAreaCode )
{
areaCode = inputAreaCode;
} // end function setAreaCode
// returns the PhoneNumber's exchange
string PhoneNumber::getExchange()
{
return exchange;
} // end function getExchange
// sets the exchange
void PhoneNumber::setExchange( string inputExchange )
{
exchange = inputExchange;
} // end function setExchange
// returns the PhoneNumber's line
string PhoneNumber::getLine()
{
return line;
} // end function getLine
// sets the line
void PhoneNumber::setLine( string inputLine )
{
line = inputLine;
} // end function setLine
/**************************************************************************
* (C) Copyright 1992-2005 by Deitel & Associates, Inc. and *
* Pearson Education, Inc. All Rights Reserved. *
* DISCLAIMER: The authors and publisher of this book have used their *
* best efforts in preparing the book. These efforts include the *
* development, research, and testing of the theories and programs *
* to determine their effectiveness. The authors and publisher make *
* no warranty of any kind, expressed or implied, with regard to these *
* programs or to the documentation contained in these books. The authors *
* and publisher shall not be liable in any event for incidental or *
* consequential damages in connection with, or arising out of, the *
* furnishing, performance, or use of these programs. *
**************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -