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).
*/

void phoneNo() //function definitions for each of the public member functions go here.
{

return 0;
}

:confused: :confused:

11-13-2002

Sebastiani

What specifically is confusing you?

11-13-2002

correlcj

this portion

the whole public portion...what to place in it and I do declare it in the header file, correct?? My brain seems to be not working with this chapter of classes. Classes, AAAAAAAAAAAWWWWWWWaaarrrgh!!!
:confused:

11-13-2002

Sebastiani

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 :)