Classes using phone numbers

This is a discussion on Classes using phone numbers within the C++ Programming forums, part of the General Programming Boards category; Greetings,
What is wrong with this? I am having problems understanding classes, man. I need a push in the right ...

Classes using phone numbers

Greetings,

What is wrong with this? I am having problems understanding classes, man. I need a push in the right direction, plz

Code:

/* Specs:
* an area code, an exchange, a local number, and a long-distance indicator (true or false).
* Design and build a PhoneNumber class that models a phone number, providing operations
* to construct, input, output extract each of the data members of a PhoneNumber object,
* and indicate whether or not the number is long-distance. The input operation should
* read a local or long-distance number and set the long-distance indicator accordingly.
* The output operation should display a local number differently from the way it
* displays a long-distance number (e.g., 555-1234 vs. (616) 555-1234).
*/
class PhoneNumber
{
public:
phoneNo(); //declare constructor here
//declare functions to change and retrieve each of the private data members here
void Print (ostream & out) const; //declare function to get input here
phNo_Print(cout); //declare function to output phone number here
private:
//declare private data members here
int areaCode;
int exchange;
int localNumber;
bool longDistance;
};
void phoneNo() //function definitions for each of the public member functions go here.
{
return 0;
}

"Be formless, shapeless, like water... You put water into a cup, it becomes the cup, you put water into a bottle, it becomes the bottle, you put it in a teapot, it becomes the teapot... Now water can flow, or it can crash, be water my friend."
-Bruce Lee

How would you solve this with C? Try that first, making sure to be "object oriented" about it. Do the easy stuff first too, and test that first before moving on. Then write it using classes that encapsulate the C functions. Finally, write it to spec. Just an idea