For C++ The following class represents a telephone number in the United States: enum PhoneType (HOME, OFFICE, CELL); class Phone { public: Phone(int newAreaCode, int newNumber, PhoneType newType); void Write() const; private: int areaCode; int number; PhoneType type; } We want to use inheritance to derive an international phone number class, called InternPhone, from the Phone class above. The InternPhone class needs to add a country code, represented as an integer, used to identify the country. The public operations the InternPhone class are responsible for are: Write() Reimplements the Write function from the base class. Paramaterized Constructor Requires four parameters. Write the class declaration for the InternPhone class. Provide an implementation for the InternPhone Provide an implementation for the InternPhone Write()
For C++
The following class represents a telephone number in the United States:
enum PhoneType (HOME, OFFICE, CELL);
class Phone
{
public:
Phone(int newAreaCode, int newNumber, PhoneType newType);
void Write() const;
private:
int areaCode;
int number;
PhoneType type;
}
We want to use inheritance to derive an international phone number class, called InternPhone, from the Phone class above. The InternPhone class needs to add a country code, represented as an integer, used to identify the country. The public operations the InternPhone class are responsible for are:
Write() Reimplements the Write function from the base class.
Paramaterized Constructor Requires four parameters.
Write the class declaration for the InternPhone class.
Provide an implementation for the InternPhone
Provide an implementation for the InternPhone Write()
In this question we have to write a C++ code where class represents a telephone number in the United States:
Let's code and hope this helps if you have any queries utilize threaded questions feature
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images