Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a C++ program: Design, implement, and test a class that represents a phone number. The number should be represented by a country code, an

Create a C++ program: image text in transcribed
image text in transcribed
Design, implement, and test a class that represents a phone number. The number should be represented by a country code, an area code, a phone number, and a phone type. Please note that the phone number will be a long int because the maximum value that an int can hold is 32768 The type member is an enumeration of HOME, OFFICE, FAX, CELL, and PAGER. It will be stored separately in a file named Phonetype.h, Include preprocessor directives in case the file is included multiple times. See page 642 in your textbook. The Phone class should have . a default constructor that sets all of the integer values to zero and the type to HOME a constructor that enables all of the values to be set, and a constructor that takes just the phone number and type as arguments and sets the country code to 1 and the area code to 731. The class will have observers that enable each data member to the retrieved and transformers that allow each data member to be changed Create another enumeration for the result of comparing two phone numbers. It should contain the values LESSTHAN. GREATERTHAN, and EQUAL. It will be stored separately in a file named PhoneRelationtype.h. Include preprocessor directives in case the file is included multiple times. See page 642 in your textbook. Two additional observers should be created: One that compares two phone numbers and returns a PhoneRelationType and one that writes out the phone number in the format HOME +1 (731) 3521234 For this assignment, you will create and submit the following files: PhoneType.h . PhoneRelationType.h . Phone.h Phone.cpp " In addition, I have provided a driver program that you must use to test your assignment. The program is oroolem2 and you can NOT change this program! You code must compilc and work with this driver program. Click he Design, implement, and test a class that represents a phone number. The number should be represented by a country code, an area code, a phone number, and a phone type. Please note that the phone number will be a long int because the maximum value that an int can hold is 32768 The type member is an enumeration of HOME, OFFICE, FAX, CELL, and PAGER. It will be stored separately in a file named Phonetype.h, Include preprocessor directives in case the file is included multiple times. See page 642 in your textbook. The Phone class should have . a default constructor that sets all of the integer values to zero and the type to HOME a constructor that enables all of the values to be set, and a constructor that takes just the phone number and type as arguments and sets the country code to 1 and the area code to 731. The class will have observers that enable each data member to the retrieved and transformers that allow each data member to be changed Create another enumeration for the result of comparing two phone numbers. It should contain the values LESSTHAN. GREATERTHAN, and EQUAL. It will be stored separately in a file named PhoneRelationtype.h. Include preprocessor directives in case the file is included multiple times. See page 642 in your textbook. Two additional observers should be created: One that compares two phone numbers and returns a PhoneRelationType and one that writes out the phone number in the format HOME +1 (731) 3521234 For this assignment, you will create and submit the following files: PhoneType.h . PhoneRelationType.h . Phone.h Phone.cpp " In addition, I have provided a driver program that you must use to test your assignment. The program is oroolem2 and you can NOT change this program! You code must compilc and work with this driver program. Click he

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

Outline the employee's role in the succession management process.

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago